Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ erfc(3M) — HP-UX 10.20

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

exp(3M)

isinf(3M)

isnan(3M)

values(5)

erf(3M)

NAME

erf(), erfc() − error function and complementary error function

SYNOPSIS

#include <math.h>

double erf(double x);

double erfc(double x);

DESCRIPTION

erf() 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). 

To use these functions, link in the math library by specifying −lm on the compiler or linker command line. 

RETURN VALUE

If 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. 

ERRORS

No errors are defined. 

SEE ALSO

exp(3M), isinf(3M), isnan(3M), values(5). 

STANDARDS CONFORMANCE

erf(): SVID3, XPG4.2

erfc(): SVID3, XPG4.2

Hewlett-Packard Company  —  HP-UX Release 10.20:  July 1996

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026