Input: function f, negative and positive arguments x- and x+, xtol, ftol, itmax Begin loop Set x to the average of x- and x+ set old = | x+ - x- | If f(x) is negative, replace x- by x else replace x+ by x set new = | x+ - x- | set alpha = new / old possibly print alpha if new is less than xtol and |f| is less than ftol, success else if it > itmax, failure else repeat End loop Output: updated values of x- and x+ and it