HP-UX Reference (11i v2 03/08) - 3 Library Functions A-M (vol 6)

e
erf(3M) erf(3M)
NAME
erf( ), erff( ), erfl( ), erfw( ), erfq( ), erfc( ), erfcf( ), erfcl( ), erfcw( ), erfcq( ) - error function and complemen-
tary error functions
SYNOPSIS
#include <math.h>
double erf(double x);
double erfc(double x);
Itanium(R)-based System Only
float erff(float x);
long double erfl(long double x);
extended erfw(extended x);
quad erfq(quad x);
float erfcf(float x);
long double erfcl(long double x);
extended erfcw(extended x);
quad erfcq(quad 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 accu-
racy 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.)
Itanium-based System Only
erff() and erfcf() are float versions of erf() and erfc() respectively; they take a
float
argument and return a float result.
erfl() and erfcl() are long double versions of erf() and erfc() respectively; they take a
long double argument and return a long double result.
erfw() and erfcw() are extended versions of erf() and erfc() respectively; they take an
extended argument and return an extended result.
erfq() and erfcq() are equivalent to erfl() and erfcl() respectively on HP-UX systems.
USAGE
To use these functions compile either with the default
-Ae option or with the -Aa and
-D_HPUX_SOURCE options.
To use (for Itanium-based systems)
erfw(), erfcw(), erfq(),orerfcq(), compile also with the
-fpwidetypes option.
To use any of these functions, make sure your program includes
<math.h>, and link in the math library
by specifying -lm on the compiler or linker command line.
For more information, see the HP-UX Floating-Point Guide.
RETURN VALUE
erf(±0) returns ±0.
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.
Section 3258 Hewlett-Packard Company 1 HP-UX 11i Version 2: August 2003