optimized implementation of unscaled_covzm