pub fn bessel_i_ratio_1m_impl<P, E, V>(x: V, nu: V) -> Vwhere
P: Policy,
E: FloatElement,
V: FloatVector<Element = E> + PrimalProjection<Primal = V> + SpecializedSpecialMath<E>,Expand description
1 - A_nu(x), the complement of the ratio, accurate where A is within an ulp of 1.
For x >= max(8 nu, 20) the complement is evaluated directly. The order is reduced to
nu_0 = nu - K in [1, 2), where the Hankel expansions of I_{nu_0} and I_{nu_0 - 1}
converge to e^{-2x} (their smallest term is at k ~ 2x, 40 terms at x = 20, and
the difference of the two series is formed term by term, so 1 - N/D is never
evaluated), then the ratio recurrence A_{m+1} = 1/A_m - 2m/x written for the
complement, c_{m+1} = 2m/x - c_m/(1 - c_m), walks the K orders up. The two terms
of that step are (2m)/x and about (2m-1)/(2x), so the subtraction costs a bit and
the walk is stable as long as c stays small, which x >= 8 nu guarantees at every
intermediate order. Elsewhere c = 1 - A from the forward: below x = 8 nu the
complement is at least 1/8 and 1 - A is within 8 eps. In the corner 8 nu <= x < 20
(only nu < 2.5) it is within 2x eps / (2 nu - 1), forty ulp at worst.
A is odd, so c(-x) = 2 - c(x).