pub fn hermite_prob<F: Float + FromPrimitive + Debug>(n: usize, x: F) -> F
Expand description
Computes the value of the Hermite function (probabilists’ Hermite polynomial) He_n(x).
Probabilists’ Hermite polynomials He_n(x) differ from the physicists’ version H_n(x) and are related by He_n(x) = 2^(-n/2) H_n(x/√2).
These polynomials are orthogonal with respect to the weight function w(x) = e^(-x²/2).
§Arguments
n
- Degree of the polynomial (non-negative integer)x
- Point at which to evaluate the polynomial
§Returns
- Value of He_n(x)
§Examples
use scirs2_special::hermite_prob;
// He₀(x) = 1
assert!((hermite_prob(0, 0.5f64) - 1.0).abs() < 1e-10);
// He₁(x) = x
assert!((hermite_prob(1, 0.5f64) - 0.5).abs() < 1e-10);
// He₂(x) = x² - 1
assert!((hermite_prob(2, 0.5f64) - (-0.75)).abs() < 1e-10);