Make cost function linear.