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

3F2 returns NaNs #79

Open
christofbradly opened this issue Apr 28, 2024 · 2 comments
Open

3F2 returns NaNs #79

christofbradly opened this issue Apr 28, 2024 · 2 comments

Comments

@christofbradly
Copy link

I have found several cases where _3F2 incorrectly returns NaN. For example:

julia> _₃F₂(-9.0, 16.5, 12.5, 29.0, -32.5, 1.0)
NaN

It may be similar to #73 . But I do not see any simple pattern in my cases. The suggestion in that thread to perturb the argument gives the correct results (compared to e.g. Mathematica).

All cases I have found NaNs:
(all evaluated at z=1.0):

-9.0, 16.5, 12.5, 29.0, -32.5, 1.0
-9.0, 24.5, 16.5, 41.0, -43.5, 1.0
-13.0, 4.5, 3.5, 8.0, -17.5, 1.0
-13.0, 5.5, 4.5, 10.0, -20.5, 1.0
-13.0, 6.5, 5.5, 12.0, -23.5, 1.0
-13.0, 7.5, 6.5, 14.0, -26.5, 1.0
-13.0, 8.5, 7.5, 16.0, -29.5, 1.0
-13.0, 9.5, 8.5, 18.0, -32.5, 1.0
-13.0, 10.5, 9.5, 20.0, -35.5, 1.0
-13.0, 11.5, 10.5, 22.0, -38.5, 1.0
-13.0, 12.5, 11.5, 24.0, -41.5, 1.0
-13.0, 13.5, 12.5, 26.0, -44.5, 1.0
-13.0, 14.5, 13.5, 28.0, -47.5, 1.0
-13.0, 15.5, 14.5, 30.0, -50.5, 1.0
-13.0, 16.5, 15.5, 32.0, -53.5, 1.0
-17.0, 7.5, 3.5, 11.0, -26.5, 1.0
-17.0, 6.5, 4.5, 11.0, -28.5, 1.0
-17.0, 12.5, 6.5, 19.0, -41.5, 1.0
-17.0, 11.5, 7.5, 19.0, -43.5, 1.0
-21.0, 3.5, 2.5, 6.0, -23.5, 1.0
-21.0, 4.5, 3.5, 8.0, -28.5, 1.0
-21.0, 5.5, 4.5, 10.0, -33.5, 1.0
-21.0, 6.5, 5.5, 12.0, -38.5, 1.0
-21.0, 10.5, 3.5, 14.0, -35.5, 1.0
-21.0, 9.5, 4.5, 14.0, -39.5, 1.0
-21.0, 7.5, 6.5, 14.0, -43.5, 1.0
-21.0, 8.5, 7.5, 16.0, -48.5, 1.0
-21.0, 9.5, 8.5, 18.0, -53.5, 1.0
-21.0, 16.5, 3.5, 20.0, -38.5, 1.0
-21.0, 10.5, 9.5, 20.0, -58.5, 1.0
-25.0, 6.5, 2.5, 9.0, -32.5, 1.0
-25.0, 10.5, 2.5, 13.0, -35.5, 1.0
-25.0, 9.5, 3.5, 13.0, -41.5, 1.0
-25.0, 13.5, 3.5, 17.0, -44.5, 1.0
-25.0, 12.5, 4.5, 17.0, -50.5, 1.0
-25.0, 10.5, 6.5, 17.0, -58.5, 1.0
-25.0, 9.5, 7.5, 17.0, -60.5, 1.0
-25.0, 16.5, 4.5, 21.0, -53.5, 1.0
-29.0, 3.5, 2.5, 6.0, -32.5, 1.0
-29.0, 4.5, 3.5, 8.0, -39.5, 1.0
-29.0, 5.5, 4.5, 10.0, -46.5, 1.0
-29.0, 6.5, 5.5, 12.0, -53.5, 1.0
-29.0, 7.5, 6.5, 14.0, -60.5, 1.0
-29.0, 16.5, 3.5, 20.0, -53.5, 1.0
-33.0, 4.5, 2.5, 7.0, -39.5, 1.0
-33.0, 3.5, 3.5, 7.0, -41.5, 1.0
-37.0, 3.5, 2.5, 6.0, -41.5, 1.0
-37.0, 5.5, 2.5, 8.0, -46.5, 1.0
-37.0, 4.5, 3.5, 8.0, -50.5, 1.0
-37.0, 5.5, 4.5, 10.0, -59.5, 1.0
-37.0, 11.5, 2.5, 14.0, -53.5, 1.0
-41.0, 6.5, 2.5, 9.0, -53.5, 1.0
-41.0, 5.5, 3.5, 9.0, -59.5, 1.0
-41.0, 4.5, 4.5, 9.0, -61.5, 1.0
-41.0, 10.5, 2.5, 13.0, -58.5, 1.0
-45.0, 3.5, 2.5, 6.0, -50.5, 1.0
-45.0, 4.5, 3.5, 8.0, -61.5, 1.0
-45.0, 7.5, 2.5, 10.0, -60.5, 1.0
-53.0, 3.5, 2.5, 6.0, -59.5, 1.0
@christofbradly
Copy link
Author

I have also noticed this was not an issue in v0.3.20.

@MikaelSlevinsky
Copy link
Collaborator

Thank you for the bug report! To be brief, I do know how to fix it: it appears to be a pole/pole situation. I will try to get a fix pushed, but don't hold your breath! The epsilon perturbation is a good patch for the moment because the rational approximations are stable in the neighbourhood of a pole/pole (like the barycentric formula).

In case you're wondering how the pole/pole get simplified technically, it just means a careful analysis of the case where μhi is not 1/0. Here's how pole hopping takes place for the 0F0 case. eee6021

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

2 participants