From e0737c56c1e384e05064a0c6e1ac46979371041b Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Wed, 19 Dec 2018 22:58:32 +0100 Subject: New upstream version 2.0.0+repack --- .../math_toolkit/bessel/bessel_derivatives.html | 1452 ++++++++++++++++++++ .../doc/html/math_toolkit/bessel/bessel_first.html | 1387 +++++++++++++++++++ .../doc/html/math_toolkit/bessel/bessel_over.html | 212 +++ .../doc/html/math_toolkit/bessel/bessel_root.html | 764 ++++++++++ .../math/doc/html/math_toolkit/bessel/mbessel.html | 1122 +++++++++++++++ .../doc/html/math_toolkit/bessel/sph_bessel.html | 287 ++++ 6 files changed, 5224 insertions(+) create mode 100644 boost/libs/math/doc/html/math_toolkit/bessel/bessel_derivatives.html create mode 100644 boost/libs/math/doc/html/math_toolkit/bessel/bessel_first.html create mode 100644 boost/libs/math/doc/html/math_toolkit/bessel/bessel_over.html create mode 100644 boost/libs/math/doc/html/math_toolkit/bessel/bessel_root.html create mode 100644 boost/libs/math/doc/html/math_toolkit/bessel/mbessel.html create mode 100644 boost/libs/math/doc/html/math_toolkit/bessel/sph_bessel.html (limited to 'boost/libs/math/doc/html/math_toolkit/bessel') diff --git a/boost/libs/math/doc/html/math_toolkit/bessel/bessel_derivatives.html b/boost/libs/math/doc/html/math_toolkit/bessel/bessel_derivatives.html new file mode 100644 index 00000000..b557e234 --- /dev/null +++ b/boost/libs/math/doc/html/math_toolkit/bessel/bessel_derivatives.html @@ -0,0 +1,1452 @@ + + + +Derivatives of the Bessel Functions + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Synopsis +
+

+ #include <boost/math/special_functions/bessel_prime.hpp> +

+
template <class T1, class T2>
+calculated-result-type cyl_bessel_j_prime(T1 v, T2 x);
+
+template <class T1, class T2, class Policy>
+calculated-result-type cyl_bessel_j_prime(T1 v, T2 x, const Policy&);
+
+template <class T1, class T2>
+calculated-result-type cyl_neumann_prime(T1 v, T2 x);
+
+template <class T1, class T2, class Policy>
+calculated-result-type cyl_neumann_prime(T1 v, T2 x, const Policy&);
+
+template <class T1, class T2>
+calculated-result-type cyl_bessel_i_prime(T1 v, T2 x);
+
+template <class T1, class T2, class Policy>
+calculated-result-type cyl_bessel_i_prime(T1 v, T2 x, const Policy&);
+
+template <class T1, class T2>
+calculated-result-type cyl_bessel_k_prime(T1 v, T2 x);
+
+template <class T1, class T2, class Policy>
+calculated-result-type cyl_bessel_k_prime(T1 v, T2 x, const Policy&);
+
+template <class T1, class T2>
+calculated-result-type sph_bessel_prime(T1 v, T2 x);
+
+template <class T1, class T2, class Policy>
+calculated-result-type sph_bessel_prime(T1 v, T2 x, const Policy&);
+
+template <class T1, class T2>
+calculated-result-type sph_neumann_prime(T1 v, T2 x);
+
+template <class T1, class T2, class Policy>
+calculated-result-type sph_neumann_prime(T1 v, T2 x, const Policy&);
+
+
+ + Description +
+

+ These functions return the first derivative with respect to x + of the corresponding Bessel function. +

+

+ The return type of these functions is computed using the result + type calculation rules when T1 and T2 are different types. + The functions are also optimised for the relatively common case that T1 is + an integer. +

+

+ The final Policy argument is optional and can + be used to control the behaviour of the function: how it handles errors, + what level of precision to use etc. Refer to the policy + documentation for more details. +

+

+ The functions return the result of domain_error + whenever the result is undefined or complex. +

+
+ + Testing +
+

+ There are two sets of test values: spot values calculated using wolframalpha.com, + and a much larger set of tests computed using a relation to the underlying + Bessel functions that the implementation does not use. +

+
+ + Accuracy +
+

+ The accuracy of these functions is broadly similar to the underlying Bessel + functions. +

+
+

Table 6.50. Error rates for cyl_bessel_i_prime (integer orders)

+
+++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

+ Microsoft Visual C++ version 12.0
Win32
double +

+
+

+ GNU C++ version 5.1.0
linux
double +

+
+

+ GNU C++ version 5.1.0
linux
long double +

+
+

+ Sun compiler version 0x5130
Sun Solaris
long double +

+
+

+ Bessel I'0: Mathworld Data (Integer Version) +

+
+

