N = 100;
x = ones(N,1);
tol = [1e-6,1e-6];
[sol, it_hist, ierr] = nsolgm(x,@f,tol,[40,40,-0.1]);
semilogy(it_hist(:,2),it_hist(:,1)/it_hist(1,1),'o-.');
xlabel('Function Evaluations');
ylabel('Relative Nonlinear Residual');