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

hypergeometric series unreliable for simple values #1861

Open
maciejskorski opened this issue Nov 16, 2024 · 0 comments
Open

hypergeometric series unreliable for simple values #1861

maciejskorski opened this issue Nov 16, 2024 · 0 comments

Comments

@maciejskorski
Copy link

The current implementation of hyp2f1 outputs wrong results for certain basic values, for example:

import tensorflow_probability as tfp

hyp2f1 = tfp.math.hypergeometric.hyp2f1_small_argument
H = 1
hyp2f1(1.0, 0.5 - H, H + 1.5, 9/10) # NaN

This happens under tensorflow_probability==0.24.0 and tensorflow==2.17.1 (e.g. under the current image used by Colab)

The correct result is

from scipy import special
hyp2f1 = special.hyp2f1
hyp2f1(1.0, 0.5 - H, H + 1.5, 9/10) # 0.7836799547024426
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

No branches or pull requests

1 participant