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