pub fn cosine(a: &[f32], b: &[f32]) -> f32
Cosine similarity in [-1, 1]; 0 if either vector is degenerate or mismatched.