+ Max = 0.885ε (Mean = 0.567ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 7.83ε (Mean = 2.84ε) +

+
+

+ Max = 6.52ε (Mean = 2.26ε) +

+
+

+ Bessel I'1: Mathworld Data (Integer Version) +

+
+

+ Max = 1.61ε (Mean = 0.786ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 2.3ε (Mean = 1.28ε) +

+
+

+ Max = 2.3ε (Mean = 1.29ε) +

+
+

+ Bessel I'n: Mathworld Data (Integer Version) +

+
+

+ Max = 3.61ε (Mean = 1.22ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 2.31ε (Mean = 1.41ε) +

+
+

+ Max = 701ε (Mean = 212ε) +

+
+
+
+

Table 6.51. Error rates for cyl_bessel_i_prime

+
+++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

+ Microsoft Visual C++ version 12.0
Win32
double +

+
+

+ GNU C++ version 5.1.0
linux
double +

+
+

+ GNU C++ version 5.1.0
linux
long double +

+
+

+ Sun compiler version 0x5130
Sun Solaris
long double +

+
+

+ Bessel I'0: Mathworld Data +

+
+

+ Max = 0.885ε (Mean = 0.567ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 7.83ε (Mean = 2.84ε) +

+
+

+ Max = 6.52ε (Mean = 2.26ε) +

+
+

+ Bessel I'1: Mathworld Data +

+
+

+ Max = 1.61ε (Mean = 0.786ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 2.3ε (Mean = 1.28ε) +

+
+

+ Max = 2.3ε (Mean = 1.29ε) +

+
+

+ Bessel I'n: Mathworld Data +

+
+

+ Max = 3.61ε (Mean = 1.22ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 2.31ε (Mean = 1.41ε) +

+
+

+ Max = 701ε (Mean = 212ε) +

+
+

+ Bessel I'v: Mathworld Data +

+
+

+ Max = 3.76e+003ε (Mean = 1.19e+003ε) +

+
+

+ Max = 1.62ε (Mean = 0.512ε) +

+
+

+ Max = 2.89e+03ε (Mean = 914ε) +

+
+

+ Max = 2.89e+03ε (Mean = 914ε) +

+
+

+ Bessel I'n: Random Data +

+
+

+ Max = 9.85ε (Mean = 1.83ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 6.79ε (Mean = 1.13ε) +

+
+

+ Max = 195ε (Mean = 37.1ε) +

+
+

+ Bessel I'v: Random Data +

+
+

+ Max = 14ε (Mean = 2.46ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 14.1ε (Mean = 2.93ε) +

+
+

+ Max = 336ε (Mean = 68.5ε) +

+
+

+ Bessel I'v: Mathworld Data (large values) +

+
+

+ Max = 59.5ε (Mean = 26.8ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 42.6ε (Mean = 20.2ε) +

+
+

+ Max = 43.9ε (Mean = 20.7ε) +

+
+
+
+

Table 6.52. Error rates for cyl_bessel_j_prime (integer orders)

+
+++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

+ Microsoft Visual C++ version 12.0
Win32
double +

+
+

+ GNU C++ version 5.1.0
linux
double +

+
+

+ GNU C++ version 5.1.0
linux
long double +

+
+

+ Sun compiler version 0x5130
Sun Solaris
long double +

+
+

+ Bessel J0': Mathworld Data (Integer Version) +

+
+

+ Max = 6.62ε (Mean = 2.55ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 18.9ε (Mean = 6.81ε) +

+
+

+ Max = 18.9ε (Mean = 6.72ε) +

+
+

+ Bessel J0': Mathworld Data (Tricky cases) (Integer Version) +

+
+

+ Max = 3.67ε (Mean = 1.74ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 8.08ε (Mean = 4.57ε) +

+
+

+ Max = 7.44ε (Mean = 3.31ε) +

+
+

+ Bessel J1': Mathworld Data (Integer Version) +

+
+

+ Max = 0.999ε (Mean = 0.627ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 7.9ε (Mean = 3.37ε) +

+
+

+ Max = 7.9ε (Mean = 3.37ε) +

+
+

+ Bessel J1': Mathworld Data (tricky cases) (Integer Version) +

+
+

+ Max = 288ε (Mean = 129ε) +

+
+

+ Max = 287ε (Mean = 129ε) +

+
+

+ Max = 5.88e+05ε (Mean = 2.63e+05ε) +

+
+

+ Max = 5.88e+05ε (Mean = 2.63e+05ε) +

+
+

+ Bessel JN': Mathworld Data (Integer Version) +

+
+

+ Max = 14ε (Mean = 6.13ε) +

+
+

+ Max = 0.527ε (Mean = 0.128ε) +

+
+

+ Max = 1.29e+03ε (Mean = 312ε) +

+
+

+ Max = 1.29e+03ε (Mean = 355ε) +

+
+
+
+

Table 6.53. Error rates for cyl_bessel_j_prime

+
+++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

+ Microsoft Visual C++ version 12.0
Win32
double +

+
+

+ GNU C++ version 5.1.0
linux
double +

+
+

+ GNU C++ version 5.1.0
linux
long double +

+
+

+ Sun compiler version 0x5130
Sun Solaris
long double +

+
+

+ Bessel J0': Mathworld Data +

+
+

+ Max = 6.62ε (Mean = 2.55ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 18.9ε (Mean = 6.81ε) +

+
+

+ Max = 18.9ε (Mean = 6.72ε) +

+
+

+ Bessel J0': Mathworld Data (Tricky cases) +

+
+

+ Max = 3.67ε (Mean = 1.74ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 8.08ε (Mean = 4.57ε) +

+
+

+ Max = 7.44ε (Mean = 3.31ε) +

+
+

+ Bessel J1': Mathworld Data +

+
+

+ Max = 0.999ε (Mean = 0.627ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 7.9ε (Mean = 3.37ε) +

+
+

+ Max = 7.9ε (Mean = 3.37ε) +

+
+

+ Bessel J1': Mathworld Data (tricky cases) +

+
+

+ Max = 288ε (Mean = 129ε) +

+
+

+ Max = 287ε (Mean = 129ε) +

+
+

+ Max = 5.88e+05ε (Mean = 2.63e+05ε) +

+
+

+ Max = 5.88e+05ε (Mean = 2.63e+05ε) +

+
+

+ Bessel JN': Mathworld Data +

+
+

+ Max = 14ε (Mean = 6.13ε) +

+
+

+ Max = 0.527ε (Mean = 0.128ε) +

+
+

+ Max = 1.29e+03ε (Mean = 312ε) +

+
+

+ Max = 1.29e+03ε (Mean = 355ε) +

+
+

+ Bessel J': Mathworld Data +

+
+

+ Max = 23.7ε (Mean = 8.01ε) +

+
+

+ Max = 21.5ε (Mean = 4.7ε) +

+
+

+ Max = 42.5ε (Mean = 9.31ε) +

+
+

+ Max = 42.5ε (Mean = 9.32ε) +

+
+

+ Bessel J': Mathworld Data (large values) +

+
+

+ Max = 2.9ε (Mean = 1.61ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 989ε (Mean = 495ε) +

+
+

+ Max = 989ε (Mean = 495ε) +

+
+

+ Bessel JN': Random Data +

+
+

+ Max = 6.34ε (Mean = 0.997ε) +

+
+

+ Max = 0.593ε (Mean = 0.0396ε) +

+
+

+ Max = 17.3ε (Mean = 2.47ε) +

+
+

+ Max = 79.4ε (Mean = 16.2ε) +

+
+

+ Bessel J': Random Data +

+
+

+ Max = 176ε (Mean = 9.76ε) +

+
+

+ Max = 0.885ε (Mean = 0.0457ε) +

+
+

+ Max = 139ε (Mean = 6.47ε) +

+
+

+ Max = 279ε (Mean = 27.2ε) +

+
+

+ Bessel J': Random Data (Tricky large values) +

+
+

+ Max = 379ε (Mean = 45.4ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 474ε (Mean = 62.2ε) +

+
+

+ Max = 474ε (Mean = 64.5ε) +

+
+
+
+

Table 6.54. Error rates for cyl_bessel_k_prime (integer orders)

+
+++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

+ Microsoft Visual C++ version 12.0
Win32
double +

+
+

+ GNU C++ version 5.1.0
linux
double +

+
+

+ GNU C++ version 5.1.0
linux
long double +

+
+

+ Sun compiler version 0x5130
Sun Solaris
long double +

+
+

+ Bessel K'0: Mathworld Data (Integer Version) +

+
+

+ Max = 1ε (Mean = 0.573ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 1.8ε (Mean = 1.02ε) +

+
+

+ Max = 1.8ε (Mean = 1.02ε) +

+
+

+ Bessel K'1: Mathworld Data (Integer Version) +

+
+

+ Max = 1.09ε (Mean = 0.607ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 1.96ε (Mean = 1ε) +

+
+

+ Max = 1.96ε (Mean = 1.04ε) +

+
+

+ Bessel K'n: Mathworld Data (Integer Version) +

+
+

+ Max = 4.17ε (Mean = 1.74ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 4.47ε (Mean = 2.05ε) +

+
+

+ Max = 4.47ε (Mean = 1.93ε) +

+
+
+
+

Table 6.55. Error rates for cyl_bessel_k_prime

+
+++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

+ Microsoft Visual C++ version 12.0
Win32
double +

+
+

+ GNU C++ version 5.1.0
linux
double +

+
+

+ GNU C++ version 5.1.0
linux
long double +

+
+

+ Sun compiler version 0x5130
Sun Solaris
long double +

+
+

+ Bessel K'0: Mathworld Data +

+
+

+ Max = 1ε (Mean = 0.573ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 1.8ε (Mean = 1.02ε) +

+
+

+ Max = 1.8ε (Mean = 1.02ε) +

+
+

+ Bessel K'1: Mathworld Data +

+
+

+ Max = 1.09ε (Mean = 0.607ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 1.96ε (Mean = 1ε) +

+
+

+ Max = 1.96ε (Mean = 1.04ε) +

+
+

+ Bessel K'n: Mathworld Data +

+
+

+ Max = 4.17ε (Mean = 1.74ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 4.47ε (Mean = 2.05ε) +

+
+

+ Max = 4.47ε (Mean = 1.93ε) +

+
+

+ Bessel K'v: Mathworld Data +

+
+

+ Max = 3.94ε (Mean = 1.43ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 3.94ε (Mean = 2.49ε) +

+
+

+ Max = 3.94ε (Mean = 2.35ε) +

+
+

+ Bessel K'v: Mathworld Data (large values) +

+
+

+ Max = 18.6ε (Mean = 12.1ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 59.2ε (Mean = 42.9ε) +

+
+

+ Max = 59.8ε (Mean = 43.4ε) +

+
+

+ Bessel K'n: Random Data +

+
+

+ Max = 8.18ε (Mean = 1.45ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 4.53ε (Mean = 1.12ε) +

+
+

+ Max = 4.45ε (Mean = 1.23ε) +

+
+

+ Bessel K'v: Random Data +

+
+

+ Max = 8.32ε (Mean = 1.65ε) +

+
+

+ Max = 0ε (Mean = 0ε) +

+
+

+ Max = 7.95ε (Mean = 1.53ε) +

+
+

+ Max = 7.95ε (Mean = 1.55ε) +

+
+
+
+

Table 6.56. Error rates for sph_bessel_prime

+
+++++++ + + + + + + + + + + + + + + +
+ +

+ Microsoft Visual C++ version 12.0
Win32
double +

+
+

+ GNU C++ version 5.1.0
linux
double +

+
+

+ GNU C++ version 5.1.0
linux
long double +

+
+

+ Sun compiler version 0x5130
Sun Solaris
long double +

+
+

+ Bessel j': Random Data +

+
+

+ Max = 307ε (Mean = 25.2ε) +

+
+

+ Max = 0.753ε (Mean = 0.0343ε) +

+
+

+ Max = 167ε (Mean = 12ε) +

+
+

+ Max = 167ε (Mean = 33.2ε) +

+
+
+
+

Table 6.57. Error rates for sph_neumann_prime

+
+++++++ + + + + + + + + + + + + + + +
+ +

+ Microsoft Visual C++ version 12.0
Win32
double +

+
+

+ GNU C++ version 5.1.0
linux
double +

+
+

+ GNU C++ version 5.1.0
linux
long double +

+
+

+ Sun compiler version 0x5130
Sun Solaris
long double +

+
+

+ y': Random Data +

+
+

+ Max = 296ε (Mean = 25.6ε) +

+
+

+ Max = 0.752ε (Mean = 0.062ε) +

+
+

+ Max = 158ε (Mean = 18.8ε) +

+
+

+ Max = 158ε (Mean = 20.2ε) +

+
+
+
+ + Implementation +
+

+ In the general case, the derivatives are calculated using the relations: +

+

+ +

+

+ There are also a number of special cases, for large x we have: +

+

+ +

+

+ And for small x: +

+

+ +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/boost/libs/math/doc/html/math_toolkit/bessel/bessel_first.html b/boost/libs/math/doc/html/math_toolkit/bessel/bessel_first.html new file mode 100644 index 00000000..781959a2 --- /dev/null +++ b/boost/libs/math/doc/html/math_toolkit/bessel/bessel_first.html @@ -0,0 +1,1387 @@ + + + +Bessel Functions of the First and Second Kinds + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Synopsis +
+

+ #include <boost/math/special_functions/bessel.hpp> +

+
template <class T1, class T2>
+calculated-result-type cyl_bessel_j(T1 v, T2 x);
+
+template <class T1, class T2, class Policy>
+calculated-result-type cyl_bessel_j(T1 v, T2 x, const Policy&);
+
+template <class T1, class T2>
+calculated-result-type cyl_neumann(T1 v, T2 x);
+
+template <class T1, class T2, class Policy>
+calculated-result-type cyl_neumann(T1 v, T2 x, const Policy&);
+
+
+ + Description +
+

+ The functions cyl_bessel_j + and cyl_neumann return + the result of the Bessel functions of the first and second kinds respectively: +

+

+ cyl_bessel_j(v, x) = Jv(x) +

+

+ cyl_neumann(v, x) = Yv(x) = Nv(x) +

+

+ where: +

+

+ +

+

+ +

+

+ The return type of these functions is computed using the result + type calculation rules when T1 and T2 are different types. + The functions are also optimised for the relatively common case that T1 is + an integer. +

+

+ The final Policy argument is optional and can + be used to control the behaviour of the function: how it handles errors, + what level of precision to use etc. Refer to the policy + documentation for more details. +

+

+ The functions return the result of domain_error + whenever the result is undefined or complex. For cyl_bessel_j + this occurs when x < + 0 and v is not an integer, or when + x == + 0 and v + != 0. + For cyl_neumann this + occurs when x <= + 0. +

+

+ The following graph illustrates the cyclic nature of Jv: +

+

+ +

+

+ The following graph shows the behaviour of Yv: this is also cyclic for large + x, but tends to -∞   for small x: +

+

+ +

+
+ + Testing +
+

+ There are two sets of test values: spot values calculated using functions.wolfram.com, + and a much larger set of tests computed using a simplified version of this + implementation (with all the special case handling removed). +

+
+ + Accuracy +
+

+ The following tables show how the accuracy of these functions varies on various + platforms, along with comparisons to other libraries. Note that the cyclic + nature of these functions means that they have an infinite number of irrational + roots: in general these functions have arbitrarily large relative + errors when the arguments are sufficiently close to a root. Of course the + absolute error in such cases is always small. Note that only results for + the widest floating-point type on the system are given as narrower types + have effectively zero + error. All values are relative errors in units of epsilon. Most of + the gross errors exhibited by other libraries occur for very large arguments + - you will need to drill down into the actual program output if you need + more information on this. +

+
+

Table 6.40. Error rates for cyl_bessel_j (integer orders)

+
+++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

+ Microsoft Visual C++ version 12.0
Win32
double +

+
+

+ GNU C++ version 5.1.0
linux
long double +

+
+

+ GNU C++ version 5.1.0
linux
double +

+
+

+ Sun compiler version 0x5130
Sun Solaris
long double +

+
+

+ Bessel J0: Mathworld Data (Integer Version) +

+
+

+ Max = 2.52ε (Mean = 1.2ε)

+ (<math.h>: Max = 1.89ε (Mean = 0.988ε)) +

+
+

+ Max = 6.55ε (Mean = 2.89ε)

+ (<tr1/cmath>: Max = 5.04ε (Mean = 1.78ε) + And + other failures.) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 1.12ε (Mean = 0.488ε))
(Rmath + 3.0.2: Max = +INFε (Mean = +INFε) And + other failures.)
(Cephes: + Max = 1.12ε (Mean = 0.568ε)) +

+
+

+ Max = 6.55ε (Mean = 2.86ε) +

+
+

+ Bessel J0: Mathworld Data (Tricky cases) (Integer Version) +

+
+

+ Max = 1e+007ε (Mean = 4.09e+006ε)
+
(<math.h>: Max + = 2.54e+008ε (Mean = 1.04e+008ε)) +

+
+

+ Max = 1.63e+08ε (Mean = 6.67e+07ε)
+
(<tr1/cmath>: Max = 4.79e+08ε (Mean + = 1.96e+08ε)) +

+
+

+ Max = 7.98e+04ε (Mean = 3.26e+04ε)
+
(GSL 1.16: Max = 1e+07ε (Mean = 4.11e+06ε))
+ (Rmath 3.0.2: Max = 1.04e+07ε (Mean = 4.29e+06ε))
+ (Cephes: Max = 2.54e+08ε (Mean + = 1.04e+08ε)) +

+
+

+ Max = 1.64e+08ε (Mean = 6.69e+07ε) +

+
+

+ Bessel J1: Mathworld Data (Integer Version) +

+
+

+ Max = 1.73ε (Mean = 0.976ε)

+ (<math.h>: Max = 11.4ε (Mean = 4.15ε)) +

+
+

+ Max = 2.66ε (Mean = 1.38ε)

+ (<tr1/cmath>: Max = 6.1ε (Mean = 2.95ε) + And + other failures.) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 1.89ε (Mean = 0.721ε))
(Rmath + 3.0.2: Max = +INFε (Mean = +INFε) And + other failures.)
(Cephes: + Max = 2.88ε (Mean = 1.12ε)) +

+
+

+ Max = 1.44ε (Mean = 0.637ε) +

+
+

+ Bessel J1: Mathworld Data (tricky cases) (Integer Version) +

+
+

+ Max = 3.23e+004ε (Mean = 1.45e+004ε)
+
(<math.h>: Max = 1.44e+007ε (Mean + = 6.5e+006ε)) +

+
+

+ Max = 2.18e+05ε (Mean = 9.76e+04ε)
+
(<tr1/cmath>: Max = 2.15e+06ε (Mean + = 1.58e+06ε)) +

+
+

+ Max = 106ε (Mean = 47.5ε)

+ (GSL 1.16: Max = 1.26e+06ε (Mean = 6.28e+05ε))
+ (Rmath 3.0.2: Max = 2.93e+06ε (Mean = 1.7e+06ε))
+ (Cephes: Max = 9.56e+05ε (Mean = 4.99e+05ε)) +

+
+

+ Max = 2.18e+05ε (Mean = 9.76e+04ε) +

+
+

+ Bessel JN: Mathworld Data (Integer Version) +

+
+

+ Max = 14.7ε (Mean = 5.4ε)

+ (<math.h>: Max = + +INFε (Mean = +INFε) And + other failures.) +

+
+

+ Max = 6.85ε (Mean = 3.41ε)

+ (<tr1/cmath>: Max + = 2.13e+19ε (Mean = 5.16e+18ε) And + other failures.) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 6.9e+05ε (Mean = 2.53e+05ε) And + other failures.)
(Rmath 3.0.2: + Max = +INFε (Mean = +INFε) And + other failures.)
(Cephes: + Max = +INFε (Mean = +INFε) And + other failures.) +

+
+

+ Max = 463ε (Mean = 112ε) +

+
+
+
+

Table 6.41. Error rates for cyl_bessel_j

+
+++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

+ Microsoft Visual C++ version 12.0
Win32
double +

+
+

+ GNU C++ version 5.1.0
linux
long double +

+
+

+ GNU C++ version 5.1.0
linux
double +

+
+

+ Sun compiler version 0x5130
Sun Solaris
long double +

+
+

+ Bessel J0: Mathworld Data +

+
+

+ Max = 2.52ε (Mean = 1.2ε) +

+
+

+ Max = 6.55ε (Mean = 2.89ε)

+ (<tr1/cmath>: Max = 5.04ε (Mean = 1.78ε) + And + other failures.) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 0.629ε (Mean = 0.223ε) And + other failures.)
(Rmath 3.0.2: + Max = +INFε (Mean = +INFε) And + other failures.)
(Cephes: + Max = 1.12ε (Mean = 0.568ε)) +

+
+

+ Max = 6.55ε (Mean = 2.86ε) +

+
+

+ Bessel J0: Mathworld Data (Tricky cases) +

+
+

+ Max = 1e+007ε (Mean = 4.09e+006ε) +

+
+

+ Max = 1.63e+08ε (Mean = 6.67e+07ε)
+
(<tr1/cmath>: Max = 4.79e+08ε (Mean + = 1.96e+08ε)) +

+
+

+ Max = 7.98e+04ε (Mean = 3.26e+04ε)
+
(GSL 1.16: Max = 6.5e+07ε (Mean = 2.66e+07ε))
+ (Rmath 3.0.2: Max = 1.04e+07ε (Mean = 4.29e+06ε))
+ (Cephes: Max = 2.54e+08ε (Mean + = 1.04e+08ε)) +

+
+

+ Max = 1.64e+08ε (Mean = 6.69e+07ε) +

+
+

+ Bessel J1: Mathworld Data +

+
+

+ Max = 1.73ε (Mean = 0.976ε) +

+
+

+ Max = 2.66ε (Mean = 1.38ε)

+ (<tr1/cmath>: Max = 6.1ε (Mean = 2.95ε) + And + other failures.) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 6.62ε (Mean = 2.35ε) And + other failures.)
(Rmath 3.0.2: + Max = +INFε (Mean = +INFε) And + other failures.)
(Cephes: + Max = 2.88ε (Mean = 1.12ε)) +

+
+

+ Max = 1.44ε (Mean = 0.637ε) +

+
+

+ Bessel J1: Mathworld Data (tricky cases) +

+
+

+ Max = 3.23e+004ε (Mean = 1.45e+004ε) +

+
+

+ Max = 2.18e+05ε (Mean = 9.76e+04ε)
+
(<tr1/cmath>: Max = 2.15e+06ε (Mean + = 1.58e+06ε)) +

+
+

+ Max = 106ε (Mean = 47.5ε)

+ (GSL 1.16: Max = 8.75e+05ε (Mean = 5.32e+05ε))
+ (Rmath 3.0.2: Max = 2.93e+06ε (Mean = 1.7e+06ε))
+ (Cephes: Max = 9.56e+05ε (Mean = 4.99e+05ε)) +

+
+

+ Max = 2.18e+05ε (Mean = 9.76e+04ε) +

+
+

+ Bessel JN: Mathworld Data +

+
+

+ Max = 14.7ε (Mean = 5.4ε) +

+
+

+ Max = 6.85ε (Mean = 3.41ε)

+ (<tr1/cmath>: Max + = 2.13e+19ε (Mean = 5.16e+18ε) And + other failures.) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 6.9e+05ε (Mean = 2.15e+05ε) And + other failures.)
(Rmath 3.0.2: + Max = +INFε (Mean = +INFε) And + other failures.)
(Cephes: + Max = 5.53e+05ε (Mean = 1.9e+05ε)) +

+
+

+ Max = 463ε (Mean = 112ε) +

+
+

+ Bessel J: Mathworld Data +

+
+

+ Max = 14.9ε (Mean = 3.82ε) +

+
+

+ Max = 14.7ε (Mean = 4.05ε)

+ (<tr1/cmath>: Max = 3.49e+05ε (Mean = + 7.89e+04ε) And + other failures.) +

+
+

+ Max = 10ε (Mean = 2.19ε)

+ (GSL 1.16: Max = 2.39e+05ε (Mean = 5.24e+04ε) + And + other failures.)
(Rmath 3.0.2: + Max = +INFε (Mean = +INFε) And + other failures.)
(Cephes: + Max = 5.47e+05ε (Mean = 1.3e+05ε)) +

+
+

+ Max = 14.7ε (Mean = 4.12ε) +

+
+

+ Bessel J: Mathworld Data (large values) +

+
+

+ Max = 9.31ε (Mean = 5.52ε) +

+
+

+ Max = 607ε (Mean = 305ε)

+ (<tr1/cmath>: Max = 34.9ε (Mean = 17.4ε) + And + other failures.) +

+
+

+ Max = 0.536ε (Mean = 0.268ε)

+ (GSL 1.16: Max = 4.91e+03ε (Mean = 2.46e+03ε) + And + other failures.)
(Rmath 3.0.2: + Max = 35.9ε (Mean = 18.1ε))
(Cephes: Max = +INFε (Mean = +INFε) And + other failures.) +

+
+

+ Max = 607ε (Mean = 305ε) +

+
+

+ Bessel JN: Random Data +

+
+

+ Max = 17.5ε (Mean = 1.46ε) +

+
+

+ Max = 50.8ε (Mean = 4.15ε)

+ (<tr1/cmath>: Max = 1.12e+03ε (Mean = + 88.7ε)) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 75.7ε (Mean = 5.36ε))
(Rmath + 3.0.2: Max = 3.93ε (Mean = 1.22ε))
(Cephes: + Max = 91.4ε (Mean = 6.47ε)) +

+
+

+ Max = 99.6ε (Mean = 22ε) +

+
+

+ Bessel J: Random Data +

+
+

+ Max = 9.24ε (Mean = 1.36ε) +

+
+

+ Max = 9.81ε (Mean = 1.59ε)

+ (<tr1/cmath>: Max = 501ε (Mean = 52.3ε)) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 15.5ε (Mean = 3.33ε) And + other failures.)
(Rmath 3.0.2: + Max = 6.74ε (Mean = 1.3ε))
(Cephes: Max + = 16.7ε (Mean = 2.5ε)) +

+
+

+ Max = 260ε (Mean = 34ε) +

+
+

+ Bessel J: Random Data (Tricky large values) +

+
+

+ Max = 59.2ε (Mean = 8.67ε) +

+
+

+ Max = 785ε (Mean = 94.2ε)

+ (<tr1/cmath>: Max + = 5.01e+17ε (Mean = 6.23e+16ε)) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 2.48e+05ε (Mean = 5.11e+04ε))
(Rmath + 3.0.2: Max = 71.6ε (Mean = 11.7ε))
(Cephes: + Max = 2.48e+05ε (Mean = 3.02e+04ε)) +

+
+

+ Max = 785ε (Mean = 97.4ε) +

+
+
+
+

Table 6.42. Error rates for cyl_neumann (integer orders)

+
+++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

+ Microsoft Visual C++ version 12.0
Win32
double +

+
+

+ GNU C++ version 5.1.0
linux
double +

+
+

+ GNU C++ version 5.1.0
linux
long double +

+
+

+ Sun compiler version 0x5130
Sun Solaris
long double +

+
+

+ Y0: Mathworld Data (Integer Version) +

+
+

+ Max = 4.61ε (Mean = 2.29ε)

+ (<math.h>: Max = 5.37e+003ε (Mean = 1.81e+003ε)) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 6.46ε (Mean = 2.38ε))
(Rmath + 3.0.2: Max = 167ε (Mean = 56.5ε))
(Cephes: + Max = 5.37e+03ε (Mean = 1.81e+03ε)) +

+
+

+ Max = 5.59ε (Mean = 2.54ε)

+ (<tr1/cmath>: Max = 2.05e+05ε (Mean = + 6.87e+04ε)) +

+
+

+ Max = 5.53ε (Mean = 2.4ε) +

+
+

+ Y1: Mathworld Data (Integer Version) +

+
+

+ Max = 4.75ε (Mean = 1.72ε)

+ (<math.h>: Max = 1.86e+004ε (Mean = 6.2e+003ε)) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 1.51ε (Mean = 0.839ε))
(Rmath + 3.0.2: Max = 193ε (Mean = 64.4ε))
(Cephes: + Max = 1.86e+04ε (Mean = 6.2e+03ε)) +

+
+

+ Max = 12.7ε (Mean = 4.34ε)

+ (<tr1/cmath>: Max = 9.71e+03ε (Mean = + 4.08e+03ε)) +

+
+

+ Max = 6.33ε (Mean = 2.29ε) +

+
+

+ Yn: Mathworld Data (Integer Version) +

+
+

+ Max = 35ε (Mean = 11.8ε)

+ (<math.h>: Max = 2.49e+005ε (Mean = 8.14e+004ε)) +

+
+

+ Max = 0.993ε (Mean = 0.314ε)

+ (GSL 1.16: Max = 2.41e+05ε (Mean = 7.62e+04ε))
+ (Rmath 3.0.2: Max = 1.24e+04ε (Mean = 4e+03ε))
+ (Cephes: Max = 2.49e+05ε (Mean = 8.14e+04ε)) +

+
+

+ Max = 55.2ε (Mean = 17.7ε)

+ (<tr1/cmath>: Max + = 2.2e+20ε (Mean = 6.97e+19ε) And + other failures.) +

+
+

+ Max = 55.2ε (Mean = 17.8ε) +

+
+
+
+

Table 6.43. Error rates for cyl_neumann

+
+++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

+ Microsoft Visual C++ version 12.0
Win32
double +

+
+

+ GNU C++ version 5.1.0
linux
double +

+
+

+ GNU C++ version 5.1.0
linux
long double +

+
+

+ Sun compiler version 0x5130
Sun Solaris
long double +

+
+

+ Y0: Mathworld Data +

+
+

+ Max = 4.61ε (Mean = 2.29ε) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 60.9ε (Mean = 20.4ε))
(Rmath + 3.0.2: Max = 167ε (Mean = 56.5ε)) +

+
+

+ Max = 5.59ε (Mean = 2.54ε)

+ (<tr1/cmath>: Max = 2.05e+05ε (Mean = + 6.87e+04ε)) +

+
+

+ Max = 5.53ε (Mean = 2.4ε) +

+
+

+ Y1: Mathworld Data +

+
+

+ Max = 4.75ε (Mean = 1.72ε) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 23.4ε (Mean = 8.1ε))
(Rmath + 3.0.2: Max = 193ε (Mean = 64.4ε)) +

+
+

+ Max = 12.7ε (Mean = 4.34ε)

+ (<tr1/cmath>: Max = 9.71e+03ε (Mean = + 4.08e+03ε)) +

+
+

+ Max = 6.33ε (Mean = 2.29ε) +

+
+

+ Yn: Mathworld Data +

+
+

+ Max = 35ε (Mean = 11.8ε) +

+
+

+ Max = 0.993ε (Mean = 0.314ε)

+ (GSL 1.16: Max = 2.41e+05ε (Mean = 7.62e+04ε) + And + other failures.)
(Rmath 3.0.2: + Max = 1.24e+04ε (Mean = 4e+03ε)) +

+
+

+ Max = 55.2ε (Mean = 17.7ε)

+ (<tr1/cmath>: Max + = 2.2e+20ε (Mean = 6.97e+19ε) And + other failures.) +

+
+

+ Max = 55.2ε (Mean = 17.8ε) +

+
+

+ Yv: Mathworld Data +

+
+

+ Max = 7.89ε (Mean = 3.27ε) +

+
+

+ Max = 10ε (Mean = 3.02ε)

+ (GSL 1.16: Max = 1.07e+05ε (Mean = 3.22e+04ε) + And + other failures.)
(Rmath 3.0.2: + Max = 1.05e+03ε (Mean = 326ε)) +

+
+

+ Max = 10.7ε (Mean = 4.92ε)

+ (<tr1/cmath>: Max + = 3.49e+15ε (Mean = 1.05e+15ε) And + other failures.) +

+
+

+ Max = 10.7ε (Mean = 5.1ε) +

+
+

+ Yv: Mathworld Data (large values) +

+
+

+ Max = 0.682ε (Mean = 0.35ε) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 60.8ε (Mean = 23ε) And + other failures.)
(Rmath 3.0.2: + Max = +INFε (Mean = +INFε) And + other failures.) +

+
+

+ Max = 1.57ε (Mean = 1.17ε)

+ (<tr1/cmath>: Max = 43.2ε (Mean = 16.3ε) + And + other failures.) +

+
+

+ Max = 1.57ε (Mean = 1.24ε) +

+
+

+ Y0 and Y1: Random Data +

+
+

+ Max = 4.17ε (Mean = 1.24ε) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 34.4ε (Mean = 8.9ε))
(Rmath + 3.0.2: Max = 83ε (Mean = 14.2ε)) +

+
+

+ Max = 11.8ε (Mean = 3.28ε)

+ (<tr1/cmath>: Max = 2.59e+03ε (Mean = + 500ε)) +

+
+

+ Max = 10.8ε (Mean = 3.04ε) +

+
+

+ Yn: Random Data +

+
+

+ Max = 117ε (Mean = 10.2ε) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 500ε (Mean = 47.8ε))
(Rmath + 3.0.2: Max = 691ε (Mean = 67.9ε)) +

+
+

+ Max = 338ε (Mean = 28.2ε)

+ (<tr1/cmath>: Max = 4.01e+03ε (Mean = + 348ε)) +

+
+

+ Max = 338ε (Mean = 27.5ε) +

+
+

+ Yv: Random Data +

+
+

+ Max = 1.23e+003ε (Mean = 69.9ε) +

+
+

+ Max = 1.53ε (Mean = 0.102ε)

+ (GSL 1.16: Max = 1.41e+06ε (Mean = 7.67e+04ε))
+ (Rmath 3.0.2: Max = 1.79e+05ε (Mean = 9.64e+03ε)) +

+
+

+ Max = 2.08e+03ε (Mean = 149ε)
+
(<tr1/cmath>: Max + = +INFε (Mean = +INFε) And + other failures.) +

+
+

+ Max = 2.08e+03ε (Mean = 149ε) +

+
+
+

+ Note that for large x these functions are largely dependent + on the accuracy of the std::sin and + std::cos functions. +

+

+ Comparison to GSL and Cephes + is interesting: both Cephes + and this library optimise the integer order case - leading to identical results + - simply using the general case is for the most part slightly more accurate + though, as noted by the better accuracy of GSL in the integer argument cases. + This implementation tends to perform much better when the arguments become + large, Cephes in particular + produces some remarkably inaccurate results with some of the test data (no + significant figures correct), and even GSL performs badly with some inputs + to Jv. Note that by way of double-checking these results, the worst performing + Cephes and GSL cases were + recomputed using functions.wolfram.com, + and the result checked against our test data: no errors in the test data + were found. +

+
+ + Implementation +
+

+ The implementation is mostly about filtering off various special cases: +

+

+ When x is negative, then the order v + must be an integer or the result is a domain error. If the order is an integer + then the function is odd for odd orders and even for even orders, so we reflect + to x > 0. +

+

+ When the order v is negative then the reflection formulae + can be used to move to v > 0: +

+

+ +

+

+ +

+

+ Note that if the order is an integer, then these formulae reduce to: +

+

+ J-n = (-1)nJn +

+

+ Y-n = (-1)nYn +

+

+ However, in general, a negative order implies that we will need to compute + both J and Y. +

+

+ When x is large compared to the order v + then the asymptotic expansions for large x in M. Abramowitz + and I.A. Stegun, Handbook of Mathematical Functions + 9.2.19 are used (these were found to be more reliable than those in A&S + 9.2.5). +

+

+ When the order v is an integer the method first relates + the result to J0, J1, Y0   and Y1   using either forwards or backwards recurrence + (Miller's algorithm) depending upon which is stable. The values for J0, J1, + Y0   and Y1   are calculated using the rational minimax approximations on root-bracketing + intervals for small |x| and Hankel asymptotic expansion + for large |x|. The coefficients are from: +

+

+ W.J. Cody, ALGORITHM 715: SPECFUN - A Portable FORTRAN Package + of Special Function Routines and Test Drivers, ACM Transactions + on Mathematical Software, vol 19, 22 (1993). +

+

+ and +

+

+ J.F. Hart et al, Computer Approximations, John Wiley + & Sons, New York, 1968. +

+

+ These approximations are accurate to around 19 decimal digits: therefore + these methods are not used when type T has more than 64 binary digits. +

+

+ When x is smaller than machine epsilon then the following + approximations for Y0(x), Y1(x), Y2(x) and Yn(x) can be used (see: http://functions.wolfram.com/03.03.06.0037.01, + http://functions.wolfram.com/03.03.06.0038.01, + http://functions.wolfram.com/03.03.06.0039.01 + and http://functions.wolfram.com/03.03.06.0040.01): +

+

+ +

+

+ +

+

+ +

+

+ +

+

+ When x is small compared to v and + v is not an integer, then the following series approximation + can be used for Yv(x), this is also an area where other approximations are + often too slow to converge to be used (see http://functions.wolfram.com/03.03.06.0034.01): +

+

+ +

+

+ When x is small compared to v, + Jvx   is best computed directly from the series: +

+

+ +

+

+ In the general case we compute Jv   and Yv   simultaneously. +

+

+ To get the initial values, let μ   = ν - floor(ν + 1/2), then μ   is the fractional part + of ν   such that |μ| <= 1/2 (we need this for convergence later). The idea + is to calculate Jμ(x), Jμ+1(x), Yμ(x), Yμ+1(x) and use them to obtain Jν(x), Yν(x). +

+

+ The algorithm is called Steed's method, which needs two continued fractions + as well as the Wronskian: +

+

+ +

+

+ +

+

+ +

+

+ See: F.S. Acton, Numerical Methods that Work, The Mathematical + Association of America, Washington, 1997. +

+

+ The continued fractions are computed using the modified Lentz's method (W.J. + Lentz, Generating Bessel functions in Mie scattering calculations + using continued fractions, Applied Optics, vol 15, 668 (1976)). + Their convergence rates depend on x, therefore we need + different strategies for large x and small x. +

+

+ x > v, CF1 needs O(x) iterations + to converge, CF2 converges rapidly +

+

+ x <= v, CF1 converges rapidly, CF2 fails to converge + when x -> 0 +

+

+ When x is large (x > 2), both + continued fractions converge (CF1 may be slow for really large x). + Jμ, Jμ+1, Yμ, Yμ+1 can be calculated by +

+

+ +

+

+ where +

+

+ +

+

+ Jν and Yμ are then calculated using backward (Miller's algorithm) and forward + recurrence respectively. +

+

+ When x is small (x <= 2), CF2 + convergence may fail (but CF1 works very well). The solution here is Temme's + series: +

+

+ +

+

+ where +

+

+ +

+

+ gk   and hk   +are also computed by recursions (involving gamma functions), but + the formulas are a little complicated, readers are refered to N.M. Temme, + On the numerical evaluation of the ordinary Bessel function of + the second kind, Journal of Computational Physics, vol 21, 343 + (1976). Note Temme's series converge only for |μ| <= 1/2. +

+

+ As the previous case, Yν   is calculated from the forward recurrence, so is Yν+1. + With these two values and fν, the Wronskian yields Jν(x) directly without backward + recurrence. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/boost/libs/math/doc/html/math_toolkit/bessel/bessel_over.html b/boost/libs/math/doc/html/math_toolkit/bessel/bessel_over.html new file mode 100644 index 00000000..3a09b652 --- /dev/null +++ b/boost/libs/math/doc/html/math_toolkit/bessel/bessel_over.html @@ -0,0 +1,212 @@ + + + +Bessel Function Overview + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Ordinary + Bessel Functions +
+

+ Bessel Functions are solutions to Bessel's ordinary differential equation: +

+

+ +

+

+ where ν   is the order of the equation, and may be an arbitrary + real or complex number, although integer orders are the most common occurrence. +

+

+ This library supports either integer or real orders. +

+

+ Since this is a second order differential equation, there must be two linearly + independent solutions, the first of these is denoted Jv   +and known as a Bessel + function of the first kind: +

+

+ +

+

+ This function is implemented in this library as cyl_bessel_j. +

+

+ The second solution is denoted either Yv   or Nv   +and is known as either a Bessel + Function of the second kind, or as a Neumann function: +

+

+ +

+

+ This function is implemented in this library as cyl_neumann. +

+

+ The Bessel functions satisfy the recurrence relations: +

+

+ +

+

+ +

+

+ Have the derivatives: +

+

+ +

+

+ +

+

+ Have the Wronskian relation: +

+

+ +

+

+ and the reflection formulae: +

+

+ +

+

+ +

+
+ + Modified + Bessel Functions +
+

+ The Bessel functions are valid for complex argument x, + and an important special case is the situation where x + is purely imaginary: giving a real valued result. In this case the functions + are the two linearly independent solutions to the modified Bessel equation: +

+

+ +

+

+ The solutions are known as the modified Bessel functions of the first and + second kind (or occasionally as the hyperbolic Bessel functions of the first + and second kind). They are denoted Iv   and Kv   +respectively: +

+

+ +

+

+ +

+

+ These functions are implemented in this library as cyl_bessel_i + and cyl_bessel_k respectively. +

+

+ The modified Bessel functions satisfy the recurrence relations: +

+

+ +

+

+ +

+

+ Have the derivatives: +

+

+ +

+

+ +

+

+ Have the Wronskian relation: +

+

+ +

+

+ and the reflection formulae: +

+

+ +

+

+ +

+
+ + Spherical + Bessel Functions +
+

+ When solving the Helmholtz equation in spherical coordinates by separation + of variables, the radial equation has the form: +

+

+ +

+

+ The two linearly independent solutions to this equation are called the spherical + Bessel functions jn   and yn  , and are related to the ordinary Bessel functions + Jn   and Yn   by: +

+

+ +

+

+ The spherical Bessel function of the second kind yn   +is also known as the spherical + Neumann function nn. +

+

+ These functions are implemented in this library as sph_bessel + and sph_neumann. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/boost/libs/math/doc/html/math_toolkit/bessel/bessel_root.html b/boost/libs/math/doc/html/math_toolkit/bessel/bessel_root.html new file mode 100644 index 00000000..8395a715 --- /dev/null +++ b/boost/libs/math/doc/html/math_toolkit/bessel/bessel_root.html @@ -0,0 +1,764 @@ + + + +Finding Zeros of Bessel Functions of the First and Second Kinds + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Synopsis +
+

+ #include <boost/math/special_functions/bessel.hpp> +

+

+ Functions for obtaining both a single zero or root of the Bessel function, + and placing multiple zeros into a container like std::vector + by providing an output iterator. +

+

+ The signature of the single value functions are: +

+
template <class T>
+T cyl_bessel_j_zero(
+         T v,            // Floating-point value for Jv.
+         int m);         // 1-based index of zero.
+
+template <class T>
+T cyl_neumann_zero(
+         T v,            // Floating-point value for Jv.
+         int m);         // 1-based index of zero.
+
+

+ and for multiple zeros: +

+
template <class T, class OutputIterator>
+OutputIterator cyl_bessel_j_zero(
+                     T v,                       // Floating-point value for Jv.
+                     int start_index,           // 1-based index of first zero.
+                     unsigned number_of_zeros,  // How many zeros to generate.
+                     OutputIterator out_it);    // Destination for zeros.
+
+template <class T, class OutputIterator>
+OutputIterator cyl_neumann_zero(
+                     T v,                       // Floating-point value for Jv.
+                     int start_index,           // 1-based index of zero.
+                     unsigned number_of_zeros,  // How many zeros to generate
+                     OutputIterator out_it);    // Destination for zeros.
+
+

+ There are also versions which allow control of the Policies + for error handling and precision. +

+
 template <class T>
+ T cyl_bessel_j_zero(
+          T v,            // Floating-point value for Jv.
+          int m,          // 1-based index of zero.
+          const Policy&); // Policy to use.
+
+ template <class T>
+ T cyl_neumann_zero(
+          T v,            // Floating-point value for Jv.
+          int m,          // 1-based index of zero.
+          const Policy&); // Policy to use.
+
+
+template <class T, class OutputIterator>
+OutputIterator cyl_bessel_j_zero(
+                     T v,                       // Floating-point value for Jv.
+                     int start_index,           // 1-based index of first zero.
+                     unsigned number_of_zeros,  // How many zeros to generate.
+                     OutputIterator out_it,     // Destination for zeros.
+                     const Policy& pol);        // Policy to use.
+
+template <class T, class OutputIterator>
+OutputIterator cyl_neumann_zero(
+                     T v,                       // Floating-point value for Jv.
+                     int start_index,           // 1-based index of zero.
+                     unsigned number_of_zeros,  // How many zeros to generate.
+                     OutputIterator out_it,     // Destination for zeros.
+                     const Policy& pol);        // Policy to use.
+
+
+ + Description +
+

+ Every real order ν cylindrical Bessel and Neumann functions have an infinite + number of zeros on the positive real axis. The real zeros on the positive + real axis can be found by solving for the roots of +

+

+   Jν(jν, m) = 0 +

+

+   Yν(yν, m) = 0 +

+

+ Here, jν, m represents the mth root + of the cylindrical Bessel function of order ν, and yν, + m represents the mth root of the cylindrical + Neumann function of order ν. +

+

+ The zeros or roots (values of x + where the function crosses the horizontal y + = 0 + axis) of the Bessel and Neumann functions are computed by two functions, + cyl_bessel_j_zero and cyl_neumann_zero. +

+

+ In each case the index or rank of the zero returned is 1-based, which is + to say: +

+
cyl_bessel_j_zero(v, 1);
+
+

+ returns the first zero of Bessel J. +

+

+ Passing an start_index <= + 0 results in a std::domain_error + being raised. +

+

+ For certain parameters, however, the zero'th root is defined and it has a + value of zero. For example, the zero'th root of J[sub v](x) + is defined and it has a value of zero for all values of v + > 0 + and for negative integer values of v + = -n. Similar cases are described in the implementation + details below. +

+

+ The order v of J can be positive, negative and zero for + the cyl_bessel_j and cyl_neumann functions, but not infinite + nor NaN. +

+

+ +

+

+ +

+
+ + Examples + of finding Bessel and Neumann zeros +
+

+ This example demonstrates calculating zeros of the Bessel and Neumann functions. + It also shows how Boost.Math and Boost.Multiprecision can be combined to + provide a many decimal digit precision. For 50 decimal digit precision we + need to include +

+
#include <boost/multiprecision/cpp_dec_float.hpp>
+
+

+ and a typedef for float_type may be convenient (allowing + a quick switch to re-compute at built-in double + or other precision) +

+
typedef boost::multiprecision::cpp_dec_float_50 float_type;
+
+

+ To use the functions for finding zeros of the functions we need +

+
#include <boost/math/special_functions/bessel.hpp>
+
+

+ This file includes the forward declaration signatures for the zero-finding + functions: +

+
//  #include <boost/math/special_functions/math_fwd.hpp>
+
+

+ but more details are in the full documentation, for example at Boost.Math + Bessel functions. +

+

+ This example shows obtaining both a single zero of the Bessel function, and + then placing multiple zeros into a container like std::vector + by providing an iterator. +

+
+ + + + + +
[Tip]Tip

+ It is always wise to place code using Boost.Math inside try'n'catch blocks; + this will ensure that helpful error messages are shown when exceptional + conditions arise. +

+

+ First, evaluate a single Bessel zero. +

+

+ The precision is controlled by the float-point type of template parameter + T of v + so this example has double precision, + at least 15 but up to 17 decimal digits (for the common 64-bit double). +

+
//    double root = boost::math::cyl_bessel_j_zero(0.0, 1);
+//    // Displaying with default precision of 6 decimal digits:
+//    std::cout << "boost::math::cyl_bessel_j_zero(0.0, 1) " << root << std::endl; // 2.40483
+//    // And with all the guaranteed (15) digits:
+//    std::cout.precision(std::numeric_limits<double>::digits10);
+//    std::cout << "boost::math::cyl_bessel_j_zero(0.0, 1) " << root << std::endl; // 2.40482555769577
+
+

+ But note that because the parameter v + controls the precision of the result, v + must be a floating-point type. So if you + provide an integer type, say 0, rather than 0.0, then it will fail to compile + thus: +

+
root = boost::math::cyl_bessel_j_zero(0, 1);
+
+

+ with this error message +

+
error C2338: Order must be a floating-point type.
+
+

+ Optionally, we can use a policy to ignore errors, C-style, returning some + value, perhaps infinity or NaN, or the best that can be done. (See user error handling). +

+

+ To create a (possibly unwise!) policy ignore_all_policy + that ignores all errors: +

+
typedef boost::math::policies::policy<
+  boost::math::policies::domain_error<boost::math::policies::ignore_error>,
+  boost::math::policies::overflow_error<boost::math::policies::ignore_error>,
+  boost::math::policies::underflow_error<boost::math::policies::ignore_error>,
+  boost::math::policies::denorm_error<boost::math::policies::ignore_error>,
+  boost::math::policies::pole_error<boost::math::policies::ignore_error>,
+  boost::math::policies::evaluation_error<boost::math::policies::ignore_error>
+            > ignore_all_policy;
+
+

+ Examples of use of this ignore_all_policy + are +

+
double inf = std::numeric_limits<double>::infinity();
+double nan = std::numeric_limits<double>::quiet_NaN();
+
+double dodgy_root = boost::math::cyl_bessel_j_zero(-1.0, 1, ignore_all_policy());
+std::cout << "boost::math::cyl_bessel_j_zero(-1.0, 1) " << dodgy_root << std::endl; // 1.#QNAN
+double inf_root = boost::math::cyl_bessel_j_zero(inf, 1, ignore_all_policy());
+std::cout << "boost::math::cyl_bessel_j_zero(inf, 1) " << inf_root << std::endl; // 1.#QNAN
+double nan_root = boost::math::cyl_bessel_j_zero(nan, 1, ignore_all_policy());
+std::cout << "boost::math::cyl_bessel_j_zero(nan, 1) " << nan_root << std::endl; // 1.#QNAN
+
+

+ Another version of cyl_bessel_j_zero + allows calculation of multiple zeros with one call, placing the results in + a container, often std::vector. For example, generate and display + the first five double roots + of Jv for integral order 2, as column J2(x) in table + 1 of Wolfram + Bessel Function Zeros. +

+
unsigned int n_roots = 5U;
+std::vector<double> roots;
+boost::math::cyl_bessel_j_zero(2.0, 1, n_roots, std::back_inserter(roots));
+std::copy(roots.begin(),
+          roots.end(),
+          std::ostream_iterator<double>(std::cout, "\n"));
+
+

+ Or we can use Boost.Multiprecision to generate 50 decimal digit roots of + Jv for non-integral order v= 71/19 == 3.736842, + expressed as an exact-integer fraction to generate the most accurate value + possible for all floating-point types. +

+

+ We set the precision of the output stream, and show trailing zeros to display + a fixed 50 decimal digits. +

+
std::cout.precision(std::numeric_limits<float_type>::digits10); // 50 decimal digits.
+std::cout << std::showpoint << std::endl; // Show trailing zeros.
+
+float_type x = float_type(71) / 19;
+float_type r = boost::math::cyl_bessel_j_zero(x, 1); // 1st root.
+std::cout << "x = " << x << ", r = " << r << std::endl;
+
+r = boost::math::cyl_bessel_j_zero(x, 20U); // 20th root.
+std::cout << "x = " << x << ", r = " << r << std::endl;
+
+std::vector<float_type> zeros;
+boost::math::cyl_bessel_j_zero(x, 1, 3, std::back_inserter(zeros));
+
+std::cout << "cyl_bessel_j_zeros" << std::endl;
+// Print the roots to the output stream.
+std::copy(zeros.begin(), zeros.end(),
+          std::ostream_iterator<float_type>(std::cout, "\n"));
+
+
+ + Using + Output Iterator to sum zeros of Bessel Functions +
+

+ This example demonstrates summing zeros of the Bessel functions. To use the + functions for finding zeros of the functions we need +

+
#include <boost/math/special_functions/bessel.hpp>
+
+

+ We use the cyl_bessel_j_zero + output iterator parameter out_it + to create a sum of 1/zeros2 by defining a custom output + iterator: +

+
template <class T>
+struct output_summation_iterator
+{
+   output_summation_iterator(T* p) : p_sum(p)
+   {}
+   output_summation_iterator& operator*()
+   { return *this; }
+    output_summation_iterator& operator++()
+   { return *this; }
+   output_summation_iterator& operator++(int)
+   { return *this; }
+   output_summation_iterator& operator = (T const& val)
+   {
+     *p_sum += 1./ (val * val); // Summing 1/zero^2.
+     return *this;
+   }
+private:
+   T* p_sum;
+};
+
+

+ The sum is calculated for many values, converging on the analytical exact + value of 1/8. +

+
using boost::math::cyl_bessel_j_zero;
+double nu = 1.;
+double sum = 0;
+output_summation_iterator<double> it(&sum);  // sum of 1/zeros^2
+cyl_bessel_j_zero(nu, 1, 10000, it);
+
+double s = 1/(4 * (nu + 1)); // 0.125 = 1/8 is exact analytical solution.
+std::cout << std::setprecision(6) << "nu = " << nu << ", sum = " << sum
+  << ", exact = " << s << std::endl;
+// nu = 1.00000, sum = 0.124990, exact = 0.125000
+
+
+ + Calculating + zeros of the Neumann function. +
+

+ This example also shows how Boost.Math and Boost.Multiprecision can be combined + to provide a many decimal digit precision. For 50 decimal digit precision + we need to include +

+
#include <boost/multiprecision/cpp_dec_float.hpp>
+
+

+ and a typedef for float_type may be convenient (allowing + a quick switch to re-compute at built-in double + or other precision) +

+
typedef boost::multiprecision::cpp_dec_float_50 float_type;
+
+

+ To use the functions for finding zeros of the cyl_neumann + function we need: +

+
#include <boost/math/special_functions/bessel.hpp>
+
+

+ The Neumann (Bessel Y) function zeros are evaluated very similarly: +

+
using boost::math::cyl_neumann_zero;
+double zn = cyl_neumann_zero(2., 1);
+std::cout << "cyl_neumann_zero(2., 1) = " << zn << std::endl;
+
+std::vector<float> nzeros(3); // Space for 3 zeros.
+cyl_neumann_zero<float>(2.F, 1, nzeros.size(), nzeros.begin());
+
+std::cout << "cyl_neumann_zero<float>(2.F, 1, ";
+// Print the zeros to the output stream.
+std::copy(nzeros.begin(), nzeros.end(),
+          std::ostream_iterator<float>(std::cout, ", "));
+
+std::cout << "\n""cyl_neumann_zero(static_cast<float_type>(220)/100, 1) = "
+  << cyl_neumann_zero(static_cast<float_type>(220)/100, 1) << std::endl;
+// 3.6154383428745996706772556069431792744372398748422
+
+
+ + Error + messages from 'bad' input +
+

+ Another example demonstrates calculating zeros of the Bessel functions showing + the error messages from 'bad' input is handled by throwing exceptions. +

+

+ To use the functions for finding zeros of the functions we need: +

+
#include <boost/math/special_functions/bessel.hpp>
+#include <boost/math/special_functions/airy.hpp>
+
+
+ + + + + +
[Tip]Tip

+ It is always wise to place all code using Boost.Math inside try'n'catch + blocks; this will ensure that helpful error messages can be shown when + exceptional conditions arise. +

+

+ Examples below show messages from several 'bad' arguments that throw a domain_error exception. +

+
try
+{ // Try a zero order v.
+  float dodgy_root = boost::math::cyl_bessel_j_zero(0.F, 0);
+  std::cout << "boost::math::cyl_bessel_j_zero(0.F, 0) " << dodgy_root << std::endl;
+  // Thrown exception Error in function boost::math::cyl_bessel_j_zero<double>(double, int):
+  // Requested the 0'th zero of J0, but the rank must be > 0 !
+}
+catch (std::exception& ex)
+{
+  std::cout << "Thrown exception " << ex.what() << std::endl;
+}
+
+
+ + + + + +
[Note]Note

+ The type shown in the error message is the type after + promotion, using precision + policy and internal + promotion policy, from float + to double in this case. +

+

+ In this example the promotion goes: +

+
    +
  1. + Arguments are float and + int. +
  2. +
  3. + Treat int "as if" + it were a double, so arguments + are float and double. +
  4. +
  5. + Common type is double - + so that's the precision we want (and the type that will be returned). +
  6. +
  7. + Evaluate internally as double + for full float precision. +
  8. +
+

+ See full code for other examples that promote from double + to long double. +

+

+ Other examples of 'bad' inputs like infinity and NaN are below. Some compiler + warnings indicate that 'bad' values are detected at compile time. +

+
try
+{ // order v = inf
+   std::cout << "boost::math::cyl_bessel_j_zero(inf, 1) " << std::endl;
+   double inf = std::numeric_limits<double>::infinity();
+   double inf_root = boost::math::cyl_bessel_j_zero(inf, 1);
+   std::cout << "boost::math::cyl_bessel_j_zero(inf, 1) " << inf_root << std::endl;
+   // Throw exception Error in function boost::math::cyl_bessel_j_zero<long double>(long double, unsigned):
+   // Order argument is 1.#INF, but must be finite >= 0 !
+}
+catch (std::exception& ex)
+{
+  std::cout << "Thrown exception " << ex.what() << std::endl;
+}
+
+try
+{ // order v = NaN, rank m = 1
+   std::cout << "boost::math::cyl_bessel_j_zero(nan, 1) " << std::endl;
+   double nan = std::numeric_limits<double>::quiet_NaN();
+   double nan_root = boost::math::cyl_bessel_j_zero(nan, 1);
+   std::cout << "boost::math::cyl_bessel_j_zero(nan, 1) " << nan_root << std::endl;
+   // Throw exception Error in function boost::math::cyl_bessel_j_zero<long double>(long double, unsigned):
+   // Order argument is 1.#QNAN, but must be finite >= 0 !
+}
+catch (std::exception& ex)
+{
+  std::cout << "Thrown exception " << ex.what() << std::endl;
+}
+
+

+ The output from other examples are shown appended to the full code listing. +

+

+ The full code (and output) for these examples is at Bessel + zeros, Bessel + zeros iterator, Neumann + zeros, Bessel + error messages. +

+

+ + Implementation +

+

+ Various methods are used to compute initial estimates for jν, m + and yν, m ; these are described in detail below. +

+

+ After finding the initial estimate of a given root, its precision is subsequently + refined to the desired level using Newton-Raphson iteration from Boost.Math's + root-finding with derivatives + utilities combined with the functions cyl_bessel_j + and cyl_neumann. +

+

+ Newton iteration requires both Jν(x) or Yν(x) + as well as its derivative. The derivatives of Jν(x) and + Yν(x) with respect to x are given + by M. Abramowitz and I. A. Stegun, Handbook of Mathematical Functions, NBS + (1964). In particular, +

+

+   d/dx Jν(x) = Jν-1(x) - ν Jν(x) + / x +

+

+   d/dx Yν(x) = Yν-1(x) - ν Yν(x) + / x +

+

+ Enumeration of the rank of a root (in other words the index of a root) begins + with one and counts up, in other words m,=1,2,3,… The + value of the first root is always greater than zero. +

+

+ For certain special parameters, cylindrical Bessel functions and cylindrical + Neumann functions have a root at the origin. For example, Jν(x) + has a root at the origin for every positive order ν > 0, + and for every negative integer order ν = -n with n + ∈ ℕ + and n ≠ 0. +

+

+ In addition, Yν(x) has a root at the origin for every + negative half-integer order ν = -n/2, with n + ∈ ℕ + and and n ≠ 0. +

+

+ For these special parameter values, the origin with a value of x + = 0 is provided as the 0th root generated + by cyl_bessel_j_zero() + and cyl_neumann_zero(). +

+

+ When calculating initial estimates for the roots of Bessel functions, a distinction + is made between positive order and negative order, and different methods + are used for these. In addition, different algorithms are used for the first + root m = 1 and for subsequent roots with higher rank + m ≥ 2. Furthermore, estimates of the roots for Bessel + functions with order above and below a cutoff at ν = 2.2 + are calculated with different methods. +

+

+ Calculations of the estimates of jν,1 and yν,1 + with 0 ≤ ν < 2.2 use empirically tabulated values. The + coefficients for these have been generated by a computer algebra system. +

+

+ Calculations of the estimates of jν,1 and yν,1 + with ν≥ 2.2 use Eqs.9.5.14 and 9.5.15 in M. Abramowitz + and I. A. Stegun, Handbook of Mathematical Functions, NBS (1964). +

+

+ In particular, +

+

+   jν,1 ≅ ν + 1.85575 ν⅓ + 1.033150 ν-⅓ - 0.00397 ν-1 - 0.0908 ν-5/3 + 0.043 ν-7/3 + + … +

+

+ and +

+

+   yν,1 ≅ ν + 0.93157 ν⅓ + 0.26035 ν-⅓ + 0.01198 ν-1 - 0.0060 ν-5/3 - 0.001 ν-7/3 + + … +

+

+ Calculations of the estimates of jν, m and yν, + m with rank m > 2 and 0 ≤ ν < + 2.2 use McMahon's approximation, as described in M. Abramowitz + and I. A. Stegan, Section 9.5 and 9.5.12. In particular, +

+

+   jν,m, yν,m ≅ β - (μ-1) / 8β +

+

+       - 4(μ-1)(7μ - 31) / 3(8β)3 +

+

+       -32(μ-1)(83μ² - 982μ + 3779) / 15(8β)5 +

+

+       -64(μ-1)(6949μ3 - 153855μ² + 1585743μ- 6277237) / 105(8a)7 +

+

+       - …     (5) +

+

+ where μ = 4ν2 and β = (m + ½ν - ¼)π for + jν,m and β = (m + ½ν -¾)π for yν,m. +

+

+ Calculations of the estimates of jν, m and yν, + m with ν ≥ 2.2 use one term in the asymptotic + expansion given in Eq.9.5.22 and top line of Eq.9.5.26 combined with Eq. + 9.3.39, all in M. Abramowitz and I. A. Stegun, Handbook of Mathematical Functions, + NBS (1964) explicit and easy-to-understand treatment for asymptotic expansion + of zeros. The latter two equations are expressed for argument (x) + greater than one. (Olver also gives the series form of the equations in + §10.21(vi) McMahon's Asymptotic + Expansions for Large Zeros - using slightly different variable names). +

+

+ In summary, +

+

+   jν, m ∼ νx(-ζ) + f1(-ζ/ν) +

+

+ where -ζ = ν-2/3am and am is the absolute + value of the mth root of Ai(x) + on the negative real axis. +

+

+ Here x = x(-ζ) is the inverse of the function +

+

+   ⅔(-ζ)3/2 = √(x² - 1) - cos⁻¹(1/x)     (7) +

+

+ Furthermore, +

+

+   f1(-ζ) = ½x(-ζ) {h(-ζ)}² ⋅ b0(-ζ) +

+

+ where +

+

+   h(-ζ) = {4(-ζ) / (x² - 1)}4 +

+

+ and +

+

+   b0(-ζ) = -5/(48ζ²) + 1/(-ζ)½ ⋅ { 5/(24(x2-1)3/2) + 1/(8(x2-1)½)} +

+

+ When solving for x(-ζ) in Eq. 7 above, the right-hand-side + is expanded to order 2 in a Taylor series for large x. + This results in +

+

+   ⅔(-ζ)3/2 ≈ x + 1/2x - π/2 +

+

+ The positive root of the resulting quadratic equation is used to find an + initial estimate x(-ζ). This initial estimate is subsequently + refined with several steps of Newton-Raphson iteration in Eq. 7. +

+

+ Estimates of the roots of cylindrical Bessel functions of negative order + on the positive real axis are found using interlacing relations. For example, + the mth root of the cylindrical Bessel function j-ν,m + is bracketed by the mth root and the (m+1)th + root of the Bessel function of corresponding positive integer order. In other + words, +

+

+   jnν,m < j-ν,m < jnν,m+1 +

+

+ where m > 1 and nν represents + the integral floor of the absolute value of |-ν|. +

+

+ Similar bracketing relations are used to find estimates of the roots of Neumann + functions of negative order, whereby a discontinuity at every negative half-integer + order needs to be handled. +

+

+ Bracketing relations do not hold for the first root of cylindrical Bessel + functions and cylindrical Neumann functions with negative order. Therefore, + iterative algorithms combined with root-finding via bisection are used to + localize j-ν,1 and y-ν,1. +

+

+ + Testing +

+

+ The precision of evaluation of zeros was tested at 50 decimal digits using + cpp_dec_float_50 and found + identical with spot values computed by Wolfram + Alpha. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/boost/libs/math/doc/html/math_toolkit/bessel/mbessel.html b/boost/libs/math/doc/html/math_toolkit/bessel/mbessel.html new file mode 100644 index 00000000..405832de --- /dev/null +++ b/boost/libs/math/doc/html/math_toolkit/bessel/mbessel.html @@ -0,0 +1,1122 @@ + + + +Modified Bessel Functions of the First and Second Kinds + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Synopsis +
+

+ #include <boost/math/special_functions/bessel.hpp> +

+
template <class T1, class T2>
+calculated-result-type cyl_bessel_i(T1 v, T2 x);
+
+template <class T1, class T2, class Policy>
+calculated-result-type cyl_bessel_i(T1 v, T2 x, const Policy&);
+
+template <class T1, class T2>
+calculated-result-type cyl_bessel_k(T1 v, T2 x);
+
+template <class T1, class T2, class Policy>
+calculated-result-type cyl_bessel_k(T1 v, T2 x, const Policy&);
+
+
+ + Description +
+

+ The functions cyl_bessel_i + and cyl_bessel_k return + the result of the modified Bessel functions of the first and second kind + respectively: +

+

+ cyl_bessel_i(v, x) = Iv(x) +

+

+ cyl_bessel_k(v, x) = Kv(x) +

+

+ where: +

+

+ +

+

+ +

+

+ The return type of these functions is computed using the result + type calculation rules when T1 and T2 are different types. + The functions are also optimised for the relatively common case that T1 is + an integer. +

+

+ The final Policy argument is optional and can + be used to control the behaviour of the function: how it handles errors, + what level of precision to use etc. Refer to the policy + documentation for more details. +

+

+ The functions return the result of domain_error + whenever the result is undefined or complex. For cyl_bessel_j + this occurs when x < + 0 and v is not an integer, or when + x == + 0 and v + != 0. + For cyl_neumann this + occurs when x <= + 0. +

+

+ The following graph illustrates the exponential behaviour of Iv. +

+

+ +

+

+ The following graph illustrates the exponential decay of Kv. +

+

+ +

+
+ + Testing +
+

+ There are two sets of test values: spot values calculated using functions.wolfram.com, + and a much larger set of tests computed using a simplified version of this + implementation (with all the special case handling removed). +

+
+ + Accuracy +
+

+ The following tables show how the accuracy of these functions varies on various + platforms, along with comparison to other libraries. Note that only results + for the widest floating-point type on the system are given, as narrower types + have effectively zero + error. All values are relative errors in units of epsilon. Note that + our test suite includes some fairly extreme inputs which results in most + of the worst problem cases in other libraries: +

+
+

Table 6.44. Error rates for cyl_bessel_i (integer orders)

+
+++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

+ Microsoft Visual C++ version 12.0
Win32
double +

+
+

+ GNU C++ version 5.1.0
linux
long double +

+
+

+ GNU C++ version 5.1.0
linux
double +

+
+

+ Sun compiler version 0x5130
Sun Solaris
long double +

+
+

+ Bessel I0: Mathworld Data (Integer Version) +

+
+

+ Max = 0.877ε (Mean = 0.549ε) +

+
+

+ Max = 4.57ε (Mean = 2.1ε)

+ (<tr1/cmath>: Max = 8.49ε (Mean = 3.46ε) + And + other failures.) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 0.79ε (Mean = 0.482ε))
(Rmath + 3.0.2: Max = +INFε (Mean = +INFε) And + other failures.)
(Cephes: + Max = 2.55e+43ε (Mean = 8.06e+42ε) And + other failures.) +

+
+

+ Max = 4.54ε (Mean = 2.11ε) +

+
+

+ Bessel I1: Mathworld Data (Integer Version) +

+
+

+ Max = 0.885ε (Mean = 0.55ε) +

+
+

+ Max = 7.83ε (Mean = 2.79ε)

+ (<tr1/cmath>: Max = 5ε (Mean = 2.15ε) + And + other failures.) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 0.82ε (Mean = 0.456ε))
(Rmath + 3.0.2: Max = +INFε (Mean = +INFε) And + other failures.)
(Cephes: + Max = 1.28e+43ε (Mean = 4.05e+42ε) And + other failures.) +

+
+

+ Max = 6.52ε (Mean = 2.25ε) +

+
+

+ Bessel In: Mathworld Data (Integer Version) +

+
+

+ Max = 3.46ε (Mean = 1.32ε) +

+
+

+ Max = 1.8ε (Mean = 1.33ε)

+ (<tr1/cmath>: Max = 430ε (Mean = 163ε) + And + other failures.) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 5.15ε (Mean = 2.13ε) And + other failures.)
(Rmath 3.0.2: + Max = +INFε (Mean = +INFε) And + other failures.)
(Cephes: + Max = 3.67e+177ε (Mean = +INFε) And + other failures.) +

+
+

+ Max = 463ε (Mean = 140ε) +

+
+
+
+

Table 6.45. Error rates for cyl_bessel_i

+
+++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

+ Microsoft Visual C++ version 12.0
Win32
double +

+
+

+ GNU C++ version 5.1.0
linux
long double +

+
+

+ GNU C++ version 5.1.0
linux
double +

+
+

+ Sun compiler version 0x5130
Sun Solaris
long double +

+
+

+ Bessel I0: Mathworld Data +

+
+

+ Max = 0.877ε (Mean = 0.549ε) +

+
+

+ Max = 4.57ε (Mean = 2.1ε)

+ (<tr1/cmath>: Max = 8.49ε (Mean = 3.46ε) + And + other failures.) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 270ε (Mean = 91.6ε) And + other failures.)
(Rmath 3.0.2: + Max = +INFε (Mean = +INFε) And + other failures.)
(Cephes: + Max = 2.55e+43ε (Mean = 8.06e+42ε) And + other failures.) +

+
+

+ Max = 4.54ε (Mean = 2.11ε) +

+
+

+ Bessel I1: Mathworld Data +

+
+

+ Max = 0.885ε (Mean = 0.55ε) +

+
+

+ Max = 7.83ε (Mean = 2.79ε)

+ (<tr1/cmath>: Max = 5ε (Mean = 2.15ε) + And + other failures.) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 128ε (Mean = 41ε) And + other failures.)
(Rmath 3.0.2: + Max = +INFε (Mean = +INFε) And + other failures.)
(Cephes: + Max = 1.28e+43ε (Mean = 4.05e+42ε) And + other failures.) +

+
+

+ Max = 6.52ε (Mean = 2.25ε) +

+
+

+ Bessel In: Mathworld Data +

+
+

+ Max = 3.46ε (Mean = 1.32ε) +

+
+

+ Max = 1.8ε (Mean = 1.33ε)

+ (<tr1/cmath>: Max = 430ε (Mean = 163ε) + And + other failures.) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 2.31ε (Mean = 0.838ε) And + other failures.)
(Rmath 3.0.2: + Max = +INFε (Mean = +INFε) And + other failures.)
(Cephes: + Max = 3.67e+177ε (Mean = +INFε) And + other failures.) +

+
+

+ Max = 463ε (Mean = 140ε) +

+
+

+ Bessel Iv: Mathworld Data +

+
+

+ Max = 2.97ε (Mean = 1.33ε) +

+
+

+ Max = 4.12ε (Mean = 1.85ε)

+ (<tr1/cmath>: Max = 616ε (Mean = 221ε) + And + other failures.) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 5.95ε (Mean = 2.08ε) And + other failures.)
(Rmath 3.0.2: + Max = 1e+04ε (Mean = 3.18e+03ε))
(Cephes: + Max = +INFε (Mean = +INFε) And + other failures.) +

+
+

+ Max = 4.12ε (Mean = 1.95ε) +

+
+

+ Bessel In: Random Data +

+
+

+ Max = 9.67ε (Mean = 1.89ε) +

+
+

+ Max = 6.79ε (Mean = 1.15ε)

+ (<tr1/cmath>: Max = 645ε (Mean = 132ε)) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 261ε (Mean = 53.2ε) And + other failures.)
(Rmath 3.0.2: + Max = 7.37ε (Mean = 2.4ε))
(Cephes: Max + = 4.22e+06ε (Mean = 2.26e+05ε)) +

+
+

+ Max = 176ε (Mean = 39.2ε) +

+
+

+ Bessel Iv: Random Data +

+
+

+ Max = 7.46ε (Mean = 1.54ε) +

+
+

+ Max = 8.35ε (Mean = 1.49ε)

+ (<tr1/cmath>: Max = 1.05e+03ε (Mean = + 224ε) And + other failures.) +

+
+

+ Max = 0.661ε (Mean = 0.0441ε)
+
(GSL 1.16: Max = 6.18e+03ε (Mean = 1.55e+03ε) + And + other failures.)
(Rmath 3.0.2: + Max = 4.28e+08ε (Mean = 2.85e+07ε))
+ (Cephes: Max = 6e+30ε (Mean + = 4e+29ε) And + other failures.) +

+
+

+ Max = 283ε (Mean = 88.4ε) +

+
+

+ Bessel Iv: Mathworld Data (large values) +

+
+

+ Max = 3.67ε (Mean = 1.64ε) +

+
+

+ Max = 14.7ε (Mean = 6.57ε)

+ (<tr1/cmath>: Max = 118ε (Mean = 57.2ε) + And + other failures.) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 37ε (Mean = 18ε) And + other failures.)
(Rmath 3.0.2: + Max = 3.77e+168ε (Mean = 2.39e+168ε) And + other failures.)
(Cephes: + Max = 73.7ε (Mean = 58.5ε)) +

+
+

+ Max = 14.7ε (Mean = 6.59ε) +

+
+
+
+

Table 6.46. Error rates for cyl_bessel_k (integer orders)

+
+++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

+ Microsoft Visual C++ version 12.0
Win32
double +

+
+

+ GNU C++ version 5.1.0
linux
long double +

+
+

+ GNU C++ version 5.1.0
linux
double +

+
+

+ Sun compiler version 0x5130
Sun Solaris
long double +

+
+

+ Bessel K0: Mathworld Data (Integer Version) +

+
+

+ Max = 1.55ε (Mean = 0.837ε) +

+
+

+ Max = 4.16ε (Mean = 1.46ε)

+ (<tr1/cmath>: Max = 9.33ε (Mean = 3.25ε)) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 1.2ε (Mean = 0.733ε))
(Rmath + 3.0.2: Max = 0.833ε (Mean = 0.601ε))
(Cephes: + Max = 1.1e+06ε (Mean = 3.68e+05ε)) +

+
+

+ Max = 4.16ε (Mean = 1.49ε) +

+
+

+ Bessel K1: Mathworld Data (Integer Version) +

+
+

+ Max = 1ε (Mean = 0.573ε) +

+
+

+ Max = 1.8ε (Mean = 1.02ε)

+ (<tr1/cmath>: Max = 8.94ε (Mean = 3.19ε)) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 0.626ε (Mean = 0.333ε))
(Rmath + 3.0.2: Max = 0.894ε (Mean = 0.516ε))
(Cephes: + Max = 5.38e+05ε (Mean = 1.79e+05ε)) +

+
+

+ Max = 1.8ε (Mean = 1.02ε) +

+
+

+ Bessel Kn: Mathworld Data (Integer Version) +

+
+

+ Max = 3.63ε (Mean = 1.46ε) +

+
+

+ Max = 4.48ε (Mean = 2.14ε)

+ (<tr1/cmath>: Max = 12.9ε (Mean = 4.91ε) + And + other failures.) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 168ε (Mean = 59.5ε))
(Rmath + 3.0.2: Max = 8.48ε (Mean = 2.98ε))
(Cephes: + Max = +INFε (Mean = +INFε) And + other failures.) +

+
+

+ Max = 4.48ε (Mean = 1.98ε) +

+
+
+
+

Table 6.47. Error rates for cyl_bessel_k

+
+++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +

+ Microsoft Visual C++ version 12.0
Win32
double +

+
+

+ GNU C++ version 5.1.0
linux
long double +

+
+

+ GNU C++ version 5.1.0
linux
double +

+
+

+ Sun compiler version 0x5130
Sun Solaris
long double +

+
+

+ Bessel K0: Mathworld Data +

+
+

+ Max = 1.55ε (Mean = 0.837ε) +

+
+

+ Max = 4.16ε (Mean = 1.46ε)

+ (<tr1/cmath>: Max = 9.33ε (Mean = 3.25ε)) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 6.04ε (Mean = 2.16ε))
(Rmath + 3.0.2: Max = 0.833ε (Mean = 0.601ε)) +

+
+

+ Max = 4.16ε (Mean = 1.49ε) +

+
+

+ Bessel K1: Mathworld Data +

+
+

+ Max = 1ε (Mean = 0.573ε) +

+
+

+ Max = 1.8ε (Mean = 1.02ε)

+ (<tr1/cmath>: Max = 8.94ε (Mean = 3.19ε)) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 6.26ε (Mean = 2.21ε))
(Rmath + 3.0.2: Max = 0.894ε (Mean = 0.516ε)) +

+
+

+ Max = 1.8ε (Mean = 1.02ε) +

+
+

+ Bessel Kn: Mathworld Data +

+
+

+ Max = 3.63ε (Mean = 1.46ε) +

+
+

+ Max = 4.48ε (Mean = 2.14ε)

+ (<tr1/cmath>: Max = 12.9ε (Mean = 4.91ε) + And + other failures.) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 3.36ε (Mean = 1.43ε) And + other failures.)
(Rmath 3.0.2: + Max = 8.48ε (Mean = 2.98ε)) +

