function [N,xN] = hw3afn(x0,x1,tol)

   f0 = hw3f(x0);
   f1 = hw3f(x1);
   N = 1;
   xN = x1;
   while abs(x1-x0) >= tol
      xN = x1-f1*(x1-x0)/(f1-f0);
      x0 = x1;
      f0 = f1;
      x1 = xN;
      f1 = hw3f(xN);
      N = N+1;
   end

end

