Clear[x0, x1, x2, f, g, maxits, tol, i];
g[x_] = x - (x^2 - 2)/10/x;
x0 = 1. ;
maxits = 200;
tol = 10^-9;
i = 1;
While[i++ ≤ maxits  &&  
        Abs[g[x0] - x0] > tol, 
x1 = 
        g[x0]; 
x0 = x1; 
Print[
        x0];
]
If[i ≥ maxits,  
        Print["reached maximum iterations"], 
        Print[i]];
Abs[x0 - Sqrt[2]]

Clear[x0, x1, x2, f, g, maxits, tol, i];
g[x_] = x - (x^2 - 2)/10/x;
x0 = 1. ;
maxits = 200;
tol = 10^-9;
i = 1;
While[i++ ≤ maxits  &&  
        Abs[g[x0] - x0] > tol, 
x1 = 
        g[x0]; 
x2 = 
        g[x1]; 
x0hat = (x1^2 - x0*x2)/(2  x1 - x0 - 
              x2); 
x0 = x0hat; 
Print[
        x0hat];
]
If[i ≥ maxits,  
        Print["reached maximum iterations"], 
        Print[i]];
Abs[x0hat - Sqrt[2]]