erf
- Date:
10-20-2011
NAME
erf, erfc, erfl, erfcl, DERF, DERFC, QERF, QERFC - Returns error function and complementary error function
SYNOPSIS
C++ SYNOPSIS
#include <math.h>
double erf (double x);
double erfc (double x);
long double erfl (long double x);
long double erfcl (long double x);
float erff(float x);
float erfcf(float x);
FORTRAN SYNOPSIS (CLE)
REAL*4 R1,R2
REAL*8 D1,D2,DERF
R2 = ERF(R1)
D2 = ERF(D1)
D2 = DERF(D1)
REAL*4 R1,R2
REAL*8 D1,D2,DERFC
R2 = ERFC(R1)
D2 = ERFC(D1)
D2 = DERFC(D1)
FORTRAN SYNOPSIS (UNICOS/mp)
REAL*4 R1,R2,ERF
REAL*8 D1,D2,DERF
REAL*16 Q1,Q2,QERF
R2 = ERF(R1)
D2 = DERF(D1)
Q2 = QERF(Q1)
REAL*4 R1,R2,ERFC
REAL*8 D1,D2,DERFC
REAL*16 Q1,Q2,QERFC
R2 = ERFC(R1)
D2 = DERFC(D1)
Q2 = QERFC(Q1)
IMPLEMENTATION
Cray Linux Environment (CLE)
Cray Linux Environment (CLE)
STANDARDS
Fortran
Fortran extensions: DERF, DERFC
Fortran extensions: QERF, QERFC (UNICOS/mp only)
DESCRIPTION
QERF, QERFC, DERF, and DERFC are specific function names.
On CLE systems, ERF and ERFC are generic functions and elemental intrinsic functions. On UNICOS/mp systems, ERF and ERFC are specific function names.
The erf function returns the error function of x, which is defined as follows:
2/sqrt(pi) times the integral from 0 to x of exp(-t*t) dt
erfc, which returns 1.0 - erf(x), is provided because of the extreme loss of relative accuracy if erf(x) is called for large x and the result subtracted from 1.0 (for example, for x = 5, twelve places are lost).
Note: Currently, erfl, erfcl, QERF, and QERFC are only as accurate as their real*8 counterparts.