expintegral_ei() bug on convergence



Hi Ray san,

> 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.
>

That was my original thought, too. However,
expintegral_e(1,-1.700598-0.612828*%i); will not converge if you use
continued fraction expansion. Here is the error message:
(%i7) expintegral_e(1,-1.700598-0.612828*%i);

expintegral_e: continued fractions failed.#C(-1.700598 -0.612828)
 -- an error. To debug this try: debugmode(true);

Note that abs(-1.700598-0.612828*%i) is around 1.8 .

Thanks and best regards,
Yasuaki Honda, Chiba, Japan


>
> >
>> > (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
>
>