Computes the error and complementary error functions.
IEEE Math Library (libm.a)
or
System V Math Library (libmsaa.a)
#include <math.h>
double erf ( x)
double x;
float erff (x) float x;
long double erfl (x) long double x;
The erf, erff, and erfl subroutines return the error function of the x parameter, defined for the erf subroutine as the following:
erf(x) = (2/sqrt(pi) * (integral [0 to x] of exp(-(t**2)) dt)
erfc(x) = 1.0 - erf(x)
cc erf.c -lm
An application wishing to check for error situations should set errno to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions. Upon return, if errno is nonzero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is nonzero, an error has occurred.
x | Specifies a double-precision floating-point value. |
Upon successful completion, the erf, erff, and erfl subroutines return the value of the error function.
If x is NaN, a NaN is returned.
If x is ±0, ±0 is returned.
If x is ±Inf, ±1 is returned.
If x is subnormal, a range error may occur, and 2 * x/sqrt(pi) should be returned.
erfc, erfcf, or erfcl Subroutine, exp, expf, or expl Subroutine, feclearexcept Subroutine, fetestexcept Subroutine, and class, _class, finite, isnan, or unordered Subroutines.
The sqrt, sqrtf, or sqrtl Subroutine in AIX 5L Version 5.2 Technical Reference: Base Operating System and Extensions Volume 2.
Subroutines Overview in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.
128-Bit long double Floating-Point Format in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.
math.h in AIX 5L Version 5.2 Files Reference.