Description
hyp1f1 explodes for modestly large arguments. For example:
scipy.special.hyp1f1(30, 70, 20j)
returns
(-1748.2243027213672+51.441200608645886j)
which is completely wrong (whenever 1 < a < b and z is purely imaginary, abs(1F1(a,b,z)) <= 1).
This doesn't seem to be insoluble, since the package mpmath (also open sourced here on GitHub) returns what seems to be the correct answer:
mpmath.hyp1f1(30, 70, 20j)
mpc(real='-0.32066129006007188', imag='0.38180277645752586')
(I assume this is correct because Mathematica returns the same result. It would be very unlikely if they were both wrong and returned the same answer).
Moreover, I did a simple test. Simply using the Taylor series expansion gives the correct result. The problem with scipy's implementation seems to be in using a recurrence relation to lower the value of 'a' until it is < 2. The recurrence relation relation used is Abramowitz 13.4.1, but I think this is unstable.