// Integrate an odd number of at least three equally spaced samples with composite Simpson weights. Invalid grids return zero. pub fn simpson_uniform(ys: vector, spacing: f64) -> f64 { if len(ys)<3 || len(ys)%2 == 0 || spacing <= 0.0 { return 0.0; } let mut s = at(ys,0)+at(ys,len(ys)-1); let mut i = 1; while i