INTRO: Improving the Bisection Code
In the last lecture, we talked about the bisection method, a
simple procedure that slowly squeezes the uncertainty out of an
estimate for the solution of a nonlinear equation, assuming we were
able to bracket the solution, that is, find a negative and positive
function value, so that a crossing must occur in between.
We created a C++ function, bisect1.cpp, to carry out this
procedure. This meant the user had to write a C++ function to be
used by the bisection procedure. And so we had to pick one name
for that function and stick with it. We will see a simple way of
allowing the user to use any name for the function, just like the
user can have any name for the input variables to a function.
4 / 1