erfcinv

Inverse of the complementary error function.

Category: Mathematics > Elementary Math

Syntax

Y = erfcinv(X)

Returns the value Y such that erfc(Y) equals X.

Description

erfcinv(X) equals erfinv(1 - X), but it stays accurate for X near zero, where 1 - X would lose precision. It is used to compute extreme quantiles of the normal distribution: the p quantile is -sqrt(2)*erfcinv(2*p).

Input arguments

X
Real values in [0, 2].

Output arguments

Y
Array of the same size as X. erfcinv(0) is Inf, erfcinv(1) is 0 and erfcinv(2) is -Inf.

Example

Inverse complementary error function

x = erfcinv([0.5 1])
erfc(x)
erfcinv(0.3)
Output
x = 1×2

    0.4769         0
ans = 1×2

    0.5000    1.0000
ans = 0.7329

See also

erfc erfinv erf