The outcome of the optimization is highly dependent on the choice of objective function, which in turn depends on the application. For example, density fitting sets are sometimes optimized to minimize the error in the density, not the energy. We provide standard preconditioner and regularization functions that can be applied in any optimization, in an effort to improve the robustness of the optimization procedure. Typical examples of regularizer are the L 1 -or L 2 -norms. A useful, simple preconditioner is one that ensures that all exponents remain positive and at least a certain ratio apart from each other within each shell.