tzfile.5, tzselect.8: sync from tzdb upstream
[man-pages.git] / man3 / y0.3
blobe7033f8f876e0f287ca033ebd191249be68cf204
1 '\" t
2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
4 .\"     <mtk.manpages@gmail.com>
5 .\"
6 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
7 .\"
8 .\" References consulted:
9 .\"     Linux libc source code
10 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
11 .\"     386BSD man pages
12 .\" Modified Sat Jul 24 19:08:17 1993 by Rik Faith (faith@cs.unc.edu)
13 .\" Modified 2002-08-25, aeb
14 .\" Modified 2004-11-12 as per suggestion by Fabian Kreutz/AEB
15 .\" 2008-07-24, mtk, created this page, based on material from j0.3.
16 .\"
17 .TH y0 3 (date) "Linux man-pages (unreleased)"
18 .SH NAME
19 y0, y0f, y0l, y1, y1f, y1l, yn, ynf, ynl \-
20 Bessel functions of the second kind
21 .SH LIBRARY
22 Math library
23 .RI ( libm ", " \-lm )
24 .SH SYNOPSIS
25 .nf
26 .B #include <math.h>
27 .PP
28 .BI "double y0(double " x );
29 .BI "double y1(double " x );
30 .BI "double yn(int " n ", double " x );
31 .PP
32 .BI "float y0f(float " x );
33 .BI "float y1f(float " x );
34 .BI "float ynf(int " n ", float " x );
35 .PP
36 .BI "long double y0l(long double " x );
37 .BI "long double y1l(long double " x );
38 .BI "long double ynl(int " n ", long double " x );
39 .fi
40 .PP
41 .RS -4
42 Feature Test Macro Requirements for glibc (see
43 .BR feature_test_macros (7)):
44 .RE
45 .PP
46 .BR y0 (),
47 .BR y1 (),
48 .BR yn ():
49 .nf
50     _XOPEN_SOURCE
51         || /* Since glibc 2.19: */ _DEFAULT_SOURCE
52         || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
53 .fi
54 .PP
55 .BR y0f (),
56 .BR y0l (),
57 .BR y1f (),
58 .BR y1l (),
59 .BR ynf (),
60 .BR ynl ():
61 .nf
62     _XOPEN_SOURCE >= 600
63         || (_ISOC99_SOURCE && _XOPEN_SOURCE)
64         || /* Since glibc 2.19: */ _DEFAULT_SOURCE
65         || /* glibc <= 2.19: */ _SVID_SOURCE || _BSD_SOURCE
66 .fi
67 .SH DESCRIPTION
68 The
69 .BR y0 ()
70 and
71 .BR y1 ()
72 functions return Bessel functions of
73 .I x
74 of the second kind of orders 0 and 1, respectively.
75 The
76 .BR yn ()
77 function
78 returns the Bessel function of
79 .I x
80 of the second kind of order
81 .IR n .
82 .PP
83 The value of
84 .I x
85 must be positive.
86 .PP
87 The
88 .BR y0f (),
89 .BR y1f (),
90 and
91 .BR ynf ()
92 functions are versions that take and return
93 .I float
94 values.
95 The
96 .BR y0l (),
97 .BR y1l (),
98 and
99 .BR ynl ()
100 functions are versions that take and return
101 .I "long double"
102 values.
103 .SH RETURN VALUE
104 On success, these functions return the appropriate
105 Bessel value of the second kind for
106 .IR x .
109 .I x
110 is a NaN, a NaN is returned.
113 .I x
114 is negative,
115 a domain error occurs,
116 and the functions return
117 .RB \- HUGE_VAL ,
118 .RB \- HUGE_VALF ,
120 .RB \- HUGE_VALL ,
121 respectively.
122 (POSIX.1-2001 also allows a NaN return for this case.)
125 .I x
126 is 0.0,
127 a pole error occurs,
128 and the functions return
129 .RB \- HUGE_VAL ,
130 .RB \- HUGE_VALF ,
132 .RB \- HUGE_VALL ,
133 respectively.
135 If the result underflows,
136 a range error occurs,
137 and the functions return 0.0
139 If the result overflows,
140 a range error occurs,
141 and the functions return
142 .RB \- HUGE_VAL ,
143 .RB \- HUGE_VALF ,
145 .RB \- HUGE_VALL ,
146 respectively.
147 (POSIX.1-2001 also allows a 0.0 return for this case.)
148 .SH ERRORS
150 .BR math_error (7)
151 for information on how to determine whether an error has occurred
152 when calling these functions.
154 The following errors can occur:
156 Domain error: \fIx\fP is negative
157 .I errno
158 is set to
159 .BR EDOM .
160 An invalid floating-point exception
161 .RB ( FE_INVALID )
162 is raised.
164 Pole error: \fIx\fP is 0.0
165 .\" Before POSIX.1-2001 TC2, this was (inconsistently) specified
166 .\" as a range error.
167 .I errno
168 is set to
169 .B ERANGE
170 and an
171 .B FE_DIVBYZERO
172 exception is raised
173 (but see BUGS).
175 Range error: result underflow
176 .\" e.g., y0(1e33) on glibc 2.8/x86-32
177 .I errno
178 is set to
179 .BR ERANGE .
181 .B FE_UNDERFLOW
182 exception is returned by
183 .\" This is intended behavior
184 .\" See http://sources.redhat.com/bugzilla/show_bug.cgi?id=6806
185 .BR fetestexcept (3)
186 for this case.
188 Range error: result overflow
189 .\" e.g., yn(10, 1e-40) on glibc 2.8/x86-32
190 .I errno
191 is set to
192 .B ERANGE
193 (but see BUGS).
194 An overflow floating-point exception
195 .RB ( FE_OVERFLOW )
196 is raised.
197 .SH ATTRIBUTES
198 For an explanation of the terms used in this section, see
199 .BR attributes (7).
200 .ad l
203 allbox;
204 lbx lb lb
205 l l l.
206 Interface       Attribute       Value
208 .BR y0 (),
209 .BR y0f (),
210 .BR y0l ()
211 T}      Thread safety   MT-Safe
213 .BR y1 (),
214 .BR y1f (),
215 .BR y1l ()
216 T}      Thread safety   MT-Safe
218 .BR yn (),
219 .BR ynf (),
220 .BR ynl ()
221 T}      Thread safety   MT-Safe
225 .sp 1
226 .SH STANDARDS
227 The functions returning
228 .I double
229 conform to SVr4, 4.3BSD,
230 POSIX.1-2001, POSIX.1-2008.
231 The others are nonstandard functions that also exist on the BSDs.
232 .SH BUGS
233 Before glibc 2.19,
234 .\" http://sourceware.org/bugzilla/show_bug.cgi?id=6807
235 these functions misdiagnosed pole errors:
236 .I errno
237 was set to
238 .BR EDOM ,
239 instead of
240 .B ERANGE
241 and no
242 .B FE_DIVBYZERO
243 exception was raised.
245 Before glibc 2.17,
246 .\" http://sources.redhat.com/bugzilla/show_bug.cgi?id=6808
247 did not set
248 .I errno
249 for "range error: result underflow".
251 In glibc 2.3.2 and earlier,
252 .\" Actually, 2.3.2 is the earliest test result I have; so yet
253 .\" to confirm if this error occurs only in glibc 2.3.2.
254 these functions do not raise an invalid floating-point exception
255 .RB ( FE_INVALID )
256 when a domain error occurs.
257 .SH SEE ALSO
258 .BR j0 (3)