• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1[section:hankel Hankel Functions]
2[section:cyl_hankel Cyclic Hankel Functions]
3
4[h4 Synopsis]
5
6   template <class T1, class T2>
7   std::complex<``__sf_result``> cyl_hankel_1(T1 v, T2 x);
8
9   template <class T1, class T2, class ``__Policy``>
10   std::complex<``__sf_result``> cyl_hankel_1(T1 v, T2 x, const ``__Policy``&);
11
12   template <class T1, class T2>
13   std::complex<``__sf_result``> cyl_hankel_2(T1 v, T2 x);
14
15   template <class T1, class T2, class ``__Policy``>
16   std::complex<``__sf_result``> cyl_hankel_2(T1 v, T2 x, const ``__Policy``&);
17
18
19[h4 Description]
20
21The functions __cyl_hankel_1 and __cyl_hankel_2 return the result of the
22[@http://dlmf.nist.gov/10.2#P3 Hankel functions] of the first and second kind respectively:
23
24[expression ['cyl_hankel_1(v, x) = H[sub v][super (1)](x) = J[sub v](x) + i Y[sub v](x)]]
25
26[expression ['cyl_hankel_2(v, x) = H[sub v][super (2)](x) = J[sub v](x) - i Y[sub v](x)]]
27
28where:
29
30['J[sub v](x)] is the Bessel function of the first kind, and ['Y[sub v](x)] is the Bessel function of the second kind.
31
32The return type of these functions is computed using the __arg_promotion_rules
33when T1 and T2 are different types.  The functions are also optimised for the
34relatively common case that T1 is an integer.
35
36[optional_policy]
37
38Note that while the arguments to these functions are real values, the results are complex.
39That means that the functions can only be instantiated on types `float`, `double` and `long double`.
40The functions have also been extended to operate over the whole range of ['v] and ['x]
41(unlike __cyl_bessel_j and __cyl_neumann).
42
43[h4 Performance]
44
45These functions are generally more efficient than two separate calls to the underlying Bessel
46functions as internally Bessel J and Y can be computed simultaneously.
47
48[h4 Testing]
49
50There are just a few spot tests to exercise all the special case handling - the bulk of the testing is done
51on the Bessel functions upon which these are based.
52
53[h4 Accuracy]
54
55Refer to __cyl_bessel_j and __cyl_neumann.
56
57[h4 Implementation]
58
59For ['x < 0] the following reflection formulae are used:
60
61[@http://functions.wolfram.com/Bessel-TypeFunctions/BesselJ/16/01/01/ [equation hankel1]]
62
63[@http://functions.wolfram.com/Bessel-TypeFunctions/BesselY/16/01/01/ [equation hankel2]]
64
65[@http://functions.wolfram.com/Bessel-TypeFunctions/BesselY/16/01/01/ [equation hankel3]]
66
67Otherwise the implementation is trivially in terms of the Bessel J and Y functions.
68
69Note however, that the Hankel functions compute the Bessel J and Y functions simultaneously,
70and therefore a single Hankel function call is more efficient than two Bessel function calls.
71The one exception is when ['v] is a small positive integer, in which case the usual Bessel function
72routines for integer order are used.
73
74[endsect] [/section:cyl_hankel Cyclic Hankel Functions]
75
76[section:sph_hankel Spherical Hankel Functions]
77
78[h4 Synopsis]
79
80   template <class T1, class T2>
81   std::complex<``__sf_result``> sph_hankel_1(T1 v, T2 x);
82
83   template <class T1, class T2, class ``__Policy``>
84   std::complex<``__sf_result``> sph_hankel_1(T1 v, T2 x, const ``__Policy``&);
85
86   template <class T1, class T2>
87   std::complex<``__sf_result``> sph_hankel_2(T1 v, T2 x);
88
89   template <class T1, class T2, class ``__Policy``>
90   std::complex<``__sf_result``> sph_hankel_2(T1 v, T2 x, const ``__Policy``&);
91
92
93[h4 Description]
94
95The functions __sph_hankel_1 and __sph_hankel_2 return the result of the
96[@http://dlmf.nist.gov/10.47#P1 spherical Hankel functions] of the first and second kind respectively:
97
98[equation hankel4]
99
100[equation hankel5]
101
102The return type of these functions is computed using the __arg_promotion_rules
103when T1 and T2 are different types.  The functions are also optimised for the
104relatively common case that T1 is an integer.
105
106[optional_policy]
107
108Note that while the arguments to these functions are real values, the results are complex.
109That means that the functions can only be instantiated on types `float`, `double` and `long double`.
110The functions have also been extended to operate over the whole range of ['v] and ['x]
111(unlike __cyl_bessel_j and __cyl_neumann).
112
113[h4 Testing]
114
115There are just a few spot tests to exercise all the special case handling - the bulk of the testing is done
116on the Bessel functions upon which these are based.
117
118[h4 Accuracy]
119
120Refer to __cyl_bessel_j and __cyl_neumann.
121
122[h4 Implementation]
123
124These functions are trivially implemented in terms of __cyl_hankel_1 and __cyl_hankel_2.
125
126[endsect] [/section:sph_hankel Spherical Hankel Functions]
127
128[endsect] [/section:hankel Hankel Functions]
129
130
131[/
132  Copyright 2012 John Maddock.
133  Distributed under the Boost Software License, Version 1.0.
134  (See accompanying file LICENSE_1_0.txt or copy at
135  http://www.boost.org/LICENSE_1_0.txt).
136]
137