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

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       erfc, erfcf, erfcl — complementary error functions
13

SYNOPSIS

15       #include <math.h>
16
17       double erfc(double x);
18       float erfcf(float x);
19       long double erfcl(long double x);
20

DESCRIPTION

22       The functionality described on this reference page is aligned with  the
23       ISO C  standard.  Any  conflict between the requirements described here
24       and the ISO C standard is unintentional. This  volume  of  POSIX.1‐2017
25       defers to the ISO C standard.
26
27       These  functions  shall  compute the complementary error function 1.0 -
28       erf(x).
29
30       An application wishing to check for error situations should  set  errno
31       to  zero  and  call  feclearexcept(FE_ALL_EXCEPT)  before calling these
32       functions. On return, if errno is non-zero or fetestexcept(FE_INVALID |
33       FE_DIVBYZERO  |  FE_OVERFLOW  | FE_UNDERFLOW) is non-zero, an error has
34       occurred.
35

RETURN VALUE

37       Upon successful completion, these functions shall return the  value  of
38       the complementary error function.
39
40       If the correct value would cause underflow, and is not representable, a
41       range error may occur, and erfc(), erfcf(), and  erfcl()  shall  return
42       0.0,  or  (if  the IEC 60559 Floating-Point option is not supported) an
43       implementation-defined value no  greater  in  magnitude  than  DBL_MIN,
44       FLT_MIN, and LDBL_MIN, respectively.
45
46       If x is NaN, a NaN shall be returned.
47
48       If x is ±0, +1 shall be returned.
49
50       If x is -Inf, +2 shall be returned.
51
52       If x is +Inf, +0 shall be returned.
53
54       If  the  correct  value  would  cause underflow and is representable, a
55       range error may occur and the correct value shall be returned.
56

ERRORS

58       These functions may fail if:
59
60       Range Error The result underflows.
61
62                   If the integer expression (math_errhandling  &  MATH_ERRNO)
63                   is  non-zero,  then errno shall be set to [ERANGE].  If the
64                   integer expression (math_errhandling &  MATH_ERREXCEPT)  is
65                   non-zero, then the underflow floating-point exception shall
66                   be raised.
67
68       The following sections are informative.
69

EXAMPLES

71       None.
72

APPLICATION USAGE

74       The erfc() function is provided because of the extreme loss of relative
75       accuracy if erf(x) is called for large x and the result subtracted from
76       1.0.
77
78       On  error,  the  expressions  (math_errhandling   &   MATH_ERRNO)   and
79       (math_errhandling  & MATH_ERREXCEPT) are independent of each other, but
80       at least one of them must be non-zero.
81

RATIONALE

83       None.
84

FUTURE DIRECTIONS

86       None.
87

SEE ALSO

89       erf(), feclearexcept(), fetestexcept(), isnan()
90
91       The Base Definitions volume of POSIX.1‐2017, Section 4.20, Treatment of
92       Error Conditions for Mathematical Functions, <math.h>
93
95       Portions  of  this text are reprinted and reproduced in electronic form
96       from IEEE Std 1003.1-2017, Standard for Information Technology --  Por‐
97       table  Operating System Interface (POSIX), The Open Group Base Specifi‐
98       cations Issue 7, 2018 Edition, Copyright (C) 2018 by the  Institute  of
99       Electrical  and  Electronics Engineers, Inc and The Open Group.  In the
100       event of any discrepancy between this version and the original IEEE and
101       The  Open Group Standard, the original IEEE and The Open Group Standard
102       is the referee document. The original Standard can be  obtained  online
103       at http://www.opengroup.org/unix/online.html .
104
105       Any  typographical  or  formatting  errors that appear in this page are
106       most likely to have been introduced during the conversion of the source
107       files  to  man page format. To report such errors, see https://www.ker
108       nel.org/doc/man-pages/reporting_bugs.html .
109
110
111
112IEEE/The Open Group                  2017                             ERFC(3P)
Impressum