Functions to compute Hermite polynomials using three-term recurrence relations.
Hermite polynomials are orthogonal polynomials that appear in probability theory (as derivatives of the Gaussian function), quantum mechanics (quantum harmonic oscillator), and numerical analysis.
Hermite Polynomials H_n(x):
hermite(n, x): Evaluates the Hermite polynomial of degree n at point xOrthogonal with respect to the weight function $$e^{-x^2}$$ on (-Inf, Inf)
Appear as eigenfunctions of the quantum harmonic oscillator
Recurrence Relation:
hermite_next(n, x, Hn, Hnm1): Computes $$H_{n+1}(x)$$ from H_n and $$H_{n-1}$$Uses stable three-term recurrence for sequential computation
Implementation Notes:
Guarantees low absolute error but not low relative error near polynomial roots
Values greater than ~120 for n are unlikely to produce sensible results
Relative errors may grow arbitrarily large when the function is very close to a root
See also
Boost Documentation for more details on the mathematical background.