format long;
f=inline('2^(-x)');
x0=1.0;
nmax=100;
delta=10^(-10);
   x1 = f(x0);
   n=1;
   fprintf(1,'n            xn         f(xn)\n')
   fprintf(1,'-------------------------------\n')
   while (nmax > n) && (abs(x1-x0)>delta)
       fprintf(1,'%d %8.16f %8.16f \n',n,x0,x1)
       n=n+1;
       x0=x1;
       x1=f(x0);
   end
   fprintf('Approximate root: %8.16f\n',x1);
