NAME
erf(), erff(), erfl(), erfw(), erfq(), erfc(), erfcf(), erfcl(), erfcw(), erfcq() — error function and complementary error functions
SYNOPSIS
#include <math.h>
double erf(double x);
double erfc(double x);
HP Integrity Server 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 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.)
Integrity Server 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 Integrity servers)
erfw(),
erfcw(),
erfq(),
or
erfcq(),
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 for HP Integrity servers
at the following site:
http://www.hp.com/go/fp.
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.
Whether
erf()
and
erfc()
raise the
inexact exception is unspecified.
If
x
is NaN,
erf()
and
erfc()
return NaN.
ERRORS
No errors are defined.
STANDARDS CONFORMANCE
erf(),
erfc()
: SVID3, XPG4.2, ISO/IEC C99
(including Annex F, ``IEC 60559 floating-point arithmetic'')
erff(),
erfl(),
erfcf(),
erfcl()
: ISO/IEC C99 (including Annex F, ``IEC 60559 floating-point arithmetic'')