Gauss-Hermite Quadrature
Description
Gauss-Hermite quadrature formulas are used to integrate functions f(x) e - x² from -infinity to infinity. Let I ( f(x) e - x² ) denote the integral of f(x) e - x² over the entire x-axis. With respect to the inner product < f,g > = I (f(x) g(x) w(x)), the Hermite polynomials H n(x) = (-1)n e x² ( d n / dx n )( e - x² ) for n > 0, and H0(x) = 1 form an orthogonal family of polynomials with weight function w(x) = e - x² on the entire x-axis.
 
For integrating f(x) e - x² over the entire x-axis, the n -point Gauss-Hermite quadrature formula, GHn ( f(x) ), is given by
GHn ( f(x) ) = A1 f(x1) + ··· + An f(xn),where xi , i = 1,...,n, are the zeros of Hn and Ai = 2n+1( n! ) sqrt( PI ) / [ Hn-1 (xi) ] ², i = 1,...,n.
 
The truncation error is I[-1,1] ( f(x) ) - GHn ( f(x) ) = K f (2n)( c ) / ( 2n! ),where K is a constant, and c is some unknown number -1 < c < 1. The constant K is easily determined from K = I[-1,1] ( x 2n ) - GHn ( x 2n ).
Function List
Functions: For n = 2,3,4,5,6,7,8,9,10,12,14,16,20,24,28,32,40,48,56,64,82,96 and 100
 
- double Gauss_Hermite_Integration_n pts(
double (*f)(double) )
 
Integrate (*f)(x) Exp(- x²) from - infinity to infinity where (*f)(x) is the user supplied function.
 
- void Gauss_Hermite_Zeros_n pts( double nodes[])
 
Returns the zeros of the Hermite polynomial Hn(x) in the user allocated array nodes of dimension n.
 
- void Gauss_Hermite_Coefs_n pts( double wght[] )
 
Returns the weights of the Gauss-Hermite formula in the user allocated array wght of dimension n. The i th element of the array wght is the weight which corresponds to the i th node in the array nodes as returned in Gauss_Hermite_Zeros_n pts( double nodes[]).
 
C Source