Key word is non-differentiable optimization. That's what generic algorithms were traditionally good at.