+
+

+ Max = 4.48ε (Mean = 1.98ε) +

+
+

+ Bessel Kv: Mathworld Data +

+
+

+ Max = 4.78ε (Mean = 2.2ε) +

+
+

+ Max = 3.58ε (Mean = 2.44ε)

+ (<tr1/cmath>: Max = 13ε (Mean = 4.81ε) + And + other failures.) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 5.47ε (Mean = 2.04ε) And + other failures.)
(Rmath 3.0.2: + Max = 3.15ε (Mean = 1.35ε)) +

+
+

+ Max = 3.58ε (Mean = 2.29ε) +

+
+

+ Bessel Kv: Mathworld Data (large values) +

+
+

+ Max = 59.8ε (Mean = 26.9ε) +

+
+

+ Max = 42.3ε (Mean = 21ε)

+ (<tr1/cmath>: Max = 42.3ε (Mean = 19.8ε) + And + other failures.) +

+
+

+ Max = 0ε (Mean = 0ε)

(GSL + 1.16: Max = 308ε (Mean = 142ε) And + other failures.)
(Rmath 3.0.2: + Max = 84.6ε (Mean = 37.8ε)) +

+
+

+ Max = 43.1ε (Mean = 21.3ε) +

+
+

+ Bessel Kn: Random Data +

