
Solving Equations 97
a
0
a
1
a
2
b
a
b
0
f(b
0
)
f(a
0
)
f(a
1
)
f(a
2
)
f(b
1
)
f(b
2
)
x
∗
c
0
b
1
c
1
b
2
FIGURE 4.4: An illustration of the regula-falsi method.
Algorithm 4.2 Regula-falsi method for solving f(x)=0.
Input: f,, a, b such that f (a)f (b) < 0
Output: ¯x such that |f(¯x)| <
1: k =0,a
0
= a, b
0
= b, c
0
=
a
0
f(b
0
)−b
0
f(a
0
)
f(b
0
)−f(a
0
)
2: repeat
3: k = k +1
4: if f (a
k−1
)f(c
k−1
) ≤ 0 then
5: if f(c
k−1
)=0then
6: return ¯x = c
k−1
7: end if
8: a
k
= a
k−1
,b
k
= c
k−1
9: else
10: a
k
= c
k−1
,b
k
= b
k−1
11: end if
12: c
k
=
a
k
f(b
k
)−b
k
f(a
k
)
f(b
k
)−f(a
k
)
13: until |f(c
k
)| <
14: return ¯x = c
k
search interval converges to the root x
∗
, whereas the other endpoint of the
search interval always remains the same. For