Skip to main content

inv_langevin

Function inv_langevin 

Source
pub fn inv_langevin<P, E, V, const NF: usize, const NI: usize, const HALLEY: bool, const ONE_MINUS: bool>(
    input: V,
    small: &[E; NF],
    seed_poly: &[E; NI],
) -> V
Expand description

L^-1(y) (or, with ONE_MINUS, L^-1(1 - t) from t directly): seed plus refine_steps of Newton (HALLEY = false) or Halley, see the module docs. Halley’s L'' costs a reciprocal and a few FMAs on top of Newton, which buys f64 a whole second step. f32 is already done after one Newton and would only pay.

The complement is a re-entry point, not a second implementation: the kernel already works in t = 1 - y (the tail seed is 1/t, the large-branch residual consumes t), so ONE_MINUS only changes where t comes from, exact from the caller instead of rounded from y. That is the whole difference between a result conditioned by 1/(1-y) and one accurate to u at any sharpness.

Last built: 2026-09-08 21:35:55 UTC