%Iteration function on (omega*e^-x_n+x)/(1+omega)
%
function [n,x]=iterate2(initial_guess,tolerance,omega)
x0 = initial_guess;
n =1;
differ = 1;
while (differ > tolerance)
x_n1 = f(x0,omega);
differ = abs(x_n1-x0);
n = n+1;
x0 = x_n1;
end
x = x_n1;

function y=f(x,omega)
y = (omega*exp(-x) + x)/(1+omega);
