-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
Expose hypergeometric_3F2
function
#2797
Conversation
I think all of these hypergeometric functions should (eventually) call the ones in Boost, which have been included in the last several versions. https://www.boost.org/doc/libs/1_79_0/libs/math/doc/html/math_toolkit/hypergeometric.html It is hard to do well with double precision in general, but I think they have put more effort into the numerics that we have or would want to do ourselves. |
This is the only one that doesn't call the Boost implementation, since the |
This is now ready for review. I've updated The gradients are currently being calculated by the |
Summary
This PR renames and exposes the internal
F32
function ashypergeometric_3F2
, and updates the calculations to be on the log-scale for additional stability.The function currently uses autodiff for the gradients, even though there is also an internal
grad_F32
function, but I'll be updating that in a separate PR.Tests
No additional tests, as all existing tests should still pass
Side Effects
N/A
Release notes
Exposed the
hypergeometric_3F2
function and improved its numerical stabilityChecklist
Math issue Hypergeometric function naming #2664
Copyright holder: Andrew Johnson
The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
the basic tests are passing
./runTests.py test/unit
)make test-headers
)make test-math-dependencies
)make doxygen
)make cpplint
)the code is written in idiomatic C++ and changes are documented in the doxygen
the new changes are tested