erfinv
Inverse error function
📝Syntax
R = erfinv(X)
📥Input Arguments
Parameter Description
X a real single or real double scalar, vector, matrix, or multidimensional array. Sparse and complex inputs are not supported.
📤Output Arguments
Parameter Description
R inverse error function values, returned with the same size and floating-point class as X.
📄Description

erfinv computes the inverse error function element by element.

The inverse error function is defined by:

$$erfinv(erf(x)) = x$$

Values outside the interval [-1, 1] return NaN. The values -1 and 1 return -Inf and Inf, respectively.

For expressions of the form erfinv(1 - x), use erfcinv(x) for better accuracy when x is small.

💡Examples
Find the inverse error function of a scalar.
R = erfinv(0.25)
Evaluate boundary and out-of-domain values.
R = erfinv([-2 -1 1 2])
Find the inverse error function of the elements of a matrix.
M = [0 -0.5; 0.9 -0.2];
R = erfinv(M)
Generate normally distributed values from uniform values in [-1, 1].
x = -1 + 2 * rand(1, 10000);
y = sqrt(2) * erfinv(x);
🔗See Also
erferfcinverfc
🕔Version History
Version Description
1.17.0 initial version
Edit this page on GitHub