bisection code exercise 3.3