2 [section:hankel Hankel Functions]
3 [section:cyl_hankel Cyclic Hankel Functions]
7 template <class T1, class T2>
8 std::complex<``__sf_result``> cyl_hankel_1(T1 v, T2 x);
10 template <class T1, class T2, class ``__Policy``>
11 std::complex<``__sf_result``> cyl_hankel_1(T1 v, T2 x, const ``__Policy``&);
13 template <class T1, class T2>
14 std::complex<``__sf_result``> cyl_hankel_2(T1 v, T2 x);
16 template <class T1, class T2, class ``__Policy``>
17 std::complex<``__sf_result``> cyl_hankel_2(T1 v, T2 x, const ``__Policy``&);
22 The functions __cyl_hankel_1 and __cyl_hankel_2 return the result of the
23 [@http://dlmf.nist.gov/10.2#P3 Hankel functions] of the first and second kind respectively:
25 [:['cyl_hankel_1(v, x) = H[sub v][super (1)](x) = J[sub v](x) + i Y[sub v](x)]]
27 [:['cyl_hankel_2(v, x) = H[sub v][super (2)](x) = J[sub v](x) - i Y[sub v](x)]]
31 ['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.
33 The return type of these functions is computed using the __arg_promotion_rules
34 when T1 and T2 are different types. The functions are also optimised for the
35 relatively common case that T1 is an integer.
39 Note that while the arguments to these functions are real values, the results are complex.
40 That means that the functions can only be instantiated on types `float`, `double` and `long double`.
41 The functions have also been extended to operate over the whole range of ['v] and ['x]
42 (unlike __cyl_bessel_j and __cyl_neumann).
46 These functions are generally more efficient than two separate calls to the underlying Bessel
47 functions as internally Bessel J and Y can be computed simultaneously.
51 There are just a few spot tests to exercise all the special case handling - the bulk of the testing is done
52 on the Bessel functions upon which these are based.
56 Refer to __cyl_bessel_j and __cyl_neumann.
60 For ['x < 0] the following reflection formulae are used:
62 [@http://functions.wolfram.com/Bessel-TypeFunctions/BesselJ/16/01/01/ [equation hankel1]]
64 [@http://functions.wolfram.com/Bessel-TypeFunctions/BesselY/16/01/01/ [equation hankel2]]
66 [@http://functions.wolfram.com/Bessel-TypeFunctions/BesselY/16/01/01/ [equation hankel3]]
68 Otherwise the implementation is trivially in terms of the Bessel J and Y functions.
70 Note however, that the Hankel functions compute the Bessel J and Y functions simultaneously,
71 and therefore a single Hankel function call is more efficient than two Bessel function calls.
72 The one exception is when ['v] is a small positive integer, in which case the usual Bessel function
73 routines for integer order are used.
78 [section:sph_hankel Spherical Hankel Functions]
82 template <class T1, class T2>
83 std::complex<``__sf_result``> sph_hankel_1(T1 v, T2 x);
85 template <class T1, class T2, class ``__Policy``>
86 std::complex<``__sf_result``> sph_hankel_1(T1 v, T2 x, const ``__Policy``&);
88 template <class T1, class T2>
89 std::complex<``__sf_result``> sph_hankel_2(T1 v, T2 x);
91 template <class T1, class T2, class ``__Policy``>
92 std::complex<``__sf_result``> sph_hankel_2(T1 v, T2 x, const ``__Policy``&);
97 The functions __sph_hankel_1 and __sph_hankel_2 return the result of the
98 [@http://dlmf.nist.gov/10.47#P1 spherical Hankel functions] of the first and second kind respectively:
104 The return type of these functions is computed using the __arg_promotion_rules
105 when T1 and T2 are different types. The functions are also optimised for the
106 relatively common case that T1 is an integer.
110 Note that while the arguments to these functions are real values, the results are complex.
111 That means that the functions can only be instantiated on types `float`, `double` and `long double`.
112 The functions have also been extended to operate over the whole range of ['v] and ['x]
113 (unlike __cyl_bessel_j and __cyl_neumann).
117 There are just a few spot tests to exercise all the special case handling - the bulk of the testing is done
118 on the Bessel functions upon which these are based.
122 Refer to __cyl_bessel_j and __cyl_neumann.
126 These functions are trivially implemented in terms of __cyl_hankel_1 and __cyl_hankel_2.
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).