-
Notifications
You must be signed in to change notification settings - Fork 226
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_1F1 with non-positive parameters is wrong #982
Comments
With:
I get 2.770833333333333 which agrees with wolfram alpha. For
I see 0.2274438503537196 which is indeed incorrect. The problem appears to be that Kummer's relation |
* Fix case where b is a negative integer and z is also negative. Add tests etc. Fixes: #982.
hypergeometric_1F1(-2, -4, 2.5) returns 0.3609023, when the correct result is 2.770833 = 2+37/48
hypergeometric_1F1(-2, -4, -2.5) returns 4.39669, when the correct result is 0.2708333 = 37/48
In general, the result of hypergeometric_1F1(a,b,x) is suspect when b<=a<-1 are non-positive integers. The code introduces a point discontinuity under these conditions, so a workaround is to average
hypergeometric_1F1(a,b-epsilon,x) and hypergeometric_1F1(a,b+epsilon,x)
The text was updated successfully, but these errors were encountered: