AngouriMath

Navigation

SpecialFunctions


← Back to list of classes

Description

Summary

The special functions in double precision: erf, erfc, erfi, Ei,
li, Si, Ci, Shi and Chi. Both compilers call them, and they
sit beside the numerical evaluation so that its fast tier can take them up too.
The interpreter's kernels, Erf(AngouriMath.Entity.Number.Complex) and the
others, work in arbitrary precision. At 20 digits they take 0.7 to 5.5 ms a call. Newton's
method makes thousands of calls. These take a microsecond or two.
https://github.com/asc-community/AngouriMath/issues/1607

Remarks

Each is the kernel's function, with the kernel's branch cuts and the kernel's values on the
axes. They were measured against the kernels at 30 digits on some ten thousand points: a
grid of [-14, 14]^2, both axes out to 40 and down to 1e-4, either side of the
negative real axis, and circles out to 300. The integrals agree to within 6e-14 of the
value. The error functions agree to within 3e-13, which is the rounding of
z^2 in their e^(-z^2) where |z| is large. An imaginary part of
either sign of zero is read as the axis, as the kernels read it.
The error functions come from the Faddeeva function
w(z) = e^(-z^2) erfc(-i z), by Weideman's rational approximation with 40 terms
(J. A. C. Weideman, Computation of the complex error function, SIAM J. Numer. Anal.
31, 1994), and near the origin from the Taylor series of erf.
Ei is summed as its series where the terms cancel little, which is where
|z| - Re z is at most 3 or |z| at most 2. Out to |z| = 40 it is
-E1(-z) otherwise, by E1's continued fraction, plus the branch term. From
40 on it is the asymptotic series. li is Ei of the logarithm. Shi and
Chi are summed as their own series by the same rule with |Re z|, and
otherwise come from Ei(z) and Ei(-z). Si and Ci are those at
i z. Every relation is one the kernels state.

Members

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online