x  = 1;
tol = 1e-10;
dx = 2*tol;

while abs(dx) > tol
    n += 1;
    dx = cos(x) - x;
    x += dx;
    fprintf("%g %g", n, x)
end
