%Iteration function on e^-x_n
%
function [n,x]=iterate(initial_guess,tolerance)
x0 = initial_guess;
n =1;
differ = 1;

while (differ > tolerance)
x_n1 = f(x0);
differ = abs(x_n1-x0);
n = n+1;
x0 = x_n1;
end
x = x_n1;

function y=f(x)
y = exp(-x);
