]>
Commit | Line | Data |
---|---|---|
1521a504 MK |
1 | .\" Copyright 2008, Linux Foundation, written by Michael Kerrisk |
2 | .\" <mtk.manpages@gmail.com> | |
3 | .\" | |
5fbde956 | 4 | .\" SPDX-License-Identifier: Linux-man-pages-copyleft |
1521a504 | 5 | .\" |
1d767b55 | 6 | .TH ERFC 3 2021-03-22 "GNU" "Linux Programmer's Manual" |
1521a504 MK |
7 | .SH NAME |
8 | erfc, erfcf, erfcl \- complementary error function | |
2af19291 AC |
9 | .SH LIBRARY |
10 | Math library | |
8fc3b2cf | 11 | .RI ( libm ", " \-lm ) |
1521a504 MK |
12 | .SH SYNOPSIS |
13 | .nf | |
14 | .B #include <math.h> | |
dbfe9c70 | 15 | .PP |
1521a504 MK |
16 | .BI "double erfc(double " x ); |
17 | .BI "float erfcf(float " x ); | |
18 | .BI "long double erfcl(long double " x ); | |
1521a504 | 19 | .fi |
dbfe9c70 | 20 | .PP |
d39ad78f | 21 | .RS -4 |
1521a504 MK |
22 | Feature Test Macro Requirements for glibc (see |
23 | .BR feature_test_macros (7)): | |
d39ad78f | 24 | .RE |
68e4db0a | 25 | .PP |
1521a504 | 26 | .BR erfc (): |
9d2adbae | 27 | .nf |
5c10d2c5 | 28 | _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE |
9d2adbae MK |
29 | || /* Since glibc 2.19: */ _DEFAULT_SOURCE |
30 | || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
31 | .fi | |
98c9347c | 32 | .PP |
1521a504 MK |
33 | .BR erfcf (), |
34 | .BR erfcl (): | |
9d2adbae | 35 | .nf |
5c10d2c5 | 36 | _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L |
9d2adbae MK |
37 | || /* Since glibc 2.19: */ _DEFAULT_SOURCE |
38 | || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE | |
39 | .fi | |
1521a504 | 40 | .SH DESCRIPTION |
5600f73a | 41 | These functions return the complementary error function of |
1521a504 MK |
42 | .IR x , |
43 | that is, 1.0 \- erf(x). | |
44 | .SH RETURN VALUE | |
45 | On success, these functions return the complementary error function of | |
46 | .IR x , | |
47 | a value in the range [0,2]. | |
847e0d88 | 48 | .PP |
1521a504 MK |
49 | If |
50 | .I x | |
51 | is a NaN, a NaN is returned. | |
847e0d88 | 52 | .PP |
1521a504 MK |
53 | If |
54 | .I x | |
55 | is +0 or \-0, 1 is returned. | |
847e0d88 | 56 | .PP |
1521a504 MK |
57 | If |
58 | .I x | |
59 | is positive infinity, | |
60 | +0 is returned. | |
847e0d88 | 61 | .PP |
1521a504 MK |
62 | If |
63 | .I x | |
64 | is negative infinity, | |
65 | +2 is returned. | |
847e0d88 | 66 | .PP |
1521a504 MK |
67 | If the function result underflows and produces an unrepresentable value, |
68 | the return value is 0.0. | |
847e0d88 | 69 | .PP |
1521a504 MK |
70 | If the function result underflows but produces a representable |
71 | (i.e., subnormal) value, | |
72 | .\" e.g., erfc(27) on x86-32 | |
73 | that value is returned, and | |
efe294cb | 74 | a range error occurs. |
1521a504 MK |
75 | .SH ERRORS |
76 | See | |
77 | .BR math_error (7) | |
78 | for information on how to determine whether an error has occurred | |
79 | when calling these functions. | |
80 | .PP | |
81 | The following errors can occur: | |
82 | .TP | |
83 | Range error: result underflow (result is subnormal) | |
84 | .\" .I errno | |
85 | .\" is set to | |
86 | .\" .BR ERANGE . | |
87 | An underflow floating-point exception | |
88 | .RB ( FE_UNDERFLOW ) | |
89 | is raised. | |
90 | .PP | |
91 | These functions do not set | |
92 | .IR errno . | |
e25000b9 MK |
93 | .\" It is intentional that these functions do not set errno for this case |
94 | .\" see http://sources.redhat.com/bugzilla/show_bug.cgi?id=6785 | |
c3452067 | 95 | .SH ATTRIBUTES |
825ad4a0 MK |
96 | For an explanation of the terms used in this section, see |
97 | .BR attributes (7). | |
c466875e MK |
98 | .ad l |
99 | .nh | |
825ad4a0 MK |
100 | .TS |
101 | allbox; | |
c466875e | 102 | lbx lb lb |
825ad4a0 MK |
103 | l l l. |
104 | Interface Attribute Value | |
105 | T{ | |
c3452067 PH |
106 | .BR erfc (), |
107 | .BR erfcf (), | |
c3452067 | 108 | .BR erfcl () |
825ad4a0 MK |
109 | T} Thread safety MT-Safe |
110 | .TE | |
c466875e MK |
111 | .hy |
112 | .ad | |
113 | .sp 1 | |
47297adb | 114 | .SH CONFORMING TO |
9a74e018 | 115 | C99, POSIX.1-2001, POSIX.1-2008. |
847e0d88 | 116 | .PP |
1521a504 MK |
117 | The variant returning |
118 | .I double | |
119 | also conforms to | |
120 | SVr4, 4.3BSD. | |
121 | .SH NOTES | |
122 | The | |
f1915e1e PH |
123 | .BR erfc (), |
124 | .BR erfcf (), | |
125 | and | |
126 | .BR erfcl () | |
1521a504 MK |
127 | functions are provided to avoid the loss accuracy that |
128 | would occur for the calculation 1-erf(x) for large values of | |
1ae6b2c7 | 129 | .I x |
1521a504 | 130 | (for which the value of erf(x) approaches 1). |
47297adb | 131 | .SH SEE ALSO |
1521a504 MK |
132 | .BR cerf (3), |
133 | .BR erf (3), | |
134 | .BR exp (3) |