Optimization of Nonlinear Functions via Piecewise Linearization