pub fn hermite_function_series<P, E, V, const N: usize, const EXACT_FMA: bool>(
x: V,
coeffs: &[E; N],
) -> VExpand description
Clenshaw summation of a Hermite-function series, $\sum_{k=0}^{N-1} c_k \psi_k(x)$.
Runs Clenshaw over h_k = psi_k / psi_0, whose recurrence is the same as psi_k’s, and
multiplies by psi_0 once at the end. h_k grows like e^{+x^2/2} where psi_k is
O(1), so to keep the same range as hermite_function the coefficients are pre-scaled
by f = e^{-x^2/4} (Clenshaw is linear in them) and the final factor is only
pi^{-1/4} f: the running values stay within e^{+x^2/4} and the outer factor within
e^{-x^2/4}, the same split as the single-function kernel.
y_k = f c_k + sqrt(2/(k+1)) x y_{k+1} - sqrt((k+1)/(k+2)) y_{k+2} k = N-1 down to 1
S = pi^{-1/4} f * (f c_0 + sqrt(2) x y_1 - sqrt(1/2) y_2)