pub fn poly_eval(coeffs: &[f64], x: f64) -> f64
Evaluate polynomial at real x using Horner’s method.