File: bessel_spherical.qbk

package info (click to toggle)
boost1.35 1.35.0-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 203,856 kB
  • ctags: 337,867
  • sloc: cpp: 938,683; xml: 56,847; ansic: 41,589; python: 18,999; sh: 11,566; makefile: 664; perl: 494; yacc: 456; asm: 353; csh: 6
file content (87 lines) | stat: -rw-r--r-- 2,402 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87

[section:sph_bessel Spherical Bessel Functions of the First and Second Kinds]

[h4 Synopsis]

   template <class T1, class T2>
   ``__sf_result`` sph_bessel(unsigned v, T2 x);

   template <class T1, class T2, class ``__Policy``>
   ``__sf_result`` sph_bessel(unsigned v, T2 x, const ``__Policy``&);

   template <class T1, class T2>
   ``__sf_result`` sph_neumann(unsigned v, T2 x);
   
   template <class T1, class T2, class ``__Policy``>
   ``__sf_result`` sph_neumann(unsigned v, T2 x, const ``__Policy``&);
   
[h4 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) = j[sub v](x)

sph_neumann(v, x) = y[sub v](x) = n[sub v](x)

where:

[equation sbessel2]

The return type of these functions is computed using the __arg_pomotion_rules
for the single argument type T.

[optional_policy]

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

The j[sub v][space] function is cyclic like J[sub v][space] but differs
in its behaviour at the origin:

[$../graphs/sph_bessel_j.png]

Likewise y[sub v][space] is also cyclic for large x, but tends to -[infin][space]
for small /x/:

[$../graphs/sph_bessel_y.png]

[h4 Testing]

There are two sets of test values: spot values calculated using
[@http://functions.wolfram.com/ 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).

[h4 Accuracy]

Other than for some special cases, these functions are computed in terms of
__cyl_bessel_j and __cyl_neumann: refer to these functions for accuracy data.

[h4 Implementation]

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

[equation sbessel2]

The special cases occur for:

j[sub 0][space]= __sinc_pi(x) = sin(x) / x

and for small ['x < 1], we can use the series:

[equation sbessel5]

which neatly avoids the problem of calculating 0/0 that can occur with the
main definition as x [rarr] 0.

[endsect]

[/ 
  Copyright 2006 John Maddock, Paul A. Bristow and Xiaogang Zhang.
  Distributed under the Boost Software License, Version 1.0.
  (See accompanying file LICENSE_1_0.txt or copy at
  http://www.boost.org/LICENSE_1_0.txt).
]