var real x0 = (a * f(b) - b * f(a)) / (f(b) - f(a)) var integer iterations = 0 while not_close_to_zero( f(x0) ) do if f(a) * f(x0) < 0 then b = x0 else a = x0 x0 = (a * f(b) - b * f(a)) / (f(b) - f(a)) iterations += 1 return x0, f(x0), iterations