OSDN Git Service

(split) LDP: Update original to LDP v3.52.
[linuxjm/LDP_man-pages.git] / original / man3 / y0.3
1 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
2 .\" and Copyright 2008, Linux Foundation, written by Michael Kerrisk
3 .\"     <mtk.manpages@gmail.com>
4 .\"
5 .\" %%%LICENSE_START(VERBATIM)
6 .\" Permission is granted to make and distribute verbatim copies of this
7 .\" manual provided the copyright notice and this permission notice are
8 .\" preserved on all copies.
9 .\"
10 .\" Permission is granted to copy and distribute modified versions of this
11 .\" manual under the conditions for verbatim copying, provided that the
12 .\" entire resulting derived work is distributed under the terms of a
13 .\" permission notice identical to this one.
14 .\"
15 .\" Since the Linux kernel and libraries are constantly changing, this
16 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
17 .\" responsibility for errors or omissions, or for damages resulting from
18 .\" the use of the information contained herein.  The author(s) may not
19 .\" have taken the same level of care in the production of this manual,
20 .\" which is licensed free of charge, as they might when working
21 .\" professionally.
22 .\"
23 .\" Formatted or processed versions of this manual, if unaccompanied by
24 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" %%%LICENSE_END
26 .\"
27 .\" References consulted:
28 .\"     Linux libc source code
29 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
30 .\"     386BSD man pages
31 .\" Modified Sat Jul 24 19:08:17 1993 by Rik Faith (faith@cs.unc.edu)
32 .\" Modified 2002-08-25, aeb
33 .\" Modified 2004-11-12 as per suggestion by Fabian Kreutz/AEB
34 .\" 2008-07-24, mtk, created this page, based on material from j0.3.
35 .\"
36 .TH Y0 3  2008-08-10 "" "Linux Programmer's Manual"
37 .SH NAME
38 y0, y0f, y0l, y1, y1f, y1l, yn, ynf, ynl \-
39 Bessel functions of the second kind
40 .SH SYNOPSIS
41 .nf
42 .B #include <math.h>
43 .sp
44 .BI "double y0(double " x );
45 .br
46 .BI "double y1(double " x );
47 .br
48 .BI "double yn(int " n ", double " x );
49 .sp
50 .BI "float y0f(float " x );
51 .br
52 .BI "float y1f(float " x );
53 .br
54 .BI "float ynf(int " n ", float " x );
55 .sp
56 .BI "long double y0l(long double " x );
57 .br
58 .BI "long double y1l(long double " x );
59 .br
60 .BI "long double ynl(int " n ", long double " x );
61 .fi
62 .sp
63 Link with \fI\-lm\fP.
64 .sp
65 .in -4n
66 Feature Test Macro Requirements for glibc (see
67 .BR feature_test_macros (7)):
68 .in
69 .sp
70 .ad l
71 .BR y0 (),
72 .BR y1 (),
73 .BR yn ():
74 .RS 4
75 _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE
76 .RE
77 .br
78 .BR y0f (),
79 .BR y0l (),
80 .BR y1f (),
81 .BR y1l (),
82 .BR ynf (),
83 .BR ynl ():
84 .RS 4
85 _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE\ >=\ 600
86 .\" Also seems to work: -std=c99 -D_XOPEN_SOURCE
87 .RE
88 .ad b
89 .SH DESCRIPTION
90 .PP
91 The
92 .BR y0 ()
93 and
94 .BR y1 ()
95 functions return Bessel functions of
96 .I x
97 of the second kind of orders 0 and 1, respectively.
98 The
99 .BR yn ()
100 function
101 returns the Bessel function of
102 .I x
103 of the second kind of order
104 .IR n .
105 .PP
106 The value of
107 .I x
108 must be positive.
109 .PP
110 The
111 .BR y0f ()
112 etc. and
113 .BR y0l ()
114 etc. functions are versions that take and return
115 .I float
116 and
117 .I "long double"
118 values, respectively.
119 .SH RETURN VALUE
120 On success, these functions return the appropriate
121 Bessel value of the second kind for
122 .IR x .
123
124 If
125 .I x
126 is a NaN, a NaN is returned.
127
128 If
129 .I x
130 is negative,
131 a domain error occurs,
132 and the functions return
133 .RB - HUGE_VAL ,
134 .RB - HUGE_VALF ,
135 or
136 .RB - HUGE_VALL ,
137 respectively.
138 (POSIX.1-2001 also allows a NaN return for this case.)
139
140 If
141 .I x
142 is 0.0,
143 a pole error occurs,
144 and the functions return
145 .RB - HUGE_VAL ,
146 .RB - HUGE_VALF ,
147 or
148 .RB - HUGE_VALL ,
149 respectively.
150
151 If the result underflows,
152 a range error occurs,
153 and the functions return 0.0
154
155 If the result overflows,
156 a range error occurs,
157 and the functions return
158 .RB - HUGE_VAL ,
159 .RB - HUGE_VALF ,
160 or
161 .RB - HUGE_VALL ,
162 respectively.
163 (POSIX.1-2001 also allows a 0.0 return for this case.)
164 .SH ERRORS
165 See
166 .BR math_error (7)
167 for information on how to determine whether an error has occurred
168 when calling these functions.
169 .PP
170 The following errors can occur:
171 .TP
172 Domain error: \fIx\fP is negative
173 .I errno
174 is set to
175 .BR EDOM .
176 An invalid floating-point exception
177 .RB ( FE_INVALID )
178 is raised.
179 .TP
180 Pole error: \fIx\fP is 0.0
181 .\" Before POSIX.1-2001 TC2, this was (inconsistently) specified
182 .\" as a range error.
183 .I errno
184 is set to
185 .\" FIXME . y0(0.0) gives EDOM
186 .BR ERANGE
187 (but see BUGS).
188 No
189 .B FE_DIVBYZERO
190 exception is returned by
191 .BR fetestexcept (3)
192 for this case.
193 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6808
194 .TP
195 Range error: result underflow
196 .\" e.g., y0(1e33) on glibc 2.8/x86-32
197 .I errno
198 is set to
199 .BR ERANGE .
200 .\" An underflow floating-point exception
201 .\" .RB ( FE_UNDERFLOW )
202 .\" is raised.
203 .\" FIXME . Is it intentional that these functions do not use FE_*?
204 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6806
205 No
206 .B FE_UNDERFLOW
207 exception is returned by
208 .BR fetestexcept (3)
209 for this case.
210 .TP
211 Range error: result overflow
212 .\" e.g., yn(10, 1e-40) on glibc 2.8/x86-32
213 .\" .I errno
214 .\" is set to
215 .\" .BR ERANGE .
216 .I errno
217 is not set for this case.
218 .\" FIXME . Is it intentional that errno is not set?
219 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6808
220 An overflow floating-point exception
221 .RB ( FE_OVERFLOW )
222 is raised.
223 .SH CONFORMING TO
224 The functions returning
225 .I double
226 conform to SVr4, 4.3BSD,
227 POSIX.1-2001.
228 The others are nonstandard functions that also exist on the BSDs.
229 .SH BUGS
230 On a pole error, these functions set
231 .I errno
232 to
233 .BR EDOM ,
234 instead of
235 .BR ERANGE
236 as POSIX.1-2004 requires.
237 .\" FIXME .
238 .\" Bug raised: http://sourceware.org/bugzilla/show_bug.cgi?id=6807
239
240 In glibc version 2.3.2 and earlier,
241 .\" FIXME . Actually, 2.3.2 is the earliest test result I have; so yet
242 .\" to confirm if this error occurs only in 2.3.2.
243 these functions do not raise an invalid floating-point exception
244 .RB ( FE_INVALID )
245 when a domain error occurs.
246 .SH SEE ALSO
247 .BR j0 (3)