Skip to main content

Module gaussian_quadrature

Module gaussian_quadrature 

Source
Expand description

Gaussian quadrature rules: Gauss-Legendre, Gauss-Hermite and generalized Gauss-Laguerre.

An n-point Gauss rule integrates w(x) p(x) exactly for every polynomial p of degree up to 2n − 1. Nodes are the zeros of the orthogonal polynomial of degree n, found by Newton’s method on the three-term recurrence from asymptotic starting guesses (as in Numerical Recipes), so rules with hundreds of points are cheap and accurate to rounding.

Structs§

GaussLegendreEngine
Integrates f over [a, b] with a fixed n-point Gauss-Legendre rule.
QuadratureRule
Nodes and weights of a quadrature rule.

Functions§

gauss_hermite
The n-point Gauss-Hermite rule for ∫_{−∞}^{∞} e^{−x²} f(x) dx (physicists’ weight), nodes ascending. For the probabilists’ weight e^{−x²/2} scale nodes by √2 and weights by √2.
gauss_laguerre
The n-point generalized Gauss-Laguerre rule for ∫_0^∞ x^α e^{−x} f(x) dx (α > −1), nodes ascending.
gauss_legendre
The n-point Gauss-Legendre rule for ∫_{−1}^{1} f(x) dx, nodes ascending.