BUG: special: overflow in hankel1
occuring a little too early
#10795
Labels
defect
A clear bug or issue that prevents SciPy from being installed or used as expected
scipy.special
Reproducing code example:
Error message:
None
Scipy/Numpy/Python version information:
Further details:
What's happening here is that Amos computes
hankel1
function by usingkv
, so it reaches this line:https://github.com/scipy/scipy/blob/master/scipy/special/amos/zbesh.f#L234
and checks whether
kv
would overflow at that point. The limiting form ofkv
is(see https://dlmf.nist.gov/10.30#E2), which does in fact overflow at that point, so Amos reports that the Hankel function overflows and bails out. The limiting form for
hankel1
, however, is the slightly different(see https://dlmf.nist.gov/10.7#E7) which just barely doesn't overflow at that point.
We run into this situation because the smallest absolute value we test when using
Arg()
intest_mpmath
is1e-30
, so if you try to setnan_ok=False
in the Hankel function tests you get a failure. We can obviously fix the overflow, but there's a bit of a question as to where to put the fix (Amos is large and tangly), so I'm making this issue to keep track of what's happening.The text was updated successfully, but these errors were encountered: