pub fn cosine_sim(a: &[f32], b: &[f32]) -> f32
Compute the cosine similarity between two equal-length slices.
Returns 0.0 when either vector has zero magnitude.
0.0