Creating the Prototype

Let's design the function. What should this function take as its parameters, and what should it return? What value should the function compute?

Click here for the answer

We might also have chosen for bisection to take a tolerance as a third parameter. That is, we might want to be able to specify, as part of each call to bisection, how close f(root) should be to zero. For now, to keep things simpler, let's build the tolerance directly into the function.

Notice also that we are not passing the function f as a parameter, as we did in the Maple implementation. Instead, we are implementing f elsewhere in the program so that it will be directly visible to bisection.

So far, what does our function look like?

Click here for the answer

Joseph L. Zachary
Hamlet Project
Department of Computer Science
University of Utah