An efficient algorithm for solving nonlinear equations with a minimal number of trial vectors: applications to atomic-orbital based coupled-cluster theory.