pub fn slice_dot(a: &[f64], b: &[f64]) -> Result<f64, String>
Dot product of two equal-length slices.