Add StdCostFunction.