corrected bisection method