expintegral_ei() bug on convergence



2012/4/16 ???? <yasuaki.honda at gmail.com>

>
> So, if everyone is OK with these changes, I will submit it to the git
> server.
>

I'm happy with these changes but I have a few minor questions.


>
>      (cond
> -      ((and (>= (realpart z) 0) (> (abs z) 1.0))
> +      ((or (and (> (abs z) 2) (< (abs (phase z)) (* pi 0.9)))
> +          (and (>= (realpart z) 0) (> (abs z) 1.0)))
>

These conditions seem a little strange. So basically the boundary of the
region looks like a semicircle of radius 1 for the right half-plane and a
semicircle of radius 2 for the left half-plane with a sector taken out near
the negative real axis.

Why the discontinuity on the imaginary axis?  Why a radius of 2?  Does this
improve accuracy?

(It might be useful to add a comment that pi*.9 is needed to pass the
testsuite.  Values bigger than .9 (roughly) cause tests to fail, right?

Ray