pub fn temme_y_nu<P, E, V, const NE: usize, const NO: usize>(
nu: V,
x: V,
needed: V::Mask,
t: &LogGamma1p<E, NE, NO>,
) -> (V, V)where
E: FloatElement,
V: FloatVector<Element = E> + TranscendentalMathWithPolicy + SpecializedTranscendentalMath<E>,
P: Policy,Expand description
$(Y_\nu(x), Y_{\nu+1}(x))$ by Temme’s series, for small x and $\lvert\nu\rvert \le 1/2$.
Temme, Journal of Computational Physics vol 21, 343 (1976). Boost’s temme_jy.
§Why this arm exists at all
Steed handles $Y_\nu$ from about x = 0.5 upward, so this is not filling a hole in
accuracy so much as one in cost, and then a hole in accuracy underneath it. Measured,
Steed’s CF2 needs 22 iterations at x = 4, 150 at 0.5, and 5392 at 0.01 (its trip
count grows like $1/x$), and below 0.5 it stops being accurate at all (2400 eps at
x = 0.1, 261000 at 0.01).
Temme, over the same range, is at most 12 terms and 2.19 eps
(notes/special/tools/model_temme.py). So it is both cheaper and better below x = 2,
which is exactly where Boost switches.
§|nu| <= 1/2 is a precondition
Not a suggestion: the series is built around $\Gamma(1\pm\nu)$ near one. The caller
reduces the order and recurs $Y$ upward, which is stable because $Y$ is the dominant
solution.
§Four limits, and why the guards are wide
d, e, g1 and vspv are each $0/0$ at $\nu = 0$ with a finite limit. d is
exactly sinhc and needs no guard. The other three
are selects on $\lvert\nu\rvert < \varepsilon$, wide rather than == 0, matching
Boost. A wide guard costs nothing here: the substituted limit is correct to several
digits well before $\nu$ reaches $\varepsilon$.