A Ricocheting Gradient Method for Nonlinear Optimization