fn trapezoidal_integral(curve: &[(i64, f32)]) -> f64
Trapezoidal rule integration of a (timestamp, value) curve.