nMax = 2; beta = SetAccuracy 1, 2000 ;
gamma = SetAccuracy 0, 2000 ;
For j = 1, j <= NumberOfGuesses, j++,
 {x = SetAccuracy initialValues j , 2000 ,
   Do
  fx = SetAccuracy f x , 2000 ;
  k = SetAccuracy x + beta fx, 2000 ;
  fk = SetAccuracy f k , 2000 ;
  FD = SetAccuracy (fk - fx)/(beta fx), 2000 ;
  y = SetAccuracy x - fx/FD, 2000 ;
  fy = SetAccuracy f y , 2000 ;
  z = SetAccuracy y - (fy/FD)*(1 + ((2 + beta FD)/(1
      + beta FD)) (fy/fx)), 2000 ;
  fz = SetAccuracy f z , 2000 ;
  FDxz = SetAccuracy (fz - fx)/(z - x), 2000 ;
  FDxy = SetAccuracy (fx - fy)/(x - y), 2000 ;
  FDxk = SetAccuracy (fk - fx)/(k - x), 2000 ;
  x = SetAccuracy z - fz/(FDxz + ((FDxk - FDxy)/(k - y)
     - (FDxk - FDxz)/(k - z)
     - (FDxy - FDxz)/(y - z))*(x - z)
+ gamma (z - x)*(z - k)*(z - y)), 2000 ;
  , {n, nMax ;
Print Column
   N x, 128 ,
   N f x
, Background -> LightGreen, LightGray ,
Frame -> True]];
 }
];
Algorithm 4: