Quasi matrix free preconditioners in optimization and nonlinear least-squares