-
Notifications
You must be signed in to change notification settings - Fork 181
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
fix: gamma functions #943
fix: gamma functions #943
Conversation
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.
LGTM with the above suggestion @wassup05. Thank you for the fix.
As an additional request, it would be great to see gamma functions a little better documented in the docs files, so the lazy user doesn't have to search into the source code to understand what ranges and types they work with.
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.
LGTM. Thank you.
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.
LGTM @wassup05
This PR tries to address #898
The problem was in the interface
gpx
(meant for internal use only) which had two procedures forx, p are real
andx is real, p is an integer
,p being > 0
in all casesEverything was fine with the second procedure but in the first one it is required that (Fast and accurate evaluation of a
generalized incomplete gamma function)
when x < 0, p be an integer
which wasn't actually programmed in the procedure itself but was being taken care of as and when requiring to callgpx
in such a case. like so https://github.com/fortran-lang/stdlib/blob/master/src/stdlib_specialfunctions_gamma.fypp#L1078-L1099And hence this was not found earlier as the chunk of code was in the case when
x<0 and p<p_lim(x)
(check Algorithm 3) which is now unreachable, hence removed