NewCostFunction