Skip to main content

too_close_for_interpolation

Function too_close_for_interpolation 

Source
pub fn too_close_for_interpolation(x1: f64, x2: f64) -> bool
Expand description

Returns true if x1 and x2 are too close, relative to their magnitude, for numerically stable interpolation.

The threshold scales with max(1, |x1|, |x2|), giving an absolute floor of 2 * f64::EPSILON for small values and a relative bound for large values. linear_weight and quad_polynomial panic when this returns true for their abscissas.