+
+

+ Max = 7.47ε (Mean = 1.4ε) +

+
+

+ Max = 4.55ε (Mean = 1.09ε)

+ (<tr1/cmath>: Max = 13.9ε (Mean = 2.91ε)) +

+
+

+ Max = 0.764ε (Mean = 0.0348ε)
+
(GSL 1.16: Max = 8.71ε (Mean = 1.76ε) + And + other failures.)
(Rmath 3.0.2: + Max = 7.47ε (Mean = 1.34ε)) +

+
+

+ Max = 4.55ε (Mean = 1.21ε) +

+
+

+ Bessel Kv: Random Data +

+
+

+ Max = 8.33ε (Mean = 1.62ε) +

+
+

+ Max = 7.88ε (Mean = 1.48ε)

+ (<tr1/cmath>: Max = 13.6ε (Mean = 2.68ε) + And + other failures.) +

+
+

+ Max = 0.507ε (Mean = 0.0313ε)
+
(GSL 1.16: Max = 9.71ε (Mean = 1.47ε) + And + other failures.)
(Rmath 3.0.2: + Max = 7.37ε (Mean = 1.49ε)) +

+
+

+ Max = 7.88ε (Mean = 1.49ε) +

+
+
+
+ + Implementation +
+

+ The following are handled as special cases first: +

+

+ When computing Iv   for x < 0, then ν   must be an integer + or a domain error occurs. If ν   is an integer, then the function is odd if ν   is + odd and even if ν   is even, and we can reflect to x > 0. +

+

+ For Iv   with v equal to 0, 1 or 0.5 are handled as special cases. +

+

+ The 0 and 1 cases use minimax rational approximations on finite and infinite + intervals. The coefficients are from: +

+
    +
  • + J.M. Blair and C.A. Edwards, Stable rational minimax approximations + to the modified Bessel functions I_0(x) and I_1(x), Atomic + Energy of Canada Limited Report 4928, Chalk River, 1974. +
  • +
  • + S. Moshier, Methods and Programs for Mathematical Functions, + Ellis Horwood Ltd, Chichester, 1989. +
  • +
+

+ While the 0.5 case is a simple trigonometric function: +

+

+ I0.5(x) = sqrt(2 / πx) * sinh(x) +

+

+ For Kv   with v an integer, the result is calculated using + the recurrence relation: +

+

+ +

+

+ starting from K0   and K1   which are calculated using rational the approximations + above. These rational approximations are accurate to around 19 digits, and + are therefore only used when T has no more than 64 binary digits of precision. +

+

+ When x is small compared to v, + Ivx   is best computed directly from the series: +

+

+ +

+

+ In the general case, we first normalize ν   to [0, [inf]) + with the help of the reflection formulae: +

+

+ +

+

+ +

+

+ Let μ   = ν - floor(ν + 1/2), then μ   is the fractional part of ν   such that |μ| <= 1/2 + (we need this for convergence later). The idea is to calculate Kμ(x) and Kμ+1(x), + and use them to obtain Iν(x) and Kν(x). +

+

+ The algorithm is proposed by Temme in N.M. Temme, On the numerical + evaluation of the modified bessel function of the third kind, + Journal of Computational Physics, vol 19, 324 (1975), which needs two continued + fractions as well as the Wronskian: +

+

+ +

+

+ +

+

+ +

+

+ The continued fractions are computed using the modified Lentz's method (W.J. + Lentz, Generating Bessel functions in Mie scattering calculations + using continued fractions, Applied Optics, vol 15, 668 (1976)). + Their convergence rates depend on x, therefore we need + different strategies for large x and small x. +

+

+ x > v, CF1 needs O(x) iterations + to converge, CF2 converges rapidly. +

+

+ x <= v, CF1 converges rapidly, CF2 fails to converge + when x -> 0. +

+

+ When x is large (x > 2), both + continued fractions converge (CF1 may be slow for really large x). + Kμ   and Kμ+1   +can be calculated by +

