1ERFC(P)                    POSIX Programmer's Manual                   ERFC(P)
2
3
4

NAME

6       erfc, erfcf, erfcl - complementary error functions
7

SYNOPSIS

9       #include <math.h>
10
11       double erfc(double x);
12       float erfcf(float x);
13       long double erfcl(long double x);
14
15

DESCRIPTION

17       These  functions  shall  compute the complementary error function 1.0 -
18       erf(x).
19
20       An application wishing to check for error situations should  set  errno
21       to  zero  and  call  feclearexcept(FE_ALL_EXCEPT)  before calling these
22       functions.  On return, if errno is non-zero or  fetestexcept(FE_INVALID
23       |  FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is non-zero, an error has
24       occurred.
25

RETURN VALUE

27       Upon successful completion, these functions shall return the  value  of
28       the complementary error function.
29
30       If  the correct value would cause underflow and is not representable, a
31       range error may occur and    either  0.0  (if  representable),  or   an
32       implementation-defined value shall be returned.
33
34       If x is NaN, a NaN shall be returned.
35
36       If x is ±0, +1 shall be returned.
37
38       If x is -Inf, +2 shall be returned.
39
40       If x is +Inf, +0 shall be returned.
41
42       If  the  correct  value  would  cause underflow and is representable, a
43       range error may occur and the correct value shall be returned.
44

ERRORS

46       These functions may fail if:
47
48       Range Error
49              The result underflows.
50
51       If the integer expression (math_errhandling & MATH_ERRNO) is  non-zero,
52       then  errno  shall  be  set  to  [ERANGE].  If  the  integer expression
53       (math_errhandling & MATH_ERREXCEPT) is  non-zero,  then  the  underflow
54       floating-point exception shall be raised.
55
56
57       The following sections are informative.
58

EXAMPLES

60       None.
61

APPLICATION USAGE

63       The erfc() function is provided because of the extreme loss of relative
64       accuracy if erf(x) is called for large x and the result subtracted from
65       1.0.
66
67       Note  for  IEEE Std 754-1985  double,  26.55  <  x implies erfc( x) has
68       underflowed.
69
70       On  error,  the  expressions  (math_errhandling   &   MATH_ERRNO)   and
71       (math_errhandling  & MATH_ERREXCEPT) are independent of each other, but
72       at least one of them must be non-zero.
73

RATIONALE

75       None.
76

FUTURE DIRECTIONS

78       None.
79

SEE ALSO

81       erf() , feclearexcept() , fetestexcept() , isnan() , the  Base  Defini‐
82       tions  volume of IEEE Std 1003.1-2001, Section 4.18, Treatment of Error
83       Conditions for Mathematical Functions, <math.h>
84
86       Portions of this text are reprinted and reproduced in  electronic  form
87       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
88       -- Portable Operating System Interface (POSIX),  The  Open  Group  Base
89       Specifications  Issue  6,  Copyright  (C) 2001-2003 by the Institute of
90       Electrical and Electronics Engineers, Inc and The Open  Group.  In  the
91       event of any discrepancy between this version and the original IEEE and
92       The Open Group Standard, the original IEEE and The Open Group  Standard
93       is  the  referee document. The original Standard can be obtained online
94       at http://www.opengroup.org/unix/online.html .
95
96
97
98IEEE/The Open Group                  2003                              ERFC(P)
Impressum