Katana VentraIP

Error function

In mathematics, the error function (also called the Gauss error function), often denoted by erf, is a function defined as:[1]

Not to be confused with Loss function.

Error function

Probability, thermodynamics, digital communications

Odd

0

Some authors define without the factor of .[2] This nonelementary integral is a sigmoid function that occurs often in probability, statistics, and partial differential equations. In many of these applications, the function argument is a real number. If the function argument is real, then the function value is also real.


In statistics, for non-negative values of x, the error function has the following interpretation: for a random variable Y that is normally distributed with mean 0 and standard deviation 1/2, erf x is the probability that Y falls in the range [−x, x].


Two closely related functions are the complementary error function (erfc) defined as

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).

Abramowitz and Stegun

Exponential bounds and a pure exponential approximation for the complementary error function are given by

[15]

The above have been generalized to sums of N exponentials with increasing accuracy in terms of N so that erfc x can be accurately approximated or bounded by 2(2x), where

In particular, there is a systematic methodology to solve the numerical coefficients {(an,bn)}N
n = 1
that yield a minimax approximation or bound for the closely related Q-function: Q(x) ≈ (x), Q(x) ≤ (x), or Q(x) ≥ (x) for x ≥ 0. The coefficients {(an,bn)}N
n = 1
for many variations of the exponential approximations and bounds up to N = 25 have been released to open access as a comprehensive dataset.[17]

[16]

A tight approximation of the complementary error function for x ∈ [0,∞) is given by & Lioumpas (2007)[18] who showed for the appropriate choice of parameters {A,B} that

They determined {A,B} = {1.98,1.135}, which gave a good approximation for all x ≥ 0. Alternative coefficients are also available for tailoring accuracy for a specific application or transforming the expression into a tight bound.[19]

Karagiannidis

A single-term lower bound is

where the parameter β can be picked to minimize error on the desired interval of approximation.

[20]

Another approximation is given by Sergei Winitzki using his "global Padé approximations":[22]: 2–3 

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

This approximation can be inverted to obtain an approximation for the inverse error function:

[21]

An approximation with a maximal error of 1.2×10−7 for any real argument is:

with
and

[24]

An approximation of with a maximum relative error less than in absolute value is: for ,

and for

[25]

A simple approximation for real-valued arguments could be done through :

which keeps the absolute difference .

Hyperbolic functions

Related functions[edit]

Complementary error function[edit]

The complementary error function, denoted erfc, is defined as

In -compliant operating systems, the header math.h shall declare and the mathematical library libm shall provide the functions erf and erfc (double precision) as well as their single precision and extended precision counterparts erff, erfl and erfcf, erfcl.[31]

POSIX

The provides erf, erfc, log(erf), and scaled error functions.[32]

GNU Scientific Library

over the whole real line

Gaussian integral

derivative

Gaussian function

renormalized imaginary error function

Dawson function

Goodwin–Staton integral

; Stegun, Irene Ann, eds. (1983) [June 1964]. "Chapter 7". Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables. Applied Mathematics Series. Vol. 55 (Ninth reprint with additional corrections of tenth original printing with corrections (December 1972); first ed.). Washington D.C.; New York: United States Department of Commerce, National Bureau of Standards; Dover Publications. p. 297. ISBN 978-0-486-61272-0. LCCN 64-60036. MR 0167642. LCCN 65-12253.

Abramowitz, Milton

Press, William H.; Teukolsky, Saul A.; Vetterling, William T.; Flannery, Brian P. (2007), , Numerical Recipes: The Art of Scientific Computing (3rd ed.), New York: Cambridge University Press, ISBN 978-0-521-88068-8, archived from the original on 11 August 2011, retrieved 9 August 2011

"Section 6.2. Incomplete Gamma Function and Error Function"

Temme, Nico M. (2010), , in Olver, Frank W. J.; Lozier, Daniel M.; Boisvert, Ronald F.; Clark, Charles W. (eds.), NIST Handbook of Mathematical Functions, Cambridge University Press, ISBN 978-0-521-19225-5, MR 2723248.

"Error Functions, Dawson's and Fresnel Integrals"

A Table of Integrals of the Error Functions