FIX for MSVC inline fmin, fmax and log2
FIX for MSVC inline fmax in dist_metrics