-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong result for lower incomplete gamma function and x = 0 #1249
Comments
I am working on a fix |
cohomology
added a commit
to cohomology/math
that referenced
this issue
Apr 1, 2025
In this case, the errno error handling did not work correctly, as internal functions where accidently setting it, although no overflow happens. Fixes boostorg#1249.
cohomology
added a commit
to cohomology/math
that referenced
this issue
Apr 1, 2025
In this case, the errno error handling did not work correctly, as internal functions where accidently setting it, although no overflow happens. Fixes boostorg#1249.
cohomology
added a commit
to cohomology/math
that referenced
this issue
Apr 2, 2025
In this case, the errno error handling did not work correctly, as internal functions where accidently setting it, although no overflow happens. Fixes boostorg#1249.
What I am wondering is that there are many instances of log(x) or 1 / x in gamma.hpp and generally no checks for x != 0 anywhere. Just happily applied. Perhaps worth to check them all at some point. |
cohomology
added a commit
to cohomology/math
that referenced
this issue
Apr 2, 2025
In this case, the errno error handling did not work correctly, as internal functions where accidently setting it, although no overflow happens. Fixes boostorg#1249.
cohomology
added a commit
to cohomology/math
that referenced
this issue
Apr 2, 2025
In this case, the errno error handling did not work correctly, as internal functions where accidently setting it, although no overflow happens. Fixes boostorg#1249.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Computation of tgamma_lower or any other incomplete gamma function yields wrong results for x = 0.
I am directly referring to special_functions/gamma.hpp, function
gamma_incomplete_imp_final
and for simplicity we compute with typeT = double
.When trying to compute the lower incomplete gamma function with
a = 1 and x = 0, the check:
lets everything through and the computation continues.
Later we have the following check:
This sets errno to EDOM and eval_method to 2, as log(0) is -Inf.
Now the computation continues and continues, but errno is never set back. Thus the caller, when he chose the ERRNO error propagation method, gets the wrong result overflow, where the result should be 0.
The text was updated successfully, but these errors were encountered: