hankel.qbk 4.7 KB

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