Computation of Gauss-Hermite quadrature rule nodes and weights
|
The Gauss-Hermite quadrature formula is used to numerically calculate the integral by using the formula
We can also get onto the integral by using a change of variables which will also change both nodes x and weights w. But we will consider the simplest case only. If you perform a change of variables, you should take into account that the formula of error term En is changed along with the nodes and weights (you can get a new form by changing the variables in the formula).
The Gauss-Hermite quadrature formula for each number of points is completely defined by the set of nodes xi and weights wi . The algorithm finds these numbers.
Algorithm of nodes and weights calculation
The closed form of the nodes and weights is known only for a small n. Generally, we have to find them numerically. The integration nodes for the n points formula are found as a root of the Hermite polynomial of order n. The root search is an iterative process. An initial approximation is selected for each root and then the roots are found by using the Newton method. Therefore, the bigger n was selected, the bigger order the Hermite polynomial has, and more time is required to find a root with the desired accuracy. The recurrence formula for Hermite polynomials calculation has the following form:
H-1 = 0
H0 = 1
Hj+1 = 2xHj -2jHj-1
After calculating xi (roots of the Hermite polynomials of n-th order) weights wi are calculated by using the following formula:

Error term
The formula with n points is accurate for the polynomials of order 2n-1 and lower. Error term En is:

Subroutine description
The algorithm gets as the input
- n - a required number of nodes. 1 ≤ n ≤ 190. If n > 190, the initial approximations for the roots of the Hermite polynomial of the n-th order could not provide a convergence to the different roots. That leads to getting a wrong nodes and weights.
The algorithm returns:
- x - array of nodes. Its index ranges within 0 and n-1.
- w - array of weighting coefficients. Its index ranges between 0 and n-1.
The source code was designed by using information from the QUADRULE library.
Links- Eric W. Weisstein. "Hermite-Gauss Quadrature." From MathWorld--A Wolfram Web Resource
Report a bug
C#
C# 1.0 source.
gqgenhermite.csharp.zip - Computation of Gauss-Hermite quadrature rule nodes and weights
C++
C++ source.
gqgenhermite.cpp.zip - Computation of Gauss-Hermite quadrature rule nodes and weights
ablas.zip - optimized basic linear algebra subroutines with SSE2 support (for C++ sources only)
C++, multiple precision arithmetic
C++ source. MPFR/GMP is used.
GMP source is available from gmplib.org. MPFR source is available from www.mpfr.org.
gqgenhermite.mpfr.zip - Computation of Gauss-Hermite quadrature rule nodes and weights
mpfr.zip - precompiled Win32 MPFR/GMP binaries
Delphi
Delphi source.
Can be compiled under FPC (in Delphi compatibility mode).
gqgenhermite.delphi.zip - Computation of Gauss-Hermite quadrature rule nodes and weights
Visual Basic 6
Visual Basic 6 source.
gqgenhermite.vb6.zip - Computation of Gauss-Hermite quadrature rule nodes and weights
Zonnon beta
Zonnon source.
Zonnon is an experimental language developed at ETH Zurich.
See www.zonnon.ethz.ch for more information.
gqgenhermite.zonnon.zip - Computation of Gauss-Hermite quadrature rule nodes and weights
|