Skip to content
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

Hypergeo fix #1510

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

benjamin-lieser
Copy link
Collaborator

@benjamin-lieser benjamin-lieser commented Oct 12, 2024

  • Added a CHANGELOG.md entry

Summary

This is a fix for #1508
Thanks a lot to @WarrenWeckesser for finding it.

And it also replaces the very crude Stirling's approximation with something more precise without depending on a ln_gamma implementation.

Details

I do not have evidence that the stirling errors effect sampling in a big way, but I also do not have evidence that they do not and the error is quite big for small values.

For performance reasons we could shift by less than 3, but the LOGSQRT2PI correction is cheap and helps already a lot. The 1/12v term might also not matter that much.

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.

2 participants