It seems that the simplest methods often converge the slowest. This certainly seems the case here.
The bisection method
does not use values of
. Only their sign.
However, the values could be exploited.
One way to use values of
is to bias
the search according to value of
: use a weighted
average
Choose
as the
intercept of the secant line through
and
.
pick
, the intercept then
The algorithm is depicted in Figure 15.
is first approximation to
As in bisection, if
or
there must be a root
Suppose
, then
This is the pseudo code for the Regula Falsi method:
User inputs: a,b, max, epsilon
Initialize: iteration = 0
xold = b //to start out
Inside a loop with condition that iteration <=max:
while(iteration <=max)
compute f(a)
compute f(b)
x = a - ((f(a)*(b-a)) / (f(b)-f(a))
increment iteration
Test:
if |x-xold| < epsilon*|x| then
output x
goto stop
else
output (iteration, a, b, x)
xold = x
compute f(x)
if f(a)*f(x) > 0 // here we are testing
// for a positive sign,
// not necessarily the value
a = x
else
b = x
end
end
end
stop
Problem: Stopping criteria (Recall that in bisection we had intervals getting smaller)
Could use
Suppose
this is satisfied by (1)
with
however
actually diverges! MORE LATER.
Suppose
Thus, use