Would it be possible to use a fused type to support float32 and float64? For instance as done in:

https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/metrics/pairwise_fast.pyx#L24