SMS dit: The approximate minimization of functionals