Module gauss_quad::hermite
source · Expand description
Numerical integration using the Gauss-Hermite quadrature rule.
This rule can integrate integrands of the form
e^(-x^2) * f(x)
over the domain (-∞, ∞).
Example
Integrate x^2 * e^(-x^2)
use gauss_quad::hermite::GaussHermite;
use approx::assert_abs_diff_eq;
let quad = GaussHermite::init(10);
let integral = quad.integrate(|x| x.powi(2));
assert_abs_diff_eq!(integral, core::f64::consts::PI.sqrt() / 2.0, epsilon = 1e-14);
Structs
- A Gauss-Hermite quadrature scheme.