-
Notifications
You must be signed in to change notification settings - Fork 230
Fix lower incomplete gamma functions with x = 0 #1251
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
base: develop
Are you sure you want to change the base?
Conversation
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.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1251 +/- ##
===========================================
- Coverage 93.83% 93.82% -0.01%
===========================================
Files 657 658 +1
Lines 55244 55330 +86
===========================================
+ Hits 51840 51916 +76
- Misses 3404 3414 +10
... and 7 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
@@ -1627,7 +1631,7 @@ BOOST_MATH_GPU_ENABLED T gamma_incomplete_imp_final(T a, T x, bool normalised, b | |||
#endif | |||
result = gam - result; | |||
} | |||
if(p_derivative) | |||
if(p_derivative && x > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to let this line execute without the check for x > 0
, that way our root finder will get a derivative back: in this particular case, any arbitrary large value will do.... ah but there should be an else
before the *p_derivative /= x;
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, I adjusted the coding. Is it okay now?
I also corrected some wrong ternary operators in the file which prevent using some functions with non-standard float/double T template parameters.
Other than my one small comment, this all looks good. Many thanks for this! |
Looks great, thanks, just running CI now... |
Where are these CI errors come from? I don't get them ... |
The Cauchy one was failing with the SYCL compiler, and the beta ones are new failure there that are unrelated. The last one is we need to increment the current version in Boost.Config. I would not worry about any of these failures. I need to address them, and make sure we haven't broken CUDA along the way |
Ah shucks, sorry, I hadn't spotted that the new beta tests were failing on CUDA. @mborland some of them are trivial failures (need to update expected error rates), but there are a few "gross" errors which might warrant investigation. Or it may be that the inputs are so extreme that there's not much we can do on that platform. If you have CUDA/Sycl set up can I let you investigate? |
Yes, next week I'll look into these. The Scipy guys also are in a position now to use the CUDA stuff so I'll put some effort into the rest of the library too. |
In this case, the errno error handling did not work correctly, as internal functions where accidently setting it, although no overflow happens.
Fixes #1249.