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_pomotion_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 Peak Errors In the Hermite Polynomial 80[[Significand Size] [Platform and Compiler] [Errors in range 81 820 < l < 20] ] 83[[53] [Win32, Visual C++ 8] [Peak=4.5 Mean=1.5] ] 84[[64] [Red Hat Linux IA32, g++ 4.1] [Peak=6 Mean=2]] 85[[64] [Red Hat Linux IA64, g++ 3.4.4] [Peak=6 Mean=2] ] 86[[113] [HPUX IA64, aCC A.06.06] [Peak=6 Mean=4]] 87] 88 89Note that the worst errors occur when the degree increases, values greater than 90~120 are very unlikely to produce sensible results, especially in the associated 91polynomial case when the order is also large. Further the relative errors 92are likely to grow arbitrarily large when the function is very close to a root. 93 94[h4 Testing] 95 96A mixture of spot tests of values calculated using functions.wolfram.com, 97and randomly generated test data are 98used: the test data was computed using 99[@http://shoup.net/ntl/doc/RR.txt NTL::RR] at 1000-bit precision. 100 101[h4 Implementation] 102 103These functions are implemented using the stable three term 104recurrence relations. These relations guarentee low absolute error 105but cannot guarentee low relative error near one of the roots of the 106polynomials. 107 108[endsect][/section:beta_function The Beta Function] 109[/ 110 Copyright 2006 John Maddock and Paul A. Bristow. 111 Distributed under the Boost Software License, Version 1.0. 112 (See accompanying file LICENSE_1_0.txt or copy at 113 http://www.boost.org/LICENSE_1_0.txt). 114] 115 116