`erf`

, `erff`

, `erfc`

, `erfcf`

---error function#include <math.h> double erf(doublex); float erff(floatx); double erfc(doublex); float erfcf(floatx);

**Description**

`erf`

calculates an approximation to the "error function",
which estimates the probability that an observation will fall within
`x` standard deviations of the mean (assuming a normal
distribution).

`erfc`

calculates the complementary probability; that is,
`erfc(`

is `x`)`1 - erf(`

. `x`)`erfc`

is computed directly,
so that you can use it to avoid the loss of precision that would
result from subtracting large probabilities (on large `x`) from 1.

`erff`

and `erfcf`

differ from `erf`

and `erfc`

only in the
argument and result types.

**Returns**

For positive arguments, `erf`

and all its variants return a
probability--a number between 0 and 1.

**Portability**

None of the variants of `erf`

are ANSI C.

Go to the first, previous, next, last section, table of contents.