var real x0 = (a + b) / 2 var integer iterations = 0 while not_close_to_zero( f(x0) ) do x0 = x0 - (f(x0) / f_prime(x0) ) iterations += 1 return x0, f(x0), iterations