-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
scipy.special.zeta returning NaNs #17248
Comments
Hi - thanks for the report! This is due to #17144, which changed >>> from scipy.special import zeta
>>> zeta(-3, 1)
nan I'm not sure what the best fix is here, because we want to make the faster and more accurate native What do you think? |
I see. I really only need zeta(-n, 1) for integer n, which are equivalent to the Bernoulli numbers. These are implemented in Any chance something like that can be implemented easily? |
I see - I think something like that would be possible to implement, simliar to the previous expansion-based implementation of One reason I worry about A benefit of the new implementation is that it's more explicit about where its output is valid. |
If we were to implement a JAX-compatible version of |
Yes! I currently just have a table of them stored in my code which does the job, but it would be helpful generally to have them, since they appear in a lot of special functions (such as polylogs, which I’m trying to implement). Thanks for being so responsive! |
I think this can be closed, as the workaround is implemented and |
Description
After a recent update, the zeta function is returning NaNs for negative Riemann zeta arguments:
This was working in jax v0.4.14, but broken in jax v0.4.15.dev20230823.
Relatedly, even in v0.4.14, zeta(n, 1) for any n <= -9 gives wildly incorrect results (in fact zeta(-n, 1) for all n even should be zero, but scipy.zeta returns increasingly large floats as n increases, giving e.g. 3.72529030e-09 for zeta(-6, 1)).
What jax/jaxlib version are you using?
jax v0.4.15.dev20230823
Which accelerator(s) are you using?
CPU
The text was updated successfully, but these errors were encountered: