• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1[section:sph_bessel Spherical Bessel Functions of the First and Second Kinds]
2
3[h4 Synopsis]
4
5`#include <boost/math/special_functions/bessel.hpp>`
6
7   template <class T1, class T2>
8   ``__sf_result`` sph_bessel(unsigned v, T2 x);
9
10   template <class T1, class T2, class ``__Policy``>
11   ``__sf_result`` sph_bessel(unsigned v, T2 x, const ``__Policy``&);
12
13   template <class T1, class T2>
14   ``__sf_result`` sph_neumann(unsigned v, T2 x);
15
16   template <class T1, class T2, class ``__Policy``>
17   ``__sf_result`` sph_neumann(unsigned v, T2 x, const ``__Policy``&);
18
19[h4 Description]
20
21The functions __sph_bessel and __sph_neumann return the result of the
22Spherical Bessel functions of the first and second kinds respectively:
23
24[:sph_bessel(v, x) = j[sub v](x)]
25
26[:sph_neumann(v, x) = y[sub v](x) = n[sub v](x)]
27
28where:
29
30[equation sbessel2]
31
32The return type of these functions is computed using the __arg_promotion_rules
33for the single argument type T.
34
35[optional_policy]
36
37The functions return the result of __domain_error whenever the result is
38undefined or complex: this occurs when `x < 0`.
39
40The j[sub v] function is cyclic like J[sub v] but differs in its behaviour at the origin:
41
42[graph sph_bessel]
43
44Likewise y[sub v] is also cyclic for large x, but tends to -[infin]
45for small /x/:
46
47[graph sph_neumann]
48
49[h4 Testing]
50
51There are two sets of test values: spot values calculated using
52[@http://functions.wolfram.com/ functions.wolfram.com],
53and a much larger set of tests computed using
54a simplified version of this implementation
55(with all the special case handling removed).
56
57[h4 Accuracy]
58
59[table_sph_bessel]
60
61[table_sph_neumann]
62
63[h4 Implementation]
64
65Other than error handling and a couple of special cases these functions
66are implemented directly in terms of their definitions:
67
68[equation sbessel2]
69
70The special cases occur for:
71
72[:j[sub 0]= __sinc_pi(x) = sin(x) / x]
73
74and for small ['x < 1], we can use the series:
75
76[equation sbessel5]
77
78which neatly avoids the problem of calculating 0/0 that can occur with the
79main definition as x [rarr] 0.
80
81[endsect] [/section:sph_bessel Spherical Bessel Functions of the First and Second Kinds]
82
83[/
84  Copyright 2006 John Maddock, Paul A. Bristow and Xiaogang Zhang.
85  Distributed under the Boost Software License, Version 1.0.
86  (See accompanying file LICENSE_1_0.txt or copy at
87  http://www.boost.org/LICENSE_1_0.txt).
88]
89