+

+ +

+

+ where +

+

+ +

+

+ S is also a series that is summed along with CF2, see + I.J. Thompson and A.R. Barnett, Modified Bessel functions I_v and + K_v of real order and complex argument to selected accuracy, Computer + Physics Communications, vol 47, 245 (1987). +

+

+ When x is small (x <= 2), CF2 + convergence may fail (but CF1 works very well). The solution here is Temme's + series: +

+

+ +

+

+ where +

+

+ +

+

+ fk   and hk   +are also computed by recursions (involving gamma functions), but + the formulas are a little complicated, readers are referred to N.M. Temme, + On the numerical evaluation of the modified Bessel function of + the third kind, Journal of Computational Physics, vol 19, 324 + (1975). Note: Temme's series converge only for |μ| <= 1/2. +

+

+ Kν(x) is then calculated from the forward recurrence, as is Kν+1(x). With these + two values and fν, the Wronskian yields Iν(x) directly. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + diff --git a/boost/libs/math/doc/html/math_toolkit/bessel/sph_bessel.html b/boost/libs/math/doc/html/math_toolkit/bessel/sph_bessel.html new file mode 100644 index 00000000..a819e883 --- /dev/null +++ b/boost/libs/math/doc/html/math_toolkit/bessel/sph_bessel.html @@ -0,0 +1,287 @@ + + + +Spherical Bessel Functions of the First and Second Kinds + + + + + + + + + + + + + + + +
Boost C++ LibrariesHomeLibrariesPeopleFAQMore
+
+
+PrevUpHomeNext +
+
+ +
+ + Synopsis +
+

+ #include <boost/math/special_functions/bessel.hpp> +

+
template <class T1, class T2>
+calculated-result-type sph_bessel(unsigned v, T2 x);
+
+template <class T1, class T2, class Policy>
+calculated-result-type sph_bessel(unsigned v, T2 x, const Policy&);
+
+template <class T1, class T2>
+calculated-result-type sph_neumann(unsigned v, T2 x);
+
+template <class T1, class T2, class Policy>
+calculated-result-type sph_neumann(unsigned v, T2 x, const Policy&);
+
+
+ + Description +
+

+ The functions sph_bessel + and sph_neumann return + the result of the Spherical Bessel functions of the first and second kinds + respectively: +

+

+ sph_bessel(v, x) = jv(x) +

+

+ sph_neumann(v, x) = yv(x) = nv(x) +

+

+ where: +

+

+ +

+

+ The return type of these functions is computed using the result + type calculation rules for the single argument type T. +

+

+ The final Policy argument is optional and can + be used to control the behaviour of the function: how it handles errors, + what level of precision to use etc. Refer to the policy + documentation for more details. +

+

+ The functions return the result of domain_error + whenever the result is undefined or complex: this occurs when x < 0. +

+

+ The jv   function is cyclic like Jv   but differs in its behaviour at the origin: +

+

+ +

+

+ Likewise yv   is also cyclic for large x, but tends to -∞   +for small x: +

+

+ +

+
+ + Testing +
+

+ There are two sets of test values: spot values calculated using functions.wolfram.com, + and a much larger set of tests computed using a simplified version of this + implementation (with all the special case handling removed). +

+
+ + Accuracy +
+
+

Table 6.48. Error rates for sph_bessel

+
+++++++ + + + + + + + + + + + + + + +
+ +

+ Microsoft Visual C++ version 12.0
Win32
double +

+
+

+ GNU C++ version 5.1.0
linux
long double +

+
+

+ GNU C++ version 5.1.0
linux
double +

+
+

+ Sun compiler version 0x5130
Sun Solaris
long double +

+
+

+ Bessel j: Random Data +

+
+

+ Max = 245ε (Mean = 16.3ε) +

+
+

+ Max = 243ε (Mean = 13.3ε)

+ (<tr1/cmath>: Max = 1.91e+06ε (Mean = + 1.09e+05ε)) +

+
+

+ Max = 0.978ε (Mean = 0.0539ε)
+
(GSL 1.16: Max = 1.79e+03ε (Mean = 107ε)) +

+
+

+ Max = 243ε (Mean = 33.7ε) +

+
+
+
+

Table 6.49. Error rates for sph_neumann

+
+++++++ + + + + + + + + + + + + + + +
+ +

+ Microsoft Visual C++ version 12.0
Win32
double +

+
+

+ GNU C++ version 5.1.0
linux
double +

+
+

+ GNU C++ version 5.1.0
linux
long double +

+
+

+ Sun compiler version 0x5130
Sun Solaris
long double +

+
+

+ y: Random Data +

+
+

+ Max = 281ε (Mean = 31.1ε) +

+
+

+ Max = 0.995ε (Mean = 0.0665ε)
+
(GSL 1.16: Max = 8.5e+04ε (Mean = 5.33e+03ε)) +

+
+

+ Max = 234ε (Mean = 19.5ε)

+ (<tr1/cmath>: Max = 1.6e+06ε (Mean = 1.4e+05ε)) +

+
+

+ Max = 234ε (Mean = 19.8ε) +

+
+
+
+ + Implementation +
+

+ Other than error handling and a couple of special cases these functions are + implemented directly in terms of their definitions: +

+

+ +

+

+ The special cases occur for: +

+

+ j0  = sinc_pi(x) = sin(x) + / x +

+

+ and for small x < 1, we can use the series: +

+

+ +

+

+ which neatly avoids the problem of calculating 0/0 that can occur with the + main definition as x → 0. +

+
+ + + +
+
+
+PrevUpHomeNext +
+ + -- cgit v1.2.3