hermite.qbk 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. [section:hermite Hermite Polynomials]
  2. [h4 Synopsis]
  3. ``
  4. #include <boost/math/special_functions/hermite.hpp>
  5. ``
  6. namespace boost{ namespace math{
  7. template <class T>
  8. ``__sf_result`` hermite(unsigned n, T x);
  9. template <class T, class ``__Policy``>
  10. ``__sf_result`` hermite(unsigned n, T x, const ``__Policy``&);
  11. template <class T1, class T2, class T3>
  12. ``__sf_result`` hermite_next(unsigned n, T1 x, T2 Hn, T3 Hnm1);
  13. }} // namespaces
  14. [h4 Description]
  15. The return type of these functions is computed using the __arg_promotion_rules:
  16. note than when there is a single template argument the result is the same type
  17. as that argument or `double` if the template argument is an integer type.
  18. template <class T>
  19. ``__sf_result`` hermite(unsigned n, T x);
  20. template <class T, class ``__Policy``>
  21. ``__sf_result`` hermite(unsigned n, T x, const ``__Policy``&);
  22. Returns the value of the Hermite Polynomial of order /n/ at point /x/:
  23. [equation hermite_0]
  24. [optional_policy]
  25. The following graph illustrates the behaviour of the first few
  26. Hermite Polynomials:
  27. [graph hermite]
  28. template <class T1, class T2, class T3>
  29. ``__sf_result`` hermite_next(unsigned n, T1 x, T2 Hn, T3 Hnm1);
  30. Implements the three term recurrence relation for the Hermite
  31. polynomials, this function can be used to create a sequence of
  32. values evaluated at the same /x/, and for rising /n/.
  33. [equation hermite_1]
  34. For example we could produce a vector of the first 10 polynomial
  35. values using:
  36. double x = 0.5; // Abscissa value
  37. vector<double> v;
  38. v.push_back(hermite(0, x)).push_back(hermite(1, x));
  39. for(unsigned l = 1; l < 10; ++l)
  40. v.push_back(hermite_next(l, x, v[l], v[l-1]));
  41. Formally the arguments are:
  42. [variablelist
  43. [[n][The degree /n/ of the last polynomial calculated.]]
  44. [[x][The abscissa value]]
  45. [[Hn][The value of the polynomial evaluated at degree /n/.]]
  46. [[Hnm1][The value of the polynomial evaluated at degree /n-1/.]]
  47. ]
  48. [h4 Accuracy]
  49. The following table shows peak errors (in units of epsilon)
  50. for various domains of input arguments.
  51. Note that only results for the widest floating point type on the system are
  52. given as narrower types have __zero_error.
  53. [table_hermite]
  54. Note that the worst errors occur when the degree increases, values greater than
  55. ~120 are very unlikely to produce sensible results, especially in the associated
  56. polynomial case when the order is also large. Further the relative errors
  57. are likely to grow arbitrarily large when the function is very close to a root.
  58. [h4 Testing]
  59. A mixture of spot tests of values calculated using functions.wolfram.com,
  60. and randomly generated test data are
  61. used: the test data was computed using
  62. [@http://shoup.net/ntl/doc/RR.txt NTL::RR] at 1000-bit precision.
  63. [h4 Implementation]
  64. These functions are implemented using the stable three term
  65. recurrence relations. These relations guarantee low absolute error
  66. but cannot guarantee low relative error near one of the roots of the
  67. polynomials.
  68. [endsect][/section:beta_function The Beta Function]
  69. [/
  70. Copyright 2006 John Maddock and Paul A. Bristow.
  71. Distributed under the Boost Software License, Version 1.0.
  72. (See accompanying file LICENSE_1_0.txt or copy at
  73. http://www.boost.org/LICENSE_1_0.txt).
  74. ]