Minimization of functions with discontinuous derivatives and nonlinear constraints