ERF 3CW "09 March 2006" "mathcw-1.00"

Table of contents


NAME

erff, erf, erfl, erfw, erfq, erfll, erfdf, erfd, erfdl, erfdll - error function

SYNOPSIS

cc [ flags ] -I/usr/local/include file(s) -L/usr/local/lib -lmcw [ ... ]

#include <mathcw.h>

extern float erff (float x);

extern double erf (double x);

extern long double erfl (long double x);

extern __float80 erfw (__float80 x);

extern __float128 erfq (__float128 x);

extern long_long_double erfll (long_long_double x);

extern decimal_float erfdf (decimal_float x);

extern decimal_double erfd (decimal_double x);

extern decimal_long_double erfdl (decimal_long_double x);

extern decimal_long_long_double erfdll (decimal_long_long_double x);

NB: Functions with prototypes containing underscores in type names may be available only with certain extended compilers.


DESCRIPTION

Compute the error function of x, defined by
erf(x) = (2/sqrt(pi)) integral(t = 0:x) exp(-t**2) dt = 1 - erfc(x)
This is the area under the scaled normal curve from 0 to x.

RETURN VALUES

If x is finite or Infinity, return the value of the error function, which lies in [0, +1] for x in [0, +Infinity], and in [-1, -0] for x in [-Infinity, -0].

Caution: While the two functions share the simple relation erf(x) + erfc(x) = 1, it is only accurate to compute the larger from the smaller.


ERRORS

For NaN arguments, the returned value is a quiet NaN, and errno is set to EDOM.

SEE ALSO

erfc(3CW), ierf(3CW), ierfc(3CW), iphi(3CW), iphic(3CW), phi(3CW), phic(3CW).