AngouriMath
Erf
Method with 2 overloads
Erf(AngouriMath.Entity.Number.Complex)
Summary
The error function,erf(z) = 2/sqrt(pi) int_0^z e^(-t^2) dt , at the working
precision, for every complexz .
Remarks
With P digits of working precision, up to|z|^2 = P ln 10 it is summed as
erf(z) = 2/sqrt(pi) e^(-z^2) sum 2^n z^(2n + 1)/(1 3 5 ... (2n + 1)) (Abramowitz and Stegun 7.1.6). The terms are all positive on the real line, so a
real argument loses nothing to cancellation. Off it they turn, and the sum loses up
to2 Im(z)^2/ln 10 digits, which are carried as guard digits.
Beyond that it is 1 - erfc(z) , witherfc(z) from its asymptotic series
e^(-z^2)/(z sqrt(pi)) sum (-1)^n (2n - 1)!!/(2 z^2)^n cut at its smallest
term. That term is belowe^(-|z|^2) , and so below the precision there. An
argument in the left half-plane is folded over byerf(-z) = -erf(z) first,
since the asymptotic series holds for|arg z| < 3 pi/4 .
The result is rounded to DecimalPrecisionContext, whose https://github.com/asc-community/AngouriMath/issues/1501
exponent range bounds what can be represented:erfc(30) is about
2.6e-393 and comes out as zero there, anderfi(50) , about
e^2500 , as infinity. The working contexts have no such bound.
Erf(PeterO.Numbers.EDecimal,PeterO.Numbers.EDecimal,PeterO.Numbers.EContext,System.Int32)
Summary
erf(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