pub fn cosine(a: &[f32], b: &[f32]) -> f32
Cosine similarity of two equal-length vectors (0 when either is zero).