Skip to content

10920: Extend gammaIncomplete to cover large a≈x#10938

Merged
thewilsonator merged 3 commits intodlang:stablefrom
tedgin:10920
Jan 26, 2026
Merged

10920: Extend gammaIncomplete to cover large a≈x#10938
thewilsonator merged 3 commits intodlang:stablefrom
tedgin:10920

Conversation

@tedgin
Copy link
Contributor

@tedgin tedgin commented Jan 24, 2026

This addresses #10920.

Adapted the existing function igammaTemmeLarge os that it supports gammaIncomplete as well as its complement gammaIncompleteCompl. As part of this adaptation, log(sigma+1) was replaced with log1p(sigma), since Temme's alorithm requires a to be close to x, which means that sigma is close to 0, making log(sigma+1) imprecise. gammaIncomplete was then modified to use igammaTemmeLarge when x is much larger than 1 and a is near x.

This addresses phobos#10920.

Adapted the existing function igammaTemmeLarge os that it supports
gammaIncomplete as well as its complement gammaIncompleteCompl. As part
of this adaptation, log(sigma+1) was replaced with log1p(sigma), since
Temme's alorithm requires a to be close to x, which means that sigma is
close to 0, making log(sigma+1) imprecise. gammaIncomplete was then
modified to use igammaTemmeLarge when x is much larger than 1 and a is
near x.
@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @tedgin! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "stable + phobos#10938"

@thewilsonator thewilsonator merged commit c61f5ab into dlang:stable Jan 26, 2026
9 of 10 checks passed
@tedgin tedgin deleted the 10920 branch January 26, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants