let normalized_kernel_to_distance k = fun x y -> let x2 = k x x in let y2 = k y y in (x2 -. 2.0 *. k x y +. y2) /. (x2 *. y2)