Error Function - Approximation With Elementary Functions

Approximation With Elementary Functions

Abramowitz and Stegun give several approximations of varying accuracy (equations 7.1.25–28). This allows one to choose the fastest approximation suitable for a given application. In order of increasing accuracy, they are:

(maximum error: 5·10−4)

where a1 = 0.278393, a2 = 0.230389, a3 = 0.000972, a4 = 0.078108

(maximum error: 2.5·10−5)

where p = 0.47047, a1 = 0.3480242, a2 = −0.0958798, a3 = 0.7478556

(maximum error: 3·10−7)

where a1 = 0.0705230784, a2 = 0.0422820123, a3 = 0.0092705272, a4 = 0.0001520143, a5 = 0.0002765672, a6 = 0.0000430638

(maximum error: 1.5·10−7)

where p = 0.3275911, a1 = 0.254829592, a2 = −0.284496736, a3 = 1.421413741, a4 = −1.453152027, a5 = 1.061405429

All of these approximations are valid for x ≥ 0. To use these approximations for negative x, use the fact that erf(x) is an odd function, so erf(x) = −erf(−x).

Another approximation is given by

where

This is designed to be very accurate in a neighborhood of 0 and a neighborhood of infinity, and the error is less than 0.00035 for all x. Using the alternate value a ≈ 0.147 reduces the maximum error to about 0.00012.

This approximation can also be inverted to calculate the inverse error function:

\operatorname{erf}^{-1}(x)\approx \sgn(x) \sqrt{\sqrt{\left(\frac{2}{\pi a}+\frac{\ln(1-x^2)}{2}\right)^2 - \frac{\ln(1-x^2)}{a}}
-\left(\frac{2}{\pi a}+\frac{\ln(1-x^2)}{2}\right)}

Read more about this topic:  Error Function

Famous quotes containing the words elementary and/or functions:

    As if paralyzed by the national fear of ideas, the democratic distrust of whatever strikes beneath the prevailing platitudes, it evades all resolute and honest dealing with what, after all, must be every healthy literature’s elementary materials.
    —H.L. (Henry Lewis)

    In today’s world parents find themselves at the mercy of a society which imposes pressures and priorities that allow neither time nor place for meaningful activities and relations between children and adults, which downgrade the role of parents and the functions of parenthood, and which prevent the parent from doing things he wants to do as a guide, friend, and companion to his children.
    Urie Bronfenbrenner (b. 1917)