expintegral_ei() bug on convergence



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

> Dear Ray san,
>
> Thanks for your questions. I will anser them inline below.
>
> 2012/04/17 3:32 "Raymond Toy" <toy.raymond at gmail.com>:
>
> >
> >
> >
> > 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?
>
> There is a point between the radius 1 and 2 simicircles in left half plane
> where continued fraction expansion does not converge. So, I picked up a
> larger radius. I have not investigated the cf-expansion's convergence
> region in detail.
>
> Do you have an example where the continued fraction does not converge?  I
looked at A&S 5.1.22 for the continued fraction and it says it converges
for |arg(z)|<pi, it seems that we could just use the fraction for |z| > 1
and |arg(z)| < .9*pi.

>
> > (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?
>
> That is right. There may be some room (0.01 or 0.02) for improvement,
> though.
>
>
0.9 is good enough for me.  I don't think we need to refine this, unless we
find a case where the series gives the wrong value but the continued
fraction does not.

Ray