erfinv

Purpose

Inverse of the error function.

Synopsis

x = erfinv(y)

Description

x = erfinv(y), where -1 < y < 1 returns a value in the range -Inf < x < Inf and satisfies y = erf(x) to within roundoff error. erfinv(1) is Inf, erfinv(-1) is -Inf. For abs(y) > 1, erfinv(y) is NaN.

Algorithm

Rational approximations accurate to approximately six significant digits are used to generate an initial approximation, which is then improved to full accuracy by two steps of Newton's method. The M-file can easily be modified to eliminate the Newton improvement. The resulting code is about three times faster in execution, but is considerably less accurate.

See Also

erf

(c) Copyright 1994 by The MathWorks, Inc.