OSDN Git Service

(split) LDP: Change Makefile to stamp-based compilation
[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 \fIx\fP
96 of the second kind of orders 0 and 1, respectively.
97 The
98 .BR yn ()
99 function
100 returns the Bessel function of \fIx\fP of the second kind of order \fIn\fP.
101 .PP
102 The value of \fIx\fP must be positive.
103 .PP
104 The
105 .BR y0f ()
106 etc. and
107 .BR y0l ()
108 etc. functions are versions that take and return
109 .I float
110 and
111 .I "long double"
112 values, respectively.
113 .SH RETURN VALUE
114 On success, these functions return the appropriate
115 Bessel value of the second kind for
116 .IR x .
117
118 If
119 .I x
120 is a NaN, a NaN is returned.
121
122 If
123 .I x
124 is negative,
125 a domain error occurs,
126 and the functions return
127 .RB - HUGE_VAL ,
128 .RB - HUGE_VALF ,
129 or
130 .RB - HUGE_VALL ,
131 respectively.
132 (POSIX.1-2001 also allows a NaN return for this case.)
133
134 If
135 .I x
136 is 0.0,
137 a pole error occurs,
138 and the functions return
139 .RB - HUGE_VAL ,
140 .RB - HUGE_VALF ,
141 or
142 .RB - HUGE_VALL ,
143 respectively.
144
145 If the result underflows,
146 a range error occurs,
147 and the functions return 0.0
148
149 If the result overflows,
150 a range error occurs,
151 and the functions return
152 .RB - HUGE_VAL ,
153 .RB - HUGE_VALF ,
154 or
155 .RB - HUGE_VALL ,
156 respectively.
157 (POSIX.1-2001 also allows a 0.0 return for this case.)
158 .SH ERRORS
159 See
160 .BR math_error (7)
161 for information on how to determine whether an error has occurred
162 when calling these functions.
163 .PP
164 The following errors can occur:
165 .TP
166 Domain error: \fIx\fP is negative
167 .I errno
168 is set to
169 .BR EDOM .
170 An invalid floating-point exception
171 .RB ( FE_INVALID )
172 is raised.
173 .TP
174 Pole error: \fIx\fP is 0.0
175 .\" Before POSIX.1-2001 TC2, this was (inconsistently) specified
176 .\" as a range error.
177 .I errno
178 is set to
179 .\" FIXME . y0(0.0) gives EDOM
180 .BR ERANGE
181 (but see BUGS).
182 No
183 .B FE_DIVBYZERO
184 exception is returned by
185 .BR fetestexcept (3)
186 for this case.
187 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6808
188 .TP
189 Range error: result underflow
190 .\" e.g., y0(1e33) on glibc 2.8/x86-32
191 .I errno
192 is set to
193 .BR ERANGE .
194 .\" An underflow floating-point exception
195 .\" .RB ( FE_UNDERFLOW )
196 .\" is raised.
197 .\" FIXME . Is it intentional that these functions do not use FE_*?
198 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6806
199 No
200 .B FE_UNDERFLOW
201 exception is returned by
202 .BR fetestexcept (3)
203 for this case.
204 .TP
205 Range error: result overflow
206 .\" e.g., yn(10, 1e-40) on glibc 2.8/x86-32
207 .\" .I errno
208 .\" is set to
209 .\" .BR ERANGE .
210 .I errno
211 is not set for this case.
212 .\" FIXME . Is it intentional that errno is not set?
213 .\" Bug raised: http://sources.redhat.com/bugzilla/show_bug.cgi?id=6808
214 An overflow floating-point exception
215 .RB ( FE_OVERFLOW )
216 is raised.
217 .SH CONFORMING TO
218 The functions returning
219 .I double
220 conform to SVr4, 4.3BSD,
221 POSIX.1-2001.
222 The others are nonstandard functions that also exist on the BSDs.
223 .SH BUGS
224 On a pole error, these functions set
225 .I errno
226 to
227 .BR EDOM ,
228 instead of
229 .BR ERANGE
230 as POSIX.1-2004 requires.
231 .\" FIXME .
232 .\" Bug raised: http://sourceware.org/bugzilla/show_bug.cgi?id=6807
233
234 In glibc version 2.3.2 and earlier,
235 .\" FIXME . Actually, 2.3.2 is the earliest test result I have; so yet
236 .\" to confirm if this error occurs only in 2.3.2.
237 these functions do not raise an invalid floating-point exception
238 .RB ( FE_INVALID )
239 when a domain error occurs.
240 .SH SEE ALSO
241 .BR j0 (3)