No, I don't like rational approximations too much. Sometimes the degrees of the polynomials need to be quite high, and this can sometimes lead to numerical instabilities.
In this case, the power series expansion is quite effective (for smaller imaginary parts), and continued fractions is a technique I personally like very much. And a similar approach works for E(n,x). There are also relations to reduce E(n+1,.) to E(n,.). Above all it works for complex numbers. Convergence is sufficient for the upper half plane and extends to the whole complex plane through the symmetry relation. In the series expansion, I was considering storing all terms and summing up the smallest terms first. I did not see significant differences in accuracies, but I might look into this again. On Wednesday, June 4, 2014 9:00:01 PM UTC+2, Steven G. Johnson wrote: > > > For real arguments, I would guess that you can do better than this using a > minimax rational approximant combined with a coordinate transformation; in > my experience, this is typically faster at a fixed precision than using > convergent series or continued fractions. (Maple or Mathematica can spit > out the optimal approximant for you.) On the other hand, it would be > nice to support complex arguments as well, and for that you typically need > a combination of convergent series, asymptotic series, and/or > continued-fractions in different parts of the domain. And then if you > want E_n rather than just E_1, there are additional complications. > > I opened an issue for this: > https://github.com/JuliaLang/julia/issues/7089 >
