pub fn pos_search(x: f64, xs: &[f64]) -> usize
Finds the position for interpolation in a sorted array.
Returns the index of the largest element in xs that is less than x, clamped to the valid range [0, xs.len() - 1].
xs
x
[0, xs.len() - 1]