On the minimization of nondifferentiable functions