Make default CostEvaluator work with arbitrary numeric types