clear;clc;
[n,x] = iterate(1,eps);
fprintf('\n\t\tFixed-Point Iteration\n')
fprintf('\t\tx = exp(-x)\n')
fprintf('\tIterations \t Value\n')
fprintf('\t%3.0f \t\t %1.16f\n',n,x)
[n,x] = iterate2(1,eps,2);
fprintf('\n\t\tFixed-Point Iteration\n')
fprintf('\t\tx = (w*exp(-x)+x)/(1+w)\n')
fprintf('\t\t\t w = 2\n')
fprintf('\tIterations \t Value\n')
fprintf('\t%3.0f \t\t %1.16f\n',n,x)
[n,x] = iterate2(1,eps,1.763222834351897);
fprintf('\n\t\tFixed-Point Iteration\n')
fprintf('\t\tx = (w*exp(-x)+x)/(1+w)\n')
fprintf('\t\t w = 1.763222834351897\n')
fprintf('\tIterations \t Value\n')
fprintf('\t%3.0f \t\t %1.16f\n',n,x)
