]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/erfc.3
Many pages: Use correct letter case in page titles (TH)
[thirdparty/man-pages.git] / man3 / erfc.3
1 .\" Copyright 2008, Linux Foundation, written by Michael Kerrisk
2 .\" <mtk.manpages@gmail.com>
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH erfc 3 (date) "Linux man-pages (unreleased)"
7 .SH NAME
8 erfc, erfcf, erfcl \- complementary error function
9 .SH LIBRARY
10 Math library
11 .RI ( libm ", " \-lm )
12 .SH SYNOPSIS
13 .nf
14 .B #include <math.h>
15 .PP
16 .BI "double erfc(double " x );
17 .BI "float erfcf(float " x );
18 .BI "long double erfcl(long double " x );
19 .fi
20 .PP
21 .RS -4
22 Feature Test Macro Requirements for glibc (see
23 .BR feature_test_macros (7)):
24 .RE
25 .PP
26 .BR erfc ():
27 .nf
28 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE
29 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
30 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
31 .fi
32 .PP
33 .BR erfcf (),
34 .BR erfcl ():
35 .nf
36 _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
37 || /* Since glibc 2.19: */ _DEFAULT_SOURCE
38 || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
39 .fi
40 .SH DESCRIPTION
41 These functions return the complementary error function of
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].
48 .PP
49 If
50 .I x
51 is a NaN, a NaN is returned.
52 .PP
53 If
54 .I x
55 is +0 or \-0, 1 is returned.
56 .PP
57 If
58 .I x
59 is positive infinity,
60 +0 is returned.
61 .PP
62 If
63 .I x
64 is negative infinity,
65 +2 is returned.
66 .PP
67 If the function result underflows and produces an unrepresentable value,
68 the return value is 0.0.
69 .PP
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
74 a range error occurs.
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 .
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
95 .SH ATTRIBUTES
96 For an explanation of the terms used in this section, see
97 .BR attributes (7).
98 .ad l
99 .nh
100 .TS
101 allbox;
102 lbx lb lb
103 l l l.
104 Interface Attribute Value
105 T{
106 .BR erfc (),
107 .BR erfcf (),
108 .BR erfcl ()
109 T} Thread safety MT-Safe
110 .TE
111 .hy
112 .ad
113 .sp 1
114 .SH STANDARDS
115 C99, POSIX.1-2001, POSIX.1-2008.
116 .PP
117 The variant returning
118 .I double
119 also conforms to
120 SVr4, 4.3BSD.
121 .SH NOTES
122 The
123 .BR erfc (),
124 .BR erfcf (),
125 and
126 .BR erfcl ()
127 functions are provided to avoid the loss accuracy that
128 would occur for the calculation 1-erf(x) for large values of
129 .I x
130 (for which the value of erf(x) approaches 1).
131 .SH SEE ALSO
132 .BR cerf (3),
133 .BR erf (3),
134 .BR exp (3)