 
 
 
7.3.11  Error function
The error function erf is defined by:
where the constant 2/√π is chosen so that
erf(+∞)=1 and erf(−∞)=−1,
since
The erf command
computes the error function.
- 
erf takes
a, a number.
- erf(a) returns the value of erf(a).
Examples
Remark.
The relation between erf and normal_cdf (see
Section 20.4.7) is:
| normal_cdf(x)= |  | + |  | erf | ⎛ ⎜
 ⎜
 ⎜
 ⎜
 ⎝
 |  | ⎞ ⎟
 ⎟
 ⎟
 ⎟
 ⎠
 | 
Indeed, making the change of variable t=u√2 in
normal_cdf(x)=1/2+1/√2π∫0xe−t2/2dt yields:
| normal_cdf(x)= |  | + |  | ∫ |  | e−u2du= |  | + |  | erf | ⎛ ⎜
 ⎜
 ⎜
 ⎜
 ⎝
 |  | ⎞ ⎟
 ⎟
 ⎟
 ⎟
 ⎠
 | . | 
 
 
