Skip to content

feat: add C implementation for math/base/special/gammaincinv#9982

Merged
Planeshifter merged 9 commits into
stdlib-js:developfrom
Om-A-osc:feat/gammaincinv-c
Jul 10, 2026
Merged

feat: add C implementation for math/base/special/gammaincinv#9982
Planeshifter merged 9 commits into
stdlib-js:developfrom
Om-A-osc:feat/gammaincinv-c

Conversation

@Om-A-osc

Copy link
Copy Markdown
Contributor

type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:

  • task: lint_filenames
    status: passed
  • task: lint_editorconfig
    status: passed
  • task: lint_markdown
    status: passed
  • task: lint_package_json
    status: passed
  • task: lint_repl_help
    status: na
  • task: lint_javascript_src
    status: passed
  • task: lint_javascript_cli
    status: na
  • task: lint_javascript_examples
    status: na
  • task: lint_javascript_tests
    status: passed
  • task: lint_javascript_benchmarks
    status: na
  • task: lint_python
    status: na
  • task: lint_r
    status: na
  • task: lint_c_src
    status: missing_dependencies
  • task: lint_c_examples
    status: missing_dependencies
  • task: lint_c_benchmarks
    status: missing_dependencies
  • task: lint_c_tests_fixtures
    status: na
  • task: lint_shell
    status: na
  • task: lint_typescript_declarations
    status: passed
  • task: lint_typescript_tests
    status: na
  • task: lint_license_headers
    status: passed

Description

What is the purpose of this pull request?

This pull request adds a C implementation for the @stdlib/math/base/special/gammaincinv function and integrates it into the existing native interface.

Specifically, this PR:

  • Adds a C implementation of the inverse incomplete gamma function (stdlib_base_gammaincinv)
  • Adds C benchmarks for performance evaluation
  • Adds C usage examples
  • Updates the C API documentation in the README
  • Updates and extends native tests to validate correctness and edge cases

Once merged, this implementation will enable adding native C implementations for:

  • @stdlib/stats/base/dists/gamma/quantile
  • @stdlib/stats/base/dists/erlang/quantile
  • and others

thereby improving performance and native coverage for distribution quantile functions.

Related Issues

Does this pull request have any related issues?

  • NO

Questions

Any questions for reviewers of this pull request?

No.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

C lint tasks report missing_dependencies, which is expected in environments where the required native tooling is not installed.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

Disclosure

Not applicable.


@stdlib-js/reviewers

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: passed
  - task: lint_package_json
    status: passed
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: passed
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: passed
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: missing_dependencies
  - task: lint_c_examples
    status: missing_dependencies
  - task: lint_c_benchmarks
    status: missing_dependencies
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@Om-A-osc Om-A-osc changed the title feat: add c implementation for gammaincinv feat: add c implementation for math/base/special/gammaincinv Jan 29, 2026
@stdlib-bot stdlib-bot added Math Issue or pull request specific to math functionality. Needs Review A pull request which needs code review. labels Jan 29, 2026
@stdlib-bot

stdlib-bot commented Jan 29, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
math/base/special/gammaincinv $\\color{red}1647/1872$
$\\color{green}+0.00\\%$
$\\color{red}129/160$
$\\color{green}+0.00\\%$
$\\color{red}16/24$
$\\color{green}+0.00\\%$
$\\color{red}1647/1872$
$\\color{green}+0.00\\%$

The above coverage report was generated for the changes in this PR.

---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
  - task: lint_filenames
    status: passed
  - task: lint_editorconfig
    status: passed
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: na
  - task: lint_javascript_src
    status: na
  - task: lint_javascript_cli
    status: na
  - task: lint_javascript_examples
    status: na
  - task: lint_javascript_tests
    status: na
  - task: lint_javascript_benchmarks
    status: na
  - task: lint_python
    status: na
  - task: lint_r
    status: na
  - task: lint_c_src
    status: passed
  - task: lint_c_examples
    status: na
  - task: lint_c_benchmarks
    status: na
  - task: lint_c_tests_fixtures
    status: na
  - task: lint_shell
    status: na
  - task: lint_typescript_declarations
    status: passed
  - task: lint_typescript_tests
    status: na
  - task: lint_license_headers
    status: passed
---
@Planeshifter Planeshifter requested a review from a team July 10, 2026 05:58

@Planeshifter Planeshifter left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now after significant refactoring. Mainly, the C implementation was not faithful to the JavaScript implementation. These have now been aligned.

Thanks, @Om-A-osc!

@Planeshifter Planeshifter added the Ready To Merge A pull request which is ready to be merged. label Jul 10, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

PR Commit Message

feat: add C implementation for `math/base/special/gammaincinv`

PR-URL: https://github.com/stdlib-js/stdlib/pull/9982

Co-authored-by: Philipp Burckhardt <pburckhardt@outlook.com>
Reviewed-by: Philipp Burckhardt <pburckhardt@outlook.com>

Please review the above commit message and make any necessary adjustments.

@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Jul 10, 2026
@Planeshifter Planeshifter merged commit 3c0a11a into stdlib-js:develop Jul 10, 2026
31 checks passed
@stdlib-bot stdlib-bot removed the Ready To Merge A pull request which is ready to be merged. label Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Math Issue or pull request specific to math functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants