|
|
HP-UX Reference Volume 4 of 5 > eerf(3M) |
|
NAMEerf(), erfc() — error function and complementary error function DESCRIPTIONerf() returns the error function of x, defined as: (2/sqrt(pi)) * (integral with respect to t from 0 to x of (exp(pow(-t,2)))) erfc() returns the complementary value, 1.0 - erf(x). It prevents the extreme loss of relative accuracy if erf(x) is called for a large x and the result is subtracted from 1.0 (for example, for x = 5, twelve decimal places are lost). The ISO/ANSI C committee has approved the erf() and erfc() functions for inclusion in the C9X draft standard. To use these functions, compile either with the default -Ae option or with the -Aa and -D_HPUX_SOURCE options. Make sure your program includes <math.h>. Link in the math library by specifying -lm on the compiler or linker command line. RETURN VALUEIf x is +INFINITY, erf() returns 1.0. If x is -INFINITY, erf() returns -1.0. If x is +INFINITY, erfc() returns zero. If x is -INFINITY, erfc() returns 2.0. If x is NaN, erf() and erfc() return NaN. If the correct value after rounding would be smaller in magnitude than MINDOUBLE, erf() and erfc() return zero. |
|