Error function

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.




erf(x) represents the error function .

This function is defined for all complex arguments x.

For floating-point arguments the error functions erf, erfc, and erfi return floating-point values. The implemented exact values are:

erf(0) = 0, erf(∞) = 1, erf(- ∞) = - 1, erf(i ∞) = i ∞, erf(- i ∞) = - i ∞,

For all other arguments, the error function returns symbolic function calls.

For the function erf with floating-point arguments of large absolute value, internal numerical underflow or overflow can happen.

The error functions erf(x) = 1 - erfc(x) and erfi(x) = i (erfc(x i) - 1) return corresponding values for large arguments. See Example 2.

MuPAD® can simplify expressions that contain error functions and their inverses. For real values x, the system applies the following simplification rules:

inverf(erf(x)) = inverf(1 - erfc(x)) = inverfc(1 - erf(x)) = inverfc(erfc(x)) = x,

inverf(- erf(x)) = inverf(erfc(x) - 1) = inverfc(1 + erf(x)) = inverfc(2 - erfc(x)) = - x

For any value x, the system applies the following simplification rules:

inverf(- x) = - inverf(x),

inverfc(2 - x) = - inverfc(x),

erf(inverf(x)) = erfc(inverfc(x)) = x.

erf(inverfc(x)) = erfc(inverf(x)) = 1 - x.

Environment Interactions

When called with a floating-point argument, the functions are sensitive to the environment variable DIGITS, which determines the numerical working precision.


Example 1

You can call error functions with exact and symbolic arguments:

erf(0), erf(3/2), erf(sqrt(2)), erf(infinity)

erfc(0), erfc(x + 1), erfc(-infinity)

erfc(0, n), erfc(x + 1, -1), erfc(-infinity, 5)

erfi(0), erfi(x + 1), erfi(-infinity)

inverf(-1), inverf(0), inverf(1), inverf(x + 1), inverf(1/5)

inverfc(0), inverfc(1), inverfc(2), inverfc(15), inverfc(x/5)

For floating-point arguments, the error functions return floating-point values:

erf(-7.2), erfc(2.0 + 3.5*I), erfc(3.0, 4), erfi(5.5 + 1.0*I)

For floating-point arguments x from the interval [-1, 1], inverf returns floating-point values:

inverf(-0.5), inverf(0.85)

For floating-point arguments outside of this interval, inverf returns symbolic function calls:

inverf(-5.3), inverf(10.0)

For floating-point arguments x from the interval [0, 2], inverfc returns floating-point values:

inverfc(0.5), inverfc(1.25)

For floating-point arguments outside of this interval, inverfc returns symbolic function calls:

inverfc(-1.25), inverfc(2.5)

Example 2

For large complex arguments, the error functions can return :

erf(38000.0 + 3801.0*I),
erfi(38000.0 + 3801.0*I),
erfc(38000.0 + 3801.0*I)

For large floating-point arguments with positive real parts, erfc can return values truncated to 0.0:

erfc(27281.1), erfc(27281.2)

Example 3

The functions diff, float, limit, expand, rewrite, and series handle expressions involving the error functions:

diff(erf(x), x, x, x)

diff(erfc(x, 3), x, x)

diff(inverf(x), x)

float(ln(3 + erfi(sqrt(PI)*I)))

limit(x/(1 + x)*erf(x), x = infinity)

expand(erfc(x, 3))

rewrite(inverfc(x), inverf)

series(erf(x), x = infinity, 3)

series(erfc(x), x = infinity, 3)

series(erfi(x), x = I*infinity, 3)



An arithmetical expression

Return Values

Arithmetical expression


erf, erfc, and erfi are entire functions.

Was this topic helpful?