Sorry, now I see the problem.
I have again tested different real and complex values for the function
expintegral_e(1,z). It seems all to be correct. The values can be verified with
result of functions.wolfram.com and the conjugate values are correct.
(%i9) expintegral_e(1,1.0);
(%o9) 0.21938393439552
(%i10) expintegral_e(1,-1.0);
(%o10) -3.141592653589793*%i-1.895117816355937
(%i11) expintegral_e(1,1.0+%i);
(%o11) 2.8162445198177954E-4-0.17932453503936*%i
(%i12) expintegral_e(1,1.0-%i);
(%o12) 0.17932453503936*%i+2.8162445198177954E-4
(%i13) expintegral_e(1,-1.0+%i);
(%o13) -0.75382280207927*%i-1.764625985563854
(%i14) expintegral_e(1,-1.0-%i);
(%o14) 0.75382280207927*%i-1.764625985563854
But, I am now look more carefully at the mathematic behind the phase factors and
the originally definitions of the function.
I try to complete the work this evening.
Dieter Kaiser
-----Urspr?ngliche Nachricht-----
Von: raymond.toy at ericsson.com [mailto:raymond.toy at ericsson.com]
Gesendet: Montag, 27. Oktober 2008 22:03
An: Dieter Kaiser
Cc: maxima at math.utexas.edu
Betreff: Re: [Maxima] Test suite failures with cvs version?
Dieter Kaiser wrote:
> Hello Ray,
>
> It seems to me that I am a bit tired. Again I was too fast. I did the check
for
> conjugate values with different algorithm and not with conjugate values.
>
> Now I arrived at this routine:
>
> (defun expintegral-ei (z)
> (+
> (- (expintegral-e 1 (- z)))
> ; (- (* 0.5 (- (log z) (log (/ 1 z)))) (log (- z)))
I think we need to decide what the value of the above expression is.
For z = -r (r real, r > 0), I have
1/2*(log(z)-log(1/z)) - log(-z)
= 1/2*(log(r)+%i*%pi-log(1/r)-%i*%pi) - log(r)
= 1/2*(2*log(r)) - log(r)
= 0
For all other z = r*exp(%i*theta), maxima says:
1/2*(log(r*exp(%i*theta))-log(1/(r*exp(%i*theta)))-log(-r*exp(%i*theta))$
rectform(%);
-%i*%pi
This doesn't match what your code does because you sometimes use %i*%pi
or -%i*%pi.
Maybe the real issue is that expintegral_e is computing the wrong value
for negative z?
What definition are you using for Ei and En?
Ray