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