Error Function

The (complementary) error function is defined by the following integral:

\begin{align} \text{Erfc}(x) &=\frac{2}{\sqrt{\pi}}\int_{x}^{\infty}e^{-t^2}dt\\ \text{Erfc}(x) &= 1 - \text{Erf}(x) \\ \end{align}

The (complementary) error function is closely related to the cumulative normal density function.

\begin{align} \text{Erfc}(x)  &= 2 - 2 N(x\sqrt{2}) \\ \text{Erf}(x)  &= 2 N(x\sqrt{2} ) - 1\\ N(x) &= \frac{1}{2} \text{Erfc}\left(-\frac{x}{\sqrt{2}}\right) \end{align}

[edit] Example

x = 0.7

Erfc(0.7) = 2 - 2 N(0.7 * 1.41421356)
          = 2 - 2 N(0.98994949366)
          = 2 - 1.67780119384
          = 0.32219880616

Erf(0.7)  = 2 N(0.7 * 1.41421356 ) - 1
          = 2 N(0.98994949366) - 1
          = 1.67780119384 - 1
          = 0.67780119384