Well, if only double precision is requested, you can compute E1 (or Ei) for 
real x in,
say, 20 lines of julia code, using a combined approach of series expansion 
and continued
fractions -- see Abramowitz and Stegun, Chapter 5. The other one, Ei or E1, 
is then given 
by the equation above.

I have already done this some weeks ago -- and checked against Maxima. I 
wonder in 
which package this might fit.


On Tuesday, June 3, 2014 2:59:39 PM UTC+2, Steven G. Johnson wrote:
>
>
>
> On Tuesday, June 3, 2014 7:02:34 AM UTC-4, Hans W Borchers wrote:
>>
>> In your function I cannot calculate eint(big(-3.0)), it returns
>> "nan with 256 bits of precision" (never seen `nan` with so many digits).
>>
>
> Wow, it is surprising that MPFR does not support negative arguments here.
>  
>
>> So I assume your function computes Ei, and not the E1 exponential integral
>> while, e.g., The MATLAB function expint computes E1.
>>
>
> Too bad that MPFR computes Ei and not E1.
>
> I agree that the E_n functions are often nicer to have than Ei.
>
> Another alternative is to use the SciPy via PyCall, but this only gives 
> you a double-precision version of E1:
>
> julia> using PyCall
>          @pyimport scipy.special as s
>          s.exp1(3.0)
> 0.013048381094197039
>
>

Reply via email to