]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | <html> |
2 | <head> | |
3 | <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> | |
4 | <title>Bessel Functions of the First and Second Kinds</title> | |
5 | <link rel="stylesheet" href="../../math.css" type="text/css"> | |
6 | <meta name="generator" content="DocBook XSL Stylesheets V1.77.1"> | |
7 | <link rel="home" href="../../index.html" title="Math Toolkit 2.5.1"> | |
8 | <link rel="up" href="../bessel.html" title="Bessel Functions"> | |
9 | <link rel="prev" href="bessel_over.html" title="Bessel Function Overview"> | |
10 | <link rel="next" href="bessel_root.html" title="Finding Zeros of Bessel Functions of the First and Second Kinds"> | |
11 | </head> | |
12 | <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> | |
13 | <table cellpadding="2" width="100%"><tr> | |
14 | <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td> | |
15 | <td align="center"><a href="../../../../../../index.html">Home</a></td> | |
16 | <td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td> | |
17 | <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> | |
18 | <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> | |
19 | <td align="center"><a href="../../../../../../more/index.htm">More</a></td> | |
20 | </tr></table> | |
21 | <hr> | |
22 | <div class="spirit-nav"> | |
23 | <a accesskey="p" href="bessel_over.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../bessel.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="bessel_root.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> | |
24 | </div> | |
25 | <div class="section"> | |
26 | <div class="titlepage"><div><div><h3 class="title"> | |
27 | <a name="math_toolkit.bessel.bessel_first"></a><a class="link" href="bessel_first.html" title="Bessel Functions of the First and Second Kinds">Bessel Functions of | |
28 | the First and Second Kinds</a> | |
29 | </h3></div></div></div> | |
30 | <h5> | |
31 | <a name="math_toolkit.bessel.bessel_first.h0"></a> | |
32 | <span class="phrase"><a name="math_toolkit.bessel.bessel_first.synopsis"></a></span><a class="link" href="bessel_first.html#math_toolkit.bessel.bessel_first.synopsis">Synopsis</a> | |
33 | </h5> | |
34 | <p> | |
35 | <code class="computeroutput"><span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">math</span><span class="special">/</span><span class="identifier">special_functions</span><span class="special">/</span><span class="identifier">bessel</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span></code> | |
36 | </p> | |
37 | <pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">></span> | |
38 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">cyl_bessel_j</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">v</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">x</span><span class="special">);</span> | |
39 | ||
40 | <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">></span> | |
41 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">cyl_bessel_j</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">v</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&);</span> | |
42 | ||
43 | <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">></span> | |
44 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">cyl_neumann</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">v</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">x</span><span class="special">);</span> | |
45 | ||
46 | <span class="keyword">template</span> <span class="special"><</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">,</span> <span class="keyword">class</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">></span> | |
47 | <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>calculated-result-type</em></span></a> <span class="identifier">cyl_neumann</span><span class="special">(</span><span class="identifier">T1</span> <span class="identifier">v</span><span class="special">,</span> <span class="identifier">T2</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">const</span> <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a><span class="special">&);</span> | |
48 | </pre> | |
49 | <h5> | |
50 | <a name="math_toolkit.bessel.bessel_first.h1"></a> | |
51 | <span class="phrase"><a name="math_toolkit.bessel.bessel_first.description"></a></span><a class="link" href="bessel_first.html#math_toolkit.bessel.bessel_first.description">Description</a> | |
52 | </h5> | |
53 | <p> | |
54 | The functions <a class="link" href="bessel_first.html" title="Bessel Functions of the First and Second Kinds">cyl_bessel_j</a> | |
55 | and <a class="link" href="bessel_first.html" title="Bessel Functions of the First and Second Kinds">cyl_neumann</a> return | |
56 | the result of the Bessel functions of the first and second kinds respectively: | |
57 | </p> | |
58 | <p> | |
59 | cyl_bessel_j(v, x) = J<sub>v</sub>(x) | |
60 | </p> | |
61 | <p> | |
62 | cyl_neumann(v, x) = Y<sub>v</sub>(x) = N<sub>v</sub>(x) | |
63 | </p> | |
64 | <p> | |
65 | where: | |
66 | </p> | |
67 | <p> | |
68 | <span class="inlinemediaobject"><img src="../../../equations/bessel2.svg"></span> | |
69 | </p> | |
70 | <p> | |
71 | <span class="inlinemediaobject"><img src="../../../equations/bessel3.svg"></span> | |
72 | </p> | |
73 | <p> | |
74 | The return type of these functions is computed using the <a class="link" href="../result_type.html" title="Calculation of the Type of the Result"><span class="emphasis"><em>result | |
75 | type calculation rules</em></span></a> when T1 and T2 are different types. | |
76 | The functions are also optimised for the relatively common case that T1 is | |
77 | an integer. | |
78 | </p> | |
79 | <p> | |
80 | The final <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">Policy</a> argument is optional and can | |
81 | be used to control the behaviour of the function: how it handles errors, | |
82 | what level of precision to use etc. Refer to the <a class="link" href="../../policy.html" title="Chapter 15. Policies: Controlling Precision, Error Handling etc">policy | |
83 | documentation for more details</a>. | |
84 | </p> | |
85 | <p> | |
86 | The functions return the result of <a class="link" href="../error_handling.html#math_toolkit.error_handling.domain_error">domain_error</a> | |
87 | whenever the result is undefined or complex. For <a class="link" href="bessel_first.html" title="Bessel Functions of the First and Second Kinds">cyl_bessel_j</a> | |
88 | this occurs when <code class="computeroutput"><span class="identifier">x</span> <span class="special"><</span> | |
89 | <span class="number">0</span></code> and v is not an integer, or when | |
90 | <code class="computeroutput"><span class="identifier">x</span> <span class="special">==</span> | |
91 | <span class="number">0</span></code> and <code class="computeroutput"><span class="identifier">v</span> | |
92 | <span class="special">!=</span> <span class="number">0</span></code>. | |
93 | For <a class="link" href="bessel_first.html" title="Bessel Functions of the First and Second Kinds">cyl_neumann</a> this | |
94 | occurs when <code class="computeroutput"><span class="identifier">x</span> <span class="special"><=</span> | |
95 | <span class="number">0</span></code>. | |
96 | </p> | |
97 | <p> | |
98 | The following graph illustrates the cyclic nature of J<sub>v</sub>: | |
99 | </p> | |
100 | <p> | |
101 | <span class="inlinemediaobject"><img src="../../../graphs/cyl_bessel_j.svg" align="middle"></span> | |
102 | </p> | |
103 | <p> | |
104 | The following graph shows the behaviour of Y<sub>v</sub>: this is also cyclic for large | |
105 | <span class="emphasis"><em>x</em></span>, but tends to -∞   for small <span class="emphasis"><em>x</em></span>: | |
106 | </p> | |
107 | <p> | |
108 | <span class="inlinemediaobject"><img src="../../../graphs/cyl_neumann.svg" align="middle"></span> | |
109 | </p> | |
110 | <h5> | |
111 | <a name="math_toolkit.bessel.bessel_first.h2"></a> | |
112 | <span class="phrase"><a name="math_toolkit.bessel.bessel_first.testing"></a></span><a class="link" href="bessel_first.html#math_toolkit.bessel.bessel_first.testing">Testing</a> | |
113 | </h5> | |
114 | <p> | |
115 | There are two sets of test values: spot values calculated using <a href="http://functions.wolfram.com" target="_top">functions.wolfram.com</a>, | |
116 | and a much larger set of tests computed using a simplified version of this | |
117 | implementation (with all the special case handling removed). | |
118 | </p> | |
119 | <h5> | |
120 | <a name="math_toolkit.bessel.bessel_first.h3"></a> | |
121 | <span class="phrase"><a name="math_toolkit.bessel.bessel_first.accuracy"></a></span><a class="link" href="bessel_first.html#math_toolkit.bessel.bessel_first.accuracy">Accuracy</a> | |
122 | </h5> | |
123 | <p> | |
124 | The following tables show how the accuracy of these functions varies on various | |
125 | platforms, along with comparisons to other libraries. Note that the cyclic | |
126 | nature of these functions means that they have an infinite number of irrational | |
127 | roots: in general these functions have arbitrarily large <span class="emphasis"><em>relative</em></span> | |
128 | errors when the arguments are sufficiently close to a root. Of course the | |
129 | absolute error in such cases is always small. Note that only results for | |
130 | the widest floating-point type on the system are given as narrower types | |
131 | have <a class="link" href="../relative_error.html#math_toolkit.relative_error.zero_error">effectively zero | |
132 | error</a>. All values are relative errors in units of epsilon. Most of | |
133 | the gross errors exhibited by other libraries occur for very large arguments | |
134 | - you will need to drill down into the actual program output if you need | |
135 | more information on this. | |
136 | </p> | |
137 | <div class="table"> | |
138 | <a name="math_toolkit.bessel.bessel_first.table_cyl_bessel_j_integer_orders_"></a><p class="title"><b>Table 6.40. Error rates for cyl_bessel_j (integer orders)</b></p> | |
139 | <div class="table-contents"><table class="table" summary="Error rates for cyl_bessel_j (integer orders)"> | |
140 | <colgroup> | |
141 | <col> | |
142 | <col> | |
143 | <col> | |
144 | <col> | |
145 | <col> | |
146 | </colgroup> | |
147 | <thead><tr> | |
148 | <th> | |
149 | </th> | |
150 | <th> | |
151 | <p> | |
152 | Microsoft Visual C++ version 12.0<br> Win32<br> double | |
153 | </p> | |
154 | </th> | |
155 | <th> | |
156 | <p> | |
157 | GNU C++ version 5.1.0<br> linux<br> long double | |
158 | </p> | |
159 | </th> | |
160 | <th> | |
161 | <p> | |
162 | GNU C++ version 5.1.0<br> linux<br> double | |
163 | </p> | |
164 | </th> | |
165 | <th> | |
166 | <p> | |
167 | Sun compiler version 0x5130<br> Sun Solaris<br> long double | |
168 | </p> | |
169 | </th> | |
170 | </tr></thead> | |
171 | <tbody> | |
172 | <tr> | |
173 | <td> | |
174 | <p> | |
175 | Bessel J0: Mathworld Data (Integer Version) | |
176 | </p> | |
177 | </td> | |
178 | <td> | |
179 | <p> | |
180 | <span class="blue">Max = 2.52ε (Mean = 1.2ε)</span><br> <br> | |
181 | (<span class="emphasis"><em><math.h>:</em></span> Max = 1.89ε (Mean = 0.988ε)) | |
182 | </p> | |
183 | </td> | |
184 | <td> | |
185 | <p> | |
186 | <span class="blue">Max = 6.55ε (Mean = 2.89ε)</span><br> <br> | |
187 | (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 5.04ε (Mean = 1.78ε) | |
188 | <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_long_double_cyl_bessel_j_integer_orders___tr1_cmath__Bessel_J0_Mathworld_Data_Integer_Version_">And | |
189 | other failures.</a>) | |
190 | </p> | |
191 | </td> | |
192 | <td> | |
193 | <p> | |
194 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
195 | 1.16:</em></span> Max = 1.12ε (Mean = 0.488ε))<br> (<span class="emphasis"><em>Rmath | |
196 | 3.0.2:</em></span> <span class="red">Max = +INFε (Mean = +INFε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_bessel_j_integer_orders__Rmath_3_0_2_Bessel_J0_Mathworld_Data_Integer_Version_">And | |
197 | other failures.</a>)</span><br> (<span class="emphasis"><em>Cephes:</em></span> | |
198 | Max = 1.12ε (Mean = 0.568ε)) | |
199 | </p> | |
200 | </td> | |
201 | <td> | |
202 | <p> | |
203 | <span class="blue">Max = 6.55ε (Mean = 2.86ε)</span> | |
204 | </p> | |
205 | </td> | |
206 | </tr> | |
207 | <tr> | |
208 | <td> | |
209 | <p> | |
210 | Bessel J0: Mathworld Data (Tricky cases) (Integer Version) | |
211 | </p> | |
212 | </td> | |
213 | <td> | |
214 | <p> | |
215 | <span class="blue">Max = 1e+007ε (Mean = 4.09e+006ε)</span><br> | |
216 | <br> (<span class="emphasis"><em><math.h>:</em></span> <span class="red">Max | |
217 | = 2.54e+008ε (Mean = 1.04e+008ε))</span> | |
218 | </p> | |
219 | </td> | |
220 | <td> | |
221 | <p> | |
222 | <span class="blue">Max = 1.63e+08ε (Mean = 6.67e+07ε)</span><br> | |
223 | <br> (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 4.79e+08ε (Mean | |
224 | = 1.96e+08ε)) | |
225 | </p> | |
226 | </td> | |
227 | <td> | |
228 | <p> | |
229 | <span class="blue">Max = 7.98e+04ε (Mean = 3.26e+04ε)</span><br> | |
230 | <br> (<span class="emphasis"><em>GSL 1.16:</em></span> Max = 1e+07ε (Mean = 4.11e+06ε))<br> | |
231 | (<span class="emphasis"><em>Rmath 3.0.2:</em></span> Max = 1.04e+07ε (Mean = 4.29e+06ε))<br> | |
232 | (<span class="emphasis"><em>Cephes:</em></span> <span class="red">Max = 2.54e+08ε (Mean | |
233 | = 1.04e+08ε))</span> | |
234 | </p> | |
235 | </td> | |
236 | <td> | |
237 | <p> | |
238 | <span class="blue">Max = 1.64e+08ε (Mean = 6.69e+07ε)</span> | |
239 | </p> | |
240 | </td> | |
241 | </tr> | |
242 | <tr> | |
243 | <td> | |
244 | <p> | |
245 | Bessel J1: Mathworld Data (Integer Version) | |
246 | </p> | |
247 | </td> | |
248 | <td> | |
249 | <p> | |
250 | <span class="blue">Max = 1.73ε (Mean = 0.976ε)</span><br> <br> | |
251 | (<span class="emphasis"><em><math.h>:</em></span> Max = 11.4ε (Mean = 4.15ε)) | |
252 | </p> | |
253 | </td> | |
254 | <td> | |
255 | <p> | |
256 | <span class="blue">Max = 2.66ε (Mean = 1.38ε)</span><br> <br> | |
257 | (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 6.1ε (Mean = 2.95ε) | |
258 | <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_long_double_cyl_bessel_j_integer_orders___tr1_cmath__Bessel_J1_Mathworld_Data_Integer_Version_">And | |
259 | other failures.</a>) | |
260 | </p> | |
261 | </td> | |
262 | <td> | |
263 | <p> | |
264 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
265 | 1.16:</em></span> Max = 1.89ε (Mean = 0.721ε))<br> (<span class="emphasis"><em>Rmath | |
266 | 3.0.2:</em></span> <span class="red">Max = +INFε (Mean = +INFε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_bessel_j_integer_orders__Rmath_3_0_2_Bessel_J1_Mathworld_Data_Integer_Version_">And | |
267 | other failures.</a>)</span><br> (<span class="emphasis"><em>Cephes:</em></span> | |
268 | Max = 2.88ε (Mean = 1.12ε)) | |
269 | </p> | |
270 | </td> | |
271 | <td> | |
272 | <p> | |
273 | <span class="blue">Max = 1.44ε (Mean = 0.637ε)</span> | |
274 | </p> | |
275 | </td> | |
276 | </tr> | |
277 | <tr> | |
278 | <td> | |
279 | <p> | |
280 | Bessel J1: Mathworld Data (tricky cases) (Integer Version) | |
281 | </p> | |
282 | </td> | |
283 | <td> | |
284 | <p> | |
285 | <span class="blue">Max = 3.23e+004ε (Mean = 1.45e+004ε)</span><br> | |
286 | <br> (<span class="emphasis"><em><math.h>:</em></span> Max = 1.44e+007ε (Mean | |
287 | = 6.5e+006ε)) | |
288 | </p> | |
289 | </td> | |
290 | <td> | |
291 | <p> | |
292 | <span class="blue">Max = 2.18e+05ε (Mean = 9.76e+04ε)</span><br> | |
293 | <br> (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 2.15e+06ε (Mean | |
294 | = 1.58e+06ε)) | |
295 | </p> | |
296 | </td> | |
297 | <td> | |
298 | <p> | |
299 | <span class="blue">Max = 106ε (Mean = 47.5ε)</span><br> <br> | |
300 | (<span class="emphasis"><em>GSL 1.16:</em></span> Max = 1.26e+06ε (Mean = 6.28e+05ε))<br> | |
301 | (<span class="emphasis"><em>Rmath 3.0.2:</em></span> Max = 2.93e+06ε (Mean = 1.7e+06ε))<br> | |
302 | (<span class="emphasis"><em>Cephes:</em></span> Max = 9.56e+05ε (Mean = 4.99e+05ε)) | |
303 | </p> | |
304 | </td> | |
305 | <td> | |
306 | <p> | |
307 | <span class="blue">Max = 2.18e+05ε (Mean = 9.76e+04ε)</span> | |
308 | </p> | |
309 | </td> | |
310 | </tr> | |
311 | <tr> | |
312 | <td> | |
313 | <p> | |
314 | Bessel JN: Mathworld Data (Integer Version) | |
315 | </p> | |
316 | </td> | |
317 | <td> | |
318 | <p> | |
319 | <span class="blue">Max = 14.7ε (Mean = 5.4ε)</span><br> <br> | |
320 | (<span class="emphasis"><em><math.h>:</em></span> <span class="red">Max = | |
321 | +INFε (Mean = +INFε) <a class="link" href="../logs_and_tables/logs.html#errors_Microsoft_Visual_C_version_12_0_Win32_double_cyl_bessel_j_integer_orders___math_h__Bessel_JN_Mathworld_Data_Integer_Version_">And | |
322 | other failures.</a>)</span> | |
323 | </p> | |
324 | </td> | |
325 | <td> | |
326 | <p> | |
327 | <span class="blue">Max = 6.85ε (Mean = 3.41ε)</span><br> <br> | |
328 | (<span class="emphasis"><em><tr1/cmath>:</em></span> <span class="red">Max | |
329 | = 2.13e+19ε (Mean = 5.16e+18ε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_long_double_cyl_bessel_j_integer_orders___tr1_cmath__Bessel_JN_Mathworld_Data_Integer_Version_">And | |
330 | other failures.</a>)</span> | |
331 | </p> | |
332 | </td> | |
333 | <td> | |
334 | <p> | |
335 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
336 | 1.16:</em></span> Max = 6.9e+05ε (Mean = 2.53e+05ε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_bessel_j_integer_orders__GSL_1_16_Bessel_JN_Mathworld_Data_Integer_Version_">And | |
337 | other failures.</a>)<br> (<span class="emphasis"><em>Rmath 3.0.2:</em></span> | |
338 | <span class="red">Max = +INFε (Mean = +INFε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_bessel_j_integer_orders__Rmath_3_0_2_Bessel_JN_Mathworld_Data_Integer_Version_">And | |
339 | other failures.</a>)</span><br> (<span class="emphasis"><em>Cephes:</em></span> | |
340 | <span class="red">Max = +INFε (Mean = +INFε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_bessel_j_integer_orders__Cephes_Bessel_JN_Mathworld_Data_Integer_Version_">And | |
341 | other failures.</a>)</span> | |
342 | </p> | |
343 | </td> | |
344 | <td> | |
345 | <p> | |
346 | <span class="blue">Max = 463ε (Mean = 112ε)</span> | |
347 | </p> | |
348 | </td> | |
349 | </tr> | |
350 | </tbody> | |
351 | </table></div> | |
352 | </div> | |
353 | <br class="table-break"><div class="table"> | |
354 | <a name="math_toolkit.bessel.bessel_first.table_cyl_bessel_j"></a><p class="title"><b>Table 6.41. Error rates for cyl_bessel_j</b></p> | |
355 | <div class="table-contents"><table class="table" summary="Error rates for cyl_bessel_j"> | |
356 | <colgroup> | |
357 | <col> | |
358 | <col> | |
359 | <col> | |
360 | <col> | |
361 | <col> | |
362 | </colgroup> | |
363 | <thead><tr> | |
364 | <th> | |
365 | </th> | |
366 | <th> | |
367 | <p> | |
368 | Microsoft Visual C++ version 12.0<br> Win32<br> double | |
369 | </p> | |
370 | </th> | |
371 | <th> | |
372 | <p> | |
373 | GNU C++ version 5.1.0<br> linux<br> long double | |
374 | </p> | |
375 | </th> | |
376 | <th> | |
377 | <p> | |
378 | GNU C++ version 5.1.0<br> linux<br> double | |
379 | </p> | |
380 | </th> | |
381 | <th> | |
382 | <p> | |
383 | Sun compiler version 0x5130<br> Sun Solaris<br> long double | |
384 | </p> | |
385 | </th> | |
386 | </tr></thead> | |
387 | <tbody> | |
388 | <tr> | |
389 | <td> | |
390 | <p> | |
391 | Bessel J0: Mathworld Data | |
392 | </p> | |
393 | </td> | |
394 | <td> | |
395 | <p> | |
396 | <span class="blue">Max = 2.52ε (Mean = 1.2ε)</span> | |
397 | </p> | |
398 | </td> | |
399 | <td> | |
400 | <p> | |
401 | <span class="blue">Max = 6.55ε (Mean = 2.89ε)</span><br> <br> | |
402 | (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 5.04ε (Mean = 1.78ε) | |
403 | <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_long_double_cyl_bessel_j__tr1_cmath__Bessel_J0_Mathworld_Data">And | |
404 | other failures.</a>) | |
405 | </p> | |
406 | </td> | |
407 | <td> | |
408 | <p> | |
409 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
410 | 1.16:</em></span> Max = 0.629ε (Mean = 0.223ε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_bessel_j_GSL_1_16_Bessel_J0_Mathworld_Data">And | |
411 | other failures.</a>)<br> (<span class="emphasis"><em>Rmath 3.0.2:</em></span> | |
412 | <span class="red">Max = +INFε (Mean = +INFε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_bessel_j_Rmath_3_0_2_Bessel_J0_Mathworld_Data">And | |
413 | other failures.</a>)</span><br> (<span class="emphasis"><em>Cephes:</em></span> | |
414 | Max = 1.12ε (Mean = 0.568ε)) | |
415 | </p> | |
416 | </td> | |
417 | <td> | |
418 | <p> | |
419 | <span class="blue">Max = 6.55ε (Mean = 2.86ε)</span> | |
420 | </p> | |
421 | </td> | |
422 | </tr> | |
423 | <tr> | |
424 | <td> | |
425 | <p> | |
426 | Bessel J0: Mathworld Data (Tricky cases) | |
427 | </p> | |
428 | </td> | |
429 | <td> | |
430 | <p> | |
431 | <span class="blue">Max = 1e+007ε (Mean = 4.09e+006ε)</span> | |
432 | </p> | |
433 | </td> | |
434 | <td> | |
435 | <p> | |
436 | <span class="blue">Max = 1.63e+08ε (Mean = 6.67e+07ε)</span><br> | |
437 | <br> (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 4.79e+08ε (Mean | |
438 | = 1.96e+08ε)) | |
439 | </p> | |
440 | </td> | |
441 | <td> | |
442 | <p> | |
443 | <span class="blue">Max = 7.98e+04ε (Mean = 3.26e+04ε)</span><br> | |
444 | <br> (<span class="emphasis"><em>GSL 1.16:</em></span> Max = 6.5e+07ε (Mean = 2.66e+07ε))<br> | |
445 | (<span class="emphasis"><em>Rmath 3.0.2:</em></span> Max = 1.04e+07ε (Mean = 4.29e+06ε))<br> | |
446 | (<span class="emphasis"><em>Cephes:</em></span> <span class="red">Max = 2.54e+08ε (Mean | |
447 | = 1.04e+08ε))</span> | |
448 | </p> | |
449 | </td> | |
450 | <td> | |
451 | <p> | |
452 | <span class="blue">Max = 1.64e+08ε (Mean = 6.69e+07ε)</span> | |
453 | </p> | |
454 | </td> | |
455 | </tr> | |
456 | <tr> | |
457 | <td> | |
458 | <p> | |
459 | Bessel J1: Mathworld Data | |
460 | </p> | |
461 | </td> | |
462 | <td> | |
463 | <p> | |
464 | <span class="blue">Max = 1.73ε (Mean = 0.976ε)</span> | |
465 | </p> | |
466 | </td> | |
467 | <td> | |
468 | <p> | |
469 | <span class="blue">Max = 2.66ε (Mean = 1.38ε)</span><br> <br> | |
470 | (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 6.1ε (Mean = 2.95ε) | |
471 | <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_long_double_cyl_bessel_j__tr1_cmath__Bessel_J1_Mathworld_Data">And | |
472 | other failures.</a>) | |
473 | </p> | |
474 | </td> | |
475 | <td> | |
476 | <p> | |
477 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
478 | 1.16:</em></span> Max = 6.62ε (Mean = 2.35ε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_bessel_j_GSL_1_16_Bessel_J1_Mathworld_Data">And | |
479 | other failures.</a>)<br> (<span class="emphasis"><em>Rmath 3.0.2:</em></span> | |
480 | <span class="red">Max = +INFε (Mean = +INFε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_bessel_j_Rmath_3_0_2_Bessel_J1_Mathworld_Data">And | |
481 | other failures.</a>)</span><br> (<span class="emphasis"><em>Cephes:</em></span> | |
482 | Max = 2.88ε (Mean = 1.12ε)) | |
483 | </p> | |
484 | </td> | |
485 | <td> | |
486 | <p> | |
487 | <span class="blue">Max = 1.44ε (Mean = 0.637ε)</span> | |
488 | </p> | |
489 | </td> | |
490 | </tr> | |
491 | <tr> | |
492 | <td> | |
493 | <p> | |
494 | Bessel J1: Mathworld Data (tricky cases) | |
495 | </p> | |
496 | </td> | |
497 | <td> | |
498 | <p> | |
499 | <span class="blue">Max = 3.23e+004ε (Mean = 1.45e+004ε)</span> | |
500 | </p> | |
501 | </td> | |
502 | <td> | |
503 | <p> | |
504 | <span class="blue">Max = 2.18e+05ε (Mean = 9.76e+04ε)</span><br> | |
505 | <br> (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 2.15e+06ε (Mean | |
506 | = 1.58e+06ε)) | |
507 | </p> | |
508 | </td> | |
509 | <td> | |
510 | <p> | |
511 | <span class="blue">Max = 106ε (Mean = 47.5ε)</span><br> <br> | |
512 | (<span class="emphasis"><em>GSL 1.16:</em></span> Max = 8.75e+05ε (Mean = 5.32e+05ε))<br> | |
513 | (<span class="emphasis"><em>Rmath 3.0.2:</em></span> Max = 2.93e+06ε (Mean = 1.7e+06ε))<br> | |
514 | (<span class="emphasis"><em>Cephes:</em></span> Max = 9.56e+05ε (Mean = 4.99e+05ε)) | |
515 | </p> | |
516 | </td> | |
517 | <td> | |
518 | <p> | |
519 | <span class="blue">Max = 2.18e+05ε (Mean = 9.76e+04ε)</span> | |
520 | </p> | |
521 | </td> | |
522 | </tr> | |
523 | <tr> | |
524 | <td> | |
525 | <p> | |
526 | Bessel JN: Mathworld Data | |
527 | </p> | |
528 | </td> | |
529 | <td> | |
530 | <p> | |
531 | <span class="blue">Max = 14.7ε (Mean = 5.4ε)</span> | |
532 | </p> | |
533 | </td> | |
534 | <td> | |
535 | <p> | |
536 | <span class="blue">Max = 6.85ε (Mean = 3.41ε)</span><br> <br> | |
537 | (<span class="emphasis"><em><tr1/cmath>:</em></span> <span class="red">Max | |
538 | = 2.13e+19ε (Mean = 5.16e+18ε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_long_double_cyl_bessel_j__tr1_cmath__Bessel_JN_Mathworld_Data">And | |
539 | other failures.</a>)</span> | |
540 | </p> | |
541 | </td> | |
542 | <td> | |
543 | <p> | |
544 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
545 | 1.16:</em></span> Max = 6.9e+05ε (Mean = 2.15e+05ε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_bessel_j_GSL_1_16_Bessel_JN_Mathworld_Data">And | |
546 | other failures.</a>)<br> (<span class="emphasis"><em>Rmath 3.0.2:</em></span> | |
547 | <span class="red">Max = +INFε (Mean = +INFε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_bessel_j_Rmath_3_0_2_Bessel_JN_Mathworld_Data">And | |
548 | other failures.</a>)</span><br> (<span class="emphasis"><em>Cephes:</em></span> | |
549 | Max = 5.53e+05ε (Mean = 1.9e+05ε)) | |
550 | </p> | |
551 | </td> | |
552 | <td> | |
553 | <p> | |
554 | <span class="blue">Max = 463ε (Mean = 112ε)</span> | |
555 | </p> | |
556 | </td> | |
557 | </tr> | |
558 | <tr> | |
559 | <td> | |
560 | <p> | |
561 | Bessel J: Mathworld Data | |
562 | </p> | |
563 | </td> | |
564 | <td> | |
565 | <p> | |
566 | <span class="blue">Max = 14.9ε (Mean = 3.82ε)</span> | |
567 | </p> | |
568 | </td> | |
569 | <td> | |
570 | <p> | |
571 | <span class="blue">Max = 14.7ε (Mean = 4.05ε)</span><br> <br> | |
572 | (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 3.49e+05ε (Mean = | |
573 | 7.89e+04ε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_long_double_cyl_bessel_j__tr1_cmath__Bessel_J_Mathworld_Data">And | |
574 | other failures.</a>) | |
575 | </p> | |
576 | </td> | |
577 | <td> | |
578 | <p> | |
579 | <span class="blue">Max = 10ε (Mean = 2.19ε)</span><br> <br> | |
580 | (<span class="emphasis"><em>GSL 1.16:</em></span> Max = 2.39e+05ε (Mean = 5.24e+04ε) | |
581 | <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_bessel_j_GSL_1_16_Bessel_J_Mathworld_Data">And | |
582 | other failures.</a>)<br> (<span class="emphasis"><em>Rmath 3.0.2:</em></span> | |
583 | <span class="red">Max = +INFε (Mean = +INFε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_bessel_j_Rmath_3_0_2_Bessel_J_Mathworld_Data">And | |
584 | other failures.</a>)</span><br> (<span class="emphasis"><em>Cephes:</em></span> | |
585 | Max = 5.47e+05ε (Mean = 1.3e+05ε)) | |
586 | </p> | |
587 | </td> | |
588 | <td> | |
589 | <p> | |
590 | <span class="blue">Max = 14.7ε (Mean = 4.12ε)</span> | |
591 | </p> | |
592 | </td> | |
593 | </tr> | |
594 | <tr> | |
595 | <td> | |
596 | <p> | |
597 | Bessel J: Mathworld Data (large values) | |
598 | </p> | |
599 | </td> | |
600 | <td> | |
601 | <p> | |
602 | <span class="blue">Max = 9.31ε (Mean = 5.52ε)</span> | |
603 | </p> | |
604 | </td> | |
605 | <td> | |
606 | <p> | |
607 | <span class="blue">Max = 607ε (Mean = 305ε)</span><br> <br> | |
608 | (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 34.9ε (Mean = 17.4ε) | |
609 | <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_long_double_cyl_bessel_j__tr1_cmath__Bessel_J_Mathworld_Data_large_values_">And | |
610 | other failures.</a>) | |
611 | </p> | |
612 | </td> | |
613 | <td> | |
614 | <p> | |
615 | <span class="blue">Max = 0.536ε (Mean = 0.268ε)</span><br> <br> | |
616 | (<span class="emphasis"><em>GSL 1.16:</em></span> Max = 4.91e+03ε (Mean = 2.46e+03ε) | |
617 | <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_bessel_j_GSL_1_16_Bessel_J_Mathworld_Data_large_values_">And | |
618 | other failures.</a>)<br> (<span class="emphasis"><em>Rmath 3.0.2:</em></span> | |
619 | Max = 35.9ε (Mean = 18.1ε))<br> (<span class="emphasis"><em>Cephes:</em></span> <span class="red">Max = +INFε (Mean = +INFε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_bessel_j_Cephes_Bessel_J_Mathworld_Data_large_values_">And | |
620 | other failures.</a>)</span> | |
621 | </p> | |
622 | </td> | |
623 | <td> | |
624 | <p> | |
625 | <span class="blue">Max = 607ε (Mean = 305ε)</span> | |
626 | </p> | |
627 | </td> | |
628 | </tr> | |
629 | <tr> | |
630 | <td> | |
631 | <p> | |
632 | Bessel JN: Random Data | |
633 | </p> | |
634 | </td> | |
635 | <td> | |
636 | <p> | |
637 | <span class="blue">Max = 17.5ε (Mean = 1.46ε)</span> | |
638 | </p> | |
639 | </td> | |
640 | <td> | |
641 | <p> | |
642 | <span class="blue">Max = 50.8ε (Mean = 4.15ε)</span><br> <br> | |
643 | (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 1.12e+03ε (Mean = | |
644 | 88.7ε)) | |
645 | </p> | |
646 | </td> | |
647 | <td> | |
648 | <p> | |
649 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
650 | 1.16:</em></span> Max = 75.7ε (Mean = 5.36ε))<br> (<span class="emphasis"><em>Rmath | |
651 | 3.0.2:</em></span> Max = 3.93ε (Mean = 1.22ε))<br> (<span class="emphasis"><em>Cephes:</em></span> | |
652 | Max = 91.4ε (Mean = 6.47ε)) | |
653 | </p> | |
654 | </td> | |
655 | <td> | |
656 | <p> | |
657 | <span class="blue">Max = 99.6ε (Mean = 22ε)</span> | |
658 | </p> | |
659 | </td> | |
660 | </tr> | |
661 | <tr> | |
662 | <td> | |
663 | <p> | |
664 | Bessel J: Random Data | |
665 | </p> | |
666 | </td> | |
667 | <td> | |
668 | <p> | |
669 | <span class="blue">Max = 9.24ε (Mean = 1.36ε)</span> | |
670 | </p> | |
671 | </td> | |
672 | <td> | |
673 | <p> | |
674 | <span class="blue">Max = 9.81ε (Mean = 1.59ε)</span><br> <br> | |
675 | (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 501ε (Mean = 52.3ε)) | |
676 | </p> | |
677 | </td> | |
678 | <td> | |
679 | <p> | |
680 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
681 | 1.16:</em></span> Max = 15.5ε (Mean = 3.33ε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_bessel_j_GSL_1_16_Bessel_J_Random_Data">And | |
682 | other failures.</a>)<br> (<span class="emphasis"><em>Rmath 3.0.2:</em></span> | |
683 | Max = 6.74ε (Mean = 1.3ε))<br> (<span class="emphasis"><em>Cephes:</em></span> Max | |
684 | = 16.7ε (Mean = 2.5ε)) | |
685 | </p> | |
686 | </td> | |
687 | <td> | |
688 | <p> | |
689 | <span class="blue">Max = 260ε (Mean = 34ε)</span> | |
690 | </p> | |
691 | </td> | |
692 | </tr> | |
693 | <tr> | |
694 | <td> | |
695 | <p> | |
696 | Bessel J: Random Data (Tricky large values) | |
697 | </p> | |
698 | </td> | |
699 | <td> | |
700 | <p> | |
701 | <span class="blue">Max = 59.2ε (Mean = 8.67ε)</span> | |
702 | </p> | |
703 | </td> | |
704 | <td> | |
705 | <p> | |
706 | <span class="blue">Max = 785ε (Mean = 94.2ε)</span><br> <br> | |
707 | (<span class="emphasis"><em><tr1/cmath>:</em></span> <span class="red">Max | |
708 | = 5.01e+17ε (Mean = 6.23e+16ε))</span> | |
709 | </p> | |
710 | </td> | |
711 | <td> | |
712 | <p> | |
713 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
714 | 1.16:</em></span> Max = 2.48e+05ε (Mean = 5.11e+04ε))<br> (<span class="emphasis"><em>Rmath | |
715 | 3.0.2:</em></span> Max = 71.6ε (Mean = 11.7ε))<br> (<span class="emphasis"><em>Cephes:</em></span> | |
716 | Max = 2.48e+05ε (Mean = 3.02e+04ε)) | |
717 | </p> | |
718 | </td> | |
719 | <td> | |
720 | <p> | |
721 | <span class="blue">Max = 785ε (Mean = 97.4ε)</span> | |
722 | </p> | |
723 | </td> | |
724 | </tr> | |
725 | </tbody> | |
726 | </table></div> | |
727 | </div> | |
728 | <br class="table-break"><div class="table"> | |
729 | <a name="math_toolkit.bessel.bessel_first.table_cyl_neumann_integer_orders_"></a><p class="title"><b>Table 6.42. Error rates for cyl_neumann (integer orders)</b></p> | |
730 | <div class="table-contents"><table class="table" summary="Error rates for cyl_neumann (integer orders)"> | |
731 | <colgroup> | |
732 | <col> | |
733 | <col> | |
734 | <col> | |
735 | <col> | |
736 | <col> | |
737 | </colgroup> | |
738 | <thead><tr> | |
739 | <th> | |
740 | </th> | |
741 | <th> | |
742 | <p> | |
743 | Microsoft Visual C++ version 12.0<br> Win32<br> double | |
744 | </p> | |
745 | </th> | |
746 | <th> | |
747 | <p> | |
748 | GNU C++ version 5.1.0<br> linux<br> double | |
749 | </p> | |
750 | </th> | |
751 | <th> | |
752 | <p> | |
753 | GNU C++ version 5.1.0<br> linux<br> long double | |
754 | </p> | |
755 | </th> | |
756 | <th> | |
757 | <p> | |
758 | Sun compiler version 0x5130<br> Sun Solaris<br> long double | |
759 | </p> | |
760 | </th> | |
761 | </tr></thead> | |
762 | <tbody> | |
763 | <tr> | |
764 | <td> | |
765 | <p> | |
766 | Y0: Mathworld Data (Integer Version) | |
767 | </p> | |
768 | </td> | |
769 | <td> | |
770 | <p> | |
771 | <span class="blue">Max = 4.61ε (Mean = 2.29ε)</span><br> <br> | |
772 | (<span class="emphasis"><em><math.h>:</em></span> Max = 5.37e+003ε (Mean = 1.81e+003ε)) | |
773 | </p> | |
774 | </td> | |
775 | <td> | |
776 | <p> | |
777 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
778 | 1.16:</em></span> Max = 6.46ε (Mean = 2.38ε))<br> (<span class="emphasis"><em>Rmath | |
779 | 3.0.2:</em></span> Max = 167ε (Mean = 56.5ε))<br> (<span class="emphasis"><em>Cephes:</em></span> | |
780 | Max = 5.37e+03ε (Mean = 1.81e+03ε)) | |
781 | </p> | |
782 | </td> | |
783 | <td> | |
784 | <p> | |
785 | <span class="blue">Max = 5.59ε (Mean = 2.54ε)</span><br> <br> | |
786 | (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 2.05e+05ε (Mean = | |
787 | 6.87e+04ε)) | |
788 | </p> | |
789 | </td> | |
790 | <td> | |
791 | <p> | |
792 | <span class="blue">Max = 5.53ε (Mean = 2.4ε)</span> | |
793 | </p> | |
794 | </td> | |
795 | </tr> | |
796 | <tr> | |
797 | <td> | |
798 | <p> | |
799 | Y1: Mathworld Data (Integer Version) | |
800 | </p> | |
801 | </td> | |
802 | <td> | |
803 | <p> | |
804 | <span class="blue">Max = 4.75ε (Mean = 1.72ε)</span><br> <br> | |
805 | (<span class="emphasis"><em><math.h>:</em></span> Max = 1.86e+004ε (Mean = 6.2e+003ε)) | |
806 | </p> | |
807 | </td> | |
808 | <td> | |
809 | <p> | |
810 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
811 | 1.16:</em></span> Max = 1.51ε (Mean = 0.839ε))<br> (<span class="emphasis"><em>Rmath | |
812 | 3.0.2:</em></span> Max = 193ε (Mean = 64.4ε))<br> (<span class="emphasis"><em>Cephes:</em></span> | |
813 | Max = 1.86e+04ε (Mean = 6.2e+03ε)) | |
814 | </p> | |
815 | </td> | |
816 | <td> | |
817 | <p> | |
818 | <span class="blue">Max = 12.7ε (Mean = 4.34ε)</span><br> <br> | |
819 | (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 9.71e+03ε (Mean = | |
820 | 4.08e+03ε)) | |
821 | </p> | |
822 | </td> | |
823 | <td> | |
824 | <p> | |
825 | <span class="blue">Max = 6.33ε (Mean = 2.29ε)</span> | |
826 | </p> | |
827 | </td> | |
828 | </tr> | |
829 | <tr> | |
830 | <td> | |
831 | <p> | |
832 | Yn: Mathworld Data (Integer Version) | |
833 | </p> | |
834 | </td> | |
835 | <td> | |
836 | <p> | |
837 | <span class="blue">Max = 35ε (Mean = 11.8ε)</span><br> <br> | |
838 | (<span class="emphasis"><em><math.h>:</em></span> Max = 2.49e+005ε (Mean = 8.14e+004ε)) | |
839 | </p> | |
840 | </td> | |
841 | <td> | |
842 | <p> | |
843 | <span class="blue">Max = 0.993ε (Mean = 0.314ε)</span><br> <br> | |
844 | (<span class="emphasis"><em>GSL 1.16:</em></span> Max = 2.41e+05ε (Mean = 7.62e+04ε))<br> | |
845 | (<span class="emphasis"><em>Rmath 3.0.2:</em></span> Max = 1.24e+04ε (Mean = 4e+03ε))<br> | |
846 | (<span class="emphasis"><em>Cephes:</em></span> Max = 2.49e+05ε (Mean = 8.14e+04ε)) | |
847 | </p> | |
848 | </td> | |
849 | <td> | |
850 | <p> | |
851 | <span class="blue">Max = 55.2ε (Mean = 17.7ε)</span><br> <br> | |
852 | (<span class="emphasis"><em><tr1/cmath>:</em></span> <span class="red">Max | |
853 | = 2.2e+20ε (Mean = 6.97e+19ε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_long_double_cyl_neumann_integer_orders___tr1_cmath__Yn_Mathworld_Data_Integer_Version_">And | |
854 | other failures.</a>)</span> | |
855 | </p> | |
856 | </td> | |
857 | <td> | |
858 | <p> | |
859 | <span class="blue">Max = 55.2ε (Mean = 17.8ε)</span> | |
860 | </p> | |
861 | </td> | |
862 | </tr> | |
863 | </tbody> | |
864 | </table></div> | |
865 | </div> | |
866 | <br class="table-break"><div class="table"> | |
867 | <a name="math_toolkit.bessel.bessel_first.table_cyl_neumann"></a><p class="title"><b>Table 6.43. Error rates for cyl_neumann</b></p> | |
868 | <div class="table-contents"><table class="table" summary="Error rates for cyl_neumann"> | |
869 | <colgroup> | |
870 | <col> | |
871 | <col> | |
872 | <col> | |
873 | <col> | |
874 | <col> | |
875 | </colgroup> | |
876 | <thead><tr> | |
877 | <th> | |
878 | </th> | |
879 | <th> | |
880 | <p> | |
881 | Microsoft Visual C++ version 12.0<br> Win32<br> double | |
882 | </p> | |
883 | </th> | |
884 | <th> | |
885 | <p> | |
886 | GNU C++ version 5.1.0<br> linux<br> double | |
887 | </p> | |
888 | </th> | |
889 | <th> | |
890 | <p> | |
891 | GNU C++ version 5.1.0<br> linux<br> long double | |
892 | </p> | |
893 | </th> | |
894 | <th> | |
895 | <p> | |
896 | Sun compiler version 0x5130<br> Sun Solaris<br> long double | |
897 | </p> | |
898 | </th> | |
899 | </tr></thead> | |
900 | <tbody> | |
901 | <tr> | |
902 | <td> | |
903 | <p> | |
904 | Y0: Mathworld Data | |
905 | </p> | |
906 | </td> | |
907 | <td> | |
908 | <p> | |
909 | <span class="blue">Max = 4.61ε (Mean = 2.29ε)</span> | |
910 | </p> | |
911 | </td> | |
912 | <td> | |
913 | <p> | |
914 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
915 | 1.16:</em></span> Max = 60.9ε (Mean = 20.4ε))<br> (<span class="emphasis"><em>Rmath | |
916 | 3.0.2:</em></span> Max = 167ε (Mean = 56.5ε)) | |
917 | </p> | |
918 | </td> | |
919 | <td> | |
920 | <p> | |
921 | <span class="blue">Max = 5.59ε (Mean = 2.54ε)</span><br> <br> | |
922 | (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 2.05e+05ε (Mean = | |
923 | 6.87e+04ε)) | |
924 | </p> | |
925 | </td> | |
926 | <td> | |
927 | <p> | |
928 | <span class="blue">Max = 5.53ε (Mean = 2.4ε)</span> | |
929 | </p> | |
930 | </td> | |
931 | </tr> | |
932 | <tr> | |
933 | <td> | |
934 | <p> | |
935 | Y1: Mathworld Data | |
936 | </p> | |
937 | </td> | |
938 | <td> | |
939 | <p> | |
940 | <span class="blue">Max = 4.75ε (Mean = 1.72ε)</span> | |
941 | </p> | |
942 | </td> | |
943 | <td> | |
944 | <p> | |
945 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
946 | 1.16:</em></span> Max = 23.4ε (Mean = 8.1ε))<br> (<span class="emphasis"><em>Rmath | |
947 | 3.0.2:</em></span> Max = 193ε (Mean = 64.4ε)) | |
948 | </p> | |
949 | </td> | |
950 | <td> | |
951 | <p> | |
952 | <span class="blue">Max = 12.7ε (Mean = 4.34ε)</span><br> <br> | |
953 | (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 9.71e+03ε (Mean = | |
954 | 4.08e+03ε)) | |
955 | </p> | |
956 | </td> | |
957 | <td> | |
958 | <p> | |
959 | <span class="blue">Max = 6.33ε (Mean = 2.29ε)</span> | |
960 | </p> | |
961 | </td> | |
962 | </tr> | |
963 | <tr> | |
964 | <td> | |
965 | <p> | |
966 | Yn: Mathworld Data | |
967 | </p> | |
968 | </td> | |
969 | <td> | |
970 | <p> | |
971 | <span class="blue">Max = 35ε (Mean = 11.8ε)</span> | |
972 | </p> | |
973 | </td> | |
974 | <td> | |
975 | <p> | |
976 | <span class="blue">Max = 0.993ε (Mean = 0.314ε)</span><br> <br> | |
977 | (<span class="emphasis"><em>GSL 1.16:</em></span> Max = 2.41e+05ε (Mean = 7.62e+04ε) | |
978 | <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_neumann_GSL_1_16_Yn_Mathworld_Data">And | |
979 | other failures.</a>)<br> (<span class="emphasis"><em>Rmath 3.0.2:</em></span> | |
980 | Max = 1.24e+04ε (Mean = 4e+03ε)) | |
981 | </p> | |
982 | </td> | |
983 | <td> | |
984 | <p> | |
985 | <span class="blue">Max = 55.2ε (Mean = 17.7ε)</span><br> <br> | |
986 | (<span class="emphasis"><em><tr1/cmath>:</em></span> <span class="red">Max | |
987 | = 2.2e+20ε (Mean = 6.97e+19ε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_long_double_cyl_neumann__tr1_cmath__Yn_Mathworld_Data">And | |
988 | other failures.</a>)</span> | |
989 | </p> | |
990 | </td> | |
991 | <td> | |
992 | <p> | |
993 | <span class="blue">Max = 55.2ε (Mean = 17.8ε)</span> | |
994 | </p> | |
995 | </td> | |
996 | </tr> | |
997 | <tr> | |
998 | <td> | |
999 | <p> | |
1000 | Yv: Mathworld Data | |
1001 | </p> | |
1002 | </td> | |
1003 | <td> | |
1004 | <p> | |
1005 | <span class="blue">Max = 7.89ε (Mean = 3.27ε)</span> | |
1006 | </p> | |
1007 | </td> | |
1008 | <td> | |
1009 | <p> | |
1010 | <span class="blue">Max = 10ε (Mean = 3.02ε)</span><br> <br> | |
1011 | (<span class="emphasis"><em>GSL 1.16:</em></span> Max = 1.07e+05ε (Mean = 3.22e+04ε) | |
1012 | <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_neumann_GSL_1_16_Yv_Mathworld_Data">And | |
1013 | other failures.</a>)<br> (<span class="emphasis"><em>Rmath 3.0.2:</em></span> | |
1014 | Max = 1.05e+03ε (Mean = 326ε)) | |
1015 | </p> | |
1016 | </td> | |
1017 | <td> | |
1018 | <p> | |
1019 | <span class="blue">Max = 10.7ε (Mean = 4.92ε)</span><br> <br> | |
1020 | (<span class="emphasis"><em><tr1/cmath>:</em></span> <span class="red">Max | |
1021 | = 3.49e+15ε (Mean = 1.05e+15ε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_long_double_cyl_neumann__tr1_cmath__Yv_Mathworld_Data">And | |
1022 | other failures.</a>)</span> | |
1023 | </p> | |
1024 | </td> | |
1025 | <td> | |
1026 | <p> | |
1027 | <span class="blue">Max = 10.7ε (Mean = 5.1ε)</span> | |
1028 | </p> | |
1029 | </td> | |
1030 | </tr> | |
1031 | <tr> | |
1032 | <td> | |
1033 | <p> | |
1034 | Yv: Mathworld Data (large values) | |
1035 | </p> | |
1036 | </td> | |
1037 | <td> | |
1038 | <p> | |
1039 | <span class="blue">Max = 0.682ε (Mean = 0.35ε)</span> | |
1040 | </p> | |
1041 | </td> | |
1042 | <td> | |
1043 | <p> | |
1044 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
1045 | 1.16:</em></span> Max = 60.8ε (Mean = 23ε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_neumann_GSL_1_16_Yv_Mathworld_Data_large_values_">And | |
1046 | other failures.</a>)<br> (<span class="emphasis"><em>Rmath 3.0.2:</em></span> | |
1047 | <span class="red">Max = +INFε (Mean = +INFε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_double_cyl_neumann_Rmath_3_0_2_Yv_Mathworld_Data_large_values_">And | |
1048 | other failures.</a>)</span> | |
1049 | </p> | |
1050 | </td> | |
1051 | <td> | |
1052 | <p> | |
1053 | <span class="blue">Max = 1.57ε (Mean = 1.17ε)</span><br> <br> | |
1054 | (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 43.2ε (Mean = 16.3ε) | |
1055 | <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_long_double_cyl_neumann__tr1_cmath__Yv_Mathworld_Data_large_values_">And | |
1056 | other failures.</a>) | |
1057 | </p> | |
1058 | </td> | |
1059 | <td> | |
1060 | <p> | |
1061 | <span class="blue">Max = 1.57ε (Mean = 1.24ε)</span> | |
1062 | </p> | |
1063 | </td> | |
1064 | </tr> | |
1065 | <tr> | |
1066 | <td> | |
1067 | <p> | |
1068 | Y0 and Y1: Random Data | |
1069 | </p> | |
1070 | </td> | |
1071 | <td> | |
1072 | <p> | |
1073 | <span class="blue">Max = 4.17ε (Mean = 1.24ε)</span> | |
1074 | </p> | |
1075 | </td> | |
1076 | <td> | |
1077 | <p> | |
1078 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
1079 | 1.16:</em></span> Max = 34.4ε (Mean = 8.9ε))<br> (<span class="emphasis"><em>Rmath | |
1080 | 3.0.2:</em></span> Max = 83ε (Mean = 14.2ε)) | |
1081 | </p> | |
1082 | </td> | |
1083 | <td> | |
1084 | <p> | |
1085 | <span class="blue">Max = 11.8ε (Mean = 3.28ε)</span><br> <br> | |
1086 | (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 2.59e+03ε (Mean = | |
1087 | 500ε)) | |
1088 | </p> | |
1089 | </td> | |
1090 | <td> | |
1091 | <p> | |
1092 | <span class="blue">Max = 10.8ε (Mean = 3.04ε)</span> | |
1093 | </p> | |
1094 | </td> | |
1095 | </tr> | |
1096 | <tr> | |
1097 | <td> | |
1098 | <p> | |
1099 | Yn: Random Data | |
1100 | </p> | |
1101 | </td> | |
1102 | <td> | |
1103 | <p> | |
1104 | <span class="blue">Max = 117ε (Mean = 10.2ε)</span> | |
1105 | </p> | |
1106 | </td> | |
1107 | <td> | |
1108 | <p> | |
1109 | <span class="blue">Max = 0ε (Mean = 0ε)</span><br> <br> (<span class="emphasis"><em>GSL | |
1110 | 1.16:</em></span> Max = 500ε (Mean = 47.8ε))<br> (<span class="emphasis"><em>Rmath | |
1111 | 3.0.2:</em></span> Max = 691ε (Mean = 67.9ε)) | |
1112 | </p> | |
1113 | </td> | |
1114 | <td> | |
1115 | <p> | |
1116 | <span class="blue">Max = 338ε (Mean = 28.2ε)</span><br> <br> | |
1117 | (<span class="emphasis"><em><tr1/cmath>:</em></span> Max = 4.01e+03ε (Mean = | |
1118 | 348ε)) | |
1119 | </p> | |
1120 | </td> | |
1121 | <td> | |
1122 | <p> | |
1123 | <span class="blue">Max = 338ε (Mean = 27.5ε)</span> | |
1124 | </p> | |
1125 | </td> | |
1126 | </tr> | |
1127 | <tr> | |
1128 | <td> | |
1129 | <p> | |
1130 | Yv: Random Data | |
1131 | </p> | |
1132 | </td> | |
1133 | <td> | |
1134 | <p> | |
1135 | <span class="blue">Max = 1.23e+003ε (Mean = 69.9ε)</span> | |
1136 | </p> | |
1137 | </td> | |
1138 | <td> | |
1139 | <p> | |
1140 | <span class="blue">Max = 1.53ε (Mean = 0.102ε)</span><br> <br> | |
1141 | (<span class="emphasis"><em>GSL 1.16:</em></span> Max = 1.41e+06ε (Mean = 7.67e+04ε))<br> | |
1142 | (<span class="emphasis"><em>Rmath 3.0.2:</em></span> Max = 1.79e+05ε (Mean = 9.64e+03ε)) | |
1143 | </p> | |
1144 | </td> | |
1145 | <td> | |
1146 | <p> | |
1147 | <span class="blue">Max = 2.08e+03ε (Mean = 149ε)</span><br> | |
1148 | <br> (<span class="emphasis"><em><tr1/cmath>:</em></span> <span class="red">Max | |
1149 | = +INFε (Mean = +INFε) <a class="link" href="../logs_and_tables/logs.html#errors_GNU_C_version_5_1_0_linux_long_double_cyl_neumann__tr1_cmath__Yv_Random_Data">And | |
1150 | other failures.</a>)</span> | |
1151 | </p> | |
1152 | </td> | |
1153 | <td> | |
1154 | <p> | |
1155 | <span class="blue">Max = 2.08e+03ε (Mean = 149ε)</span> | |
1156 | </p> | |
1157 | </td> | |
1158 | </tr> | |
1159 | </tbody> | |
1160 | </table></div> | |
1161 | </div> | |
1162 | <br class="table-break"><p> | |
1163 | Note that for large <span class="emphasis"><em>x</em></span> these functions are largely dependent | |
1164 | on the accuracy of the <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">sin</span></code> and | |
1165 | <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">cos</span></code> functions. | |
1166 | </p> | |
1167 | <p> | |
1168 | Comparison to GSL and <a href="http://www.netlib.org/cephes/" target="_top">Cephes</a> | |
1169 | is interesting: both <a href="http://www.netlib.org/cephes/" target="_top">Cephes</a> | |
1170 | and this library optimise the integer order case - leading to identical results | |
1171 | - simply using the general case is for the most part slightly more accurate | |
1172 | though, as noted by the better accuracy of GSL in the integer argument cases. | |
1173 | This implementation tends to perform much better when the arguments become | |
1174 | large, <a href="http://www.netlib.org/cephes/" target="_top">Cephes</a> in particular | |
1175 | produces some remarkably inaccurate results with some of the test data (no | |
1176 | significant figures correct), and even GSL performs badly with some inputs | |
1177 | to J<sub>v</sub>. Note that by way of double-checking these results, the worst performing | |
1178 | <a href="http://www.netlib.org/cephes/" target="_top">Cephes</a> and GSL cases were | |
1179 | recomputed using <a href="http://functions.wolfram.com" target="_top">functions.wolfram.com</a>, | |
1180 | and the result checked against our test data: no errors in the test data | |
1181 | were found. | |
1182 | </p> | |
1183 | <h5> | |
1184 | <a name="math_toolkit.bessel.bessel_first.h4"></a> | |
1185 | <span class="phrase"><a name="math_toolkit.bessel.bessel_first.implementation"></a></span><a class="link" href="bessel_first.html#math_toolkit.bessel.bessel_first.implementation">Implementation</a> | |
1186 | </h5> | |
1187 | <p> | |
1188 | The implementation is mostly about filtering off various special cases: | |
1189 | </p> | |
1190 | <p> | |
1191 | When <span class="emphasis"><em>x</em></span> is negative, then the order <span class="emphasis"><em>v</em></span> | |
1192 | must be an integer or the result is a domain error. If the order is an integer | |
1193 | then the function is odd for odd orders and even for even orders, so we reflect | |
1194 | to <span class="emphasis"><em>x > 0</em></span>. | |
1195 | </p> | |
1196 | <p> | |
1197 | When the order <span class="emphasis"><em>v</em></span> is negative then the reflection formulae | |
1198 | can be used to move to <span class="emphasis"><em>v > 0</em></span>: | |
1199 | </p> | |
1200 | <p> | |
1201 | <span class="inlinemediaobject"><img src="../../../equations/bessel9.svg"></span> | |
1202 | </p> | |
1203 | <p> | |
1204 | <span class="inlinemediaobject"><img src="../../../equations/bessel10.svg"></span> | |
1205 | </p> | |
1206 | <p> | |
1207 | Note that if the order is an integer, then these formulae reduce to: | |
1208 | </p> | |
1209 | <p> | |
1210 | J<sub>-n</sub> = (-1)<sup>n</sup>J<sub>n</sub> | |
1211 | </p> | |
1212 | <p> | |
1213 | Y<sub>-n</sub> = (-1)<sup>n</sup>Y<sub>n</sub> | |
1214 | </p> | |
1215 | <p> | |
1216 | However, in general, a negative order implies that we will need to compute | |
1217 | both J and Y. | |
1218 | </p> | |
1219 | <p> | |
1220 | When <span class="emphasis"><em>x</em></span> is large compared to the order <span class="emphasis"><em>v</em></span> | |
1221 | then the asymptotic expansions for large <span class="emphasis"><em>x</em></span> in M. Abramowitz | |
1222 | and I.A. Stegun, <span class="emphasis"><em>Handbook of Mathematical Functions</em></span> | |
1223 | 9.2.19 are used (these were found to be more reliable than those in A&S | |
1224 | 9.2.5). | |
1225 | </p> | |
1226 | <p> | |
1227 | When the order <span class="emphasis"><em>v</em></span> is an integer the method first relates | |
1228 | the result to J<sub>0</sub>, J<sub>1</sub>, Y<sub>0</sub>   and Y<sub>1</sub>   using either forwards or backwards recurrence | |
1229 | (Miller's algorithm) depending upon which is stable. The values for J<sub>0</sub>, J<sub>1</sub>, | |
1230 | Y<sub>0</sub>   and Y<sub>1</sub>   are calculated using the rational minimax approximations on root-bracketing | |
1231 | intervals for small <span class="emphasis"><em>|x|</em></span> and Hankel asymptotic expansion | |
1232 | for large <span class="emphasis"><em>|x|</em></span>. The coefficients are from: | |
1233 | </p> | |
1234 | <p> | |
1235 | W.J. Cody, <span class="emphasis"><em>ALGORITHM 715: SPECFUN - A Portable FORTRAN Package | |
1236 | of Special Function Routines and Test Drivers</em></span>, ACM Transactions | |
1237 | on Mathematical Software, vol 19, 22 (1993). | |
1238 | </p> | |
1239 | <p> | |
1240 | and | |
1241 | </p> | |
1242 | <p> | |
1243 | J.F. Hart et al, <span class="emphasis"><em>Computer Approximations</em></span>, John Wiley | |
1244 | & Sons, New York, 1968. | |
1245 | </p> | |
1246 | <p> | |
1247 | These approximations are accurate to around 19 decimal digits: therefore | |
1248 | these methods are not used when type T has more than 64 binary digits. | |
1249 | </p> | |
1250 | <p> | |
1251 | When <span class="emphasis"><em>x</em></span> is smaller than machine epsilon then the following | |
1252 | approximations for Y<sub>0</sub>(x), Y<sub>1</sub>(x), Y<sub>2</sub>(x) and Y<sub>n</sub>(x) can be used (see: <a href="http://functions.wolfram.com/03.03.06.0037.01" target="_top">http://functions.wolfram.com/03.03.06.0037.01</a>, | |
1253 | <a href="http://functions.wolfram.com/03.03.06.0038.01" target="_top">http://functions.wolfram.com/03.03.06.0038.01</a>, | |
1254 | <a href="http://functions.wolfram.com/03.03.06.0039.01" target="_top">http://functions.wolfram.com/03.03.06.0039.01</a> | |
1255 | and <a href="http://functions.wolfram.com/03.03.06.0040.01" target="_top">http://functions.wolfram.com/03.03.06.0040.01</a>): | |
1256 | </p> | |
1257 | <p> | |
1258 | <span class="inlinemediaobject"><img src="../../../equations/bessel_y0_small_z.svg"></span> | |
1259 | </p> | |
1260 | <p> | |
1261 | <span class="inlinemediaobject"><img src="../../../equations/bessel_y1_small_z.svg"></span> | |
1262 | </p> | |
1263 | <p> | |
1264 | <span class="inlinemediaobject"><img src="../../../equations/bessel_y2_small_z.svg"></span> | |
1265 | </p> | |
1266 | <p> | |
1267 | <span class="inlinemediaobject"><img src="../../../equations/bessel_yn_small_z.svg"></span> | |
1268 | </p> | |
1269 | <p> | |
1270 | When <span class="emphasis"><em>x</em></span> is small compared to <span class="emphasis"><em>v</em></span> and | |
1271 | <span class="emphasis"><em>v</em></span> is not an integer, then the following series approximation | |
1272 | can be used for Y<sub>v</sub>(x), this is also an area where other approximations are | |
1273 | often too slow to converge to be used (see <a href="http://functions.wolfram.com/03.03.06.0034.01" target="_top">http://functions.wolfram.com/03.03.06.0034.01</a>): | |
1274 | </p> | |
1275 | <p> | |
1276 | <span class="inlinemediaobject"><img src="../../../equations/bessel_yv_small_z.svg"></span> | |
1277 | </p> | |
1278 | <p> | |
1279 | When <span class="emphasis"><em>x</em></span> is small compared to <span class="emphasis"><em>v</em></span>, | |
1280 | J<sub>v</sub>x   is best computed directly from the series: | |
1281 | </p> | |
1282 | <p> | |
1283 | <span class="inlinemediaobject"><img src="../../../equations/bessel2.svg"></span> | |
1284 | </p> | |
1285 | <p> | |
1286 | In the general case we compute J<sub>v</sub>   and Y<sub>v</sub>   simultaneously. | |
1287 | </p> | |
1288 | <p> | |
1289 | To get the initial values, let μ   = ν - floor(ν + 1/2), then μ   is the fractional part | |
1290 | of ν   such that |μ| <= 1/2 (we need this for convergence later). The idea | |
1291 | is to calculate J<sub>μ</sub>(x), J<sub>μ+1</sub>(x), Y<sub>μ</sub>(x), Y<sub>μ+1</sub>(x) and use them to obtain J<sub>ν</sub>(x), Y<sub>ν</sub>(x). | |
1292 | </p> | |
1293 | <p> | |
1294 | The algorithm is called Steed's method, which needs two continued fractions | |
1295 | as well as the Wronskian: | |
1296 | </p> | |
1297 | <p> | |
1298 | <span class="inlinemediaobject"><img src="../../../equations/bessel8.svg"></span> | |
1299 | </p> | |
1300 | <p> | |
1301 | <span class="inlinemediaobject"><img src="../../../equations/bessel11.svg"></span> | |
1302 | </p> | |
1303 | <p> | |
1304 | <span class="inlinemediaobject"><img src="../../../equations/bessel12.svg"></span> | |
1305 | </p> | |
1306 | <p> | |
1307 | See: F.S. Acton, <span class="emphasis"><em>Numerical Methods that Work</em></span>, The Mathematical | |
1308 | Association of America, Washington, 1997. | |
1309 | </p> | |
1310 | <p> | |
1311 | The continued fractions are computed using the modified Lentz's method (W.J. | |
1312 | Lentz, <span class="emphasis"><em>Generating Bessel functions in Mie scattering calculations | |
1313 | using continued fractions</em></span>, Applied Optics, vol 15, 668 (1976)). | |
1314 | Their convergence rates depend on <span class="emphasis"><em>x</em></span>, therefore we need | |
1315 | different strategies for large <span class="emphasis"><em>x</em></span> and small <span class="emphasis"><em>x</em></span>. | |
1316 | </p> | |
1317 | <p> | |
1318 | <span class="emphasis"><em>x > v</em></span>, CF1 needs O(<span class="emphasis"><em>x</em></span>) iterations | |
1319 | to converge, CF2 converges rapidly | |
1320 | </p> | |
1321 | <p> | |
1322 | <span class="emphasis"><em>x <= v</em></span>, CF1 converges rapidly, CF2 fails to converge | |
1323 | when <span class="emphasis"><em>x</em></span> <code class="literal">-></code> 0 | |
1324 | </p> | |
1325 | <p> | |
1326 | When <span class="emphasis"><em>x</em></span> is large (<span class="emphasis"><em>x</em></span> > 2), both | |
1327 | continued fractions converge (CF1 may be slow for really large <span class="emphasis"><em>x</em></span>). | |
1328 | J<sub>μ</sub>, J<sub>μ+1</sub>, Y<sub>μ</sub>, Y<sub>μ+1</sub> can be calculated by | |
1329 | </p> | |
1330 | <p> | |
1331 | <span class="inlinemediaobject"><img src="../../../equations/bessel13.svg"></span> | |
1332 | </p> | |
1333 | <p> | |
1334 | where | |
1335 | </p> | |
1336 | <p> | |
1337 | <span class="inlinemediaobject"><img src="../../../equations/bessel14.svg"></span> | |
1338 | </p> | |
1339 | <p> | |
1340 | J<sub>ν</sub> and Y<sub>μ</sub> are then calculated using backward (Miller's algorithm) and forward | |
1341 | recurrence respectively. | |
1342 | </p> | |
1343 | <p> | |
1344 | When <span class="emphasis"><em>x</em></span> is small (<span class="emphasis"><em>x</em></span> <= 2), CF2 | |
1345 | convergence may fail (but CF1 works very well). The solution here is Temme's | |
1346 | series: | |
1347 | </p> | |
1348 | <p> | |
1349 | <span class="inlinemediaobject"><img src="../../../equations/bessel15.svg"></span> | |
1350 | </p> | |
1351 | <p> | |
1352 | where | |
1353 | </p> | |
1354 | <p> | |
1355 | <span class="inlinemediaobject"><img src="../../../equations/bessel16.svg"></span> | |
1356 | </p> | |
1357 | <p> | |
1358 | g<sub>k</sub>   and h<sub>k</sub>   | |
1359 | are also computed by recursions (involving gamma functions), but | |
1360 | the formulas are a little complicated, readers are refered to N.M. Temme, | |
1361 | <span class="emphasis"><em>On the numerical evaluation of the ordinary Bessel function of | |
1362 | the second kind</em></span>, Journal of Computational Physics, vol 21, 343 | |
1363 | (1976). Note Temme's series converge only for |μ| <= 1/2. | |
1364 | </p> | |
1365 | <p> | |
1366 | As the previous case, Y<sub>ν</sub>   is calculated from the forward recurrence, so is Y<sub>ν+1</sub>. | |
1367 | With these two values and f<sub>ν</sub>, the Wronskian yields J<sub>ν</sub>(x) directly without backward | |
1368 | recurrence. | |
1369 | </p> | |
1370 | </div> | |
1371 | <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> | |
1372 | <td align="left"></td> | |
1373 | <td align="right"><div class="copyright-footer">Copyright © 2006-2010, 2012-2014 Nikhar Agrawal, | |
1374 | Anton Bikineev, Paul A. Bristow, Marco Guazzone, Christopher Kormanyos, Hubert | |
1375 | Holin, Bruno Lalande, John Maddock, Jeremy Murphy, Johan Råde, Gautam Sewani, | |
1376 | Benjamin Sobotta, Thijs van den Berg, Daryle Walker and Xiaogang Zhang<p> | |
1377 | Distributed under the Boost Software License, Version 1.0. (See accompanying | |
1378 | file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) | |
1379 | </p> | |
1380 | </div></td> | |
1381 | </tr></table> | |
1382 | <hr> | |
1383 | <div class="spirit-nav"> | |
1384 | <a accesskey="p" href="bessel_over.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../bessel.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="bessel_root.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a> | |
1385 | </div> | |
1386 | </body> | |
1387 | </html> |