AngouriMath
Ei
Method with 2 overloads
Ei(AngouriMath.Entity.Number.Complex)
Summary
The exponential integral,Ei(z) = gamma + (ln z - ln(1/z))/2 + sum_(k >= 1) z^k/(k k!) ,
at the working precision, for every complexz ;Ei(0) is-oo .
Remarks
(ln z - ln(1/z))/2 isln z off the negative real axis andln |z| on it, soEi is real on the whole real line but 0, as SymPy's, mpmath's and
Mathematica's is: on the positive axis it is the principal value of
int_-oo^x e^t/t dt , on the negative axis-E1(-x) , and just above or below
the negative axis it isi pi more or less.
With P digits of working precision, up to|z| = (P + 5) ln 10 it is summed
as written. The terms peak neark = |z| at aboute^|z|/|z| , while
Ei(z) is aboute^Re(z)/|z| , so the sum cancels(|z| - Re z)/ln 10 digits, which are carried as guard digits: none on the positive real axis, and twice
|x|/ln 10 on the negative one.
Beyond that it is e^z/z sum_k k!/z^k (Abramowitz and Stegun 5.1.51), cut at its
smallest term, which is aboute^(-|z|) of the sum and so below the precision
there, and off the real axis the logarithm's branch addsi pi sgn(Im z) .
The result is rounded to DecimalPrecisionContext, whose https://github.com/asc-community/AngouriMath/issues/1501
exponent range bounds what can be represented:Ei(-500) , about1e-220 ,
can come out as zero there.
Ei(PeterO.Numbers.EDecimal,PeterO.Numbers.EDecimal,PeterO.Numbers.EContext,System.Int32)
Summary
Ei(re + i im) in a context ofcontext 's precision and
extraDigits more, before any rounding back.
Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online