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