Brents Method
Brents Method
1. Introduction
In a recent paper, Alefeld and Potra [2] proposed three efficient methods
for enclosing a simple zero x* of a continuous function f(x) in the interval
[a, b] provided that f(a)f(b) < 0. Starting with the initial enclosing interval
[a\ ,b\] = [a, b], the methods produce a sequence of intervals {[a„, bn]}™=l
such that
(1) x, £[an+i, bn+l]ç[a„, bn] ç ••■ç [ai, bi] = [a, b],
The asymptotic efficiency indices of each of those three methods, in the sense of
Ostrowski[10], are s/1 = 1.4142..., \ß = 1.5874... , and y/(3 + ^/U)/2 =
1.4892... , respectively. The numerical experiments in that paper show that
the practical behavior of those methods is comparable to that of the efficient
equation solvers of Dekker [6] and Brent [5], although they perform slightly
worse on some problems.
Although there are many enclosing methods for solving the equation
(3) f(x) = 0,
where f(x) is continuous on [a, b] and has a simple root x» in [a, b], most
of them do not have nice asymptotic convergence properties of the diameters
{(b„ -an)}^=l. For example, in case of Dekker's method, the diameters b„ - a„
may remain greater than a relative large positive quantity until the last iteration
Received by the editor June 26, 1991 and, in revised form, June 24, 1992.
1991 Mathematics Subject Classification. Primary 65H05.
©1993 American Mathematical Society
0025-5718/93 $1.00+ $.25 per page
733
when a " ¿-step" is taken. In case of Le's Algorithm LZ4 of [8], the conver-
gence properties of {(bn - a„)}%L, have not been proved except that the total
number of function evaluations will be bounded by four times that needed by
the bisection method, which is also the upper bound of the number of function
evaluations required by our second method in this paper. For other examples,
like Brent's method, the Illinois method, the Anderson-Björck method, the Reg-
ula Falsi method, Snyder's method, the Pegasus method, and so on, only the
convergence rate of {|x„ -x»|}~ ,, where x„ is the current estimate of x», has
been studied and not the convergence rate of the diameters (b„ - an).
In case f(x) is convex on [a, b], the classical Newton-Fourier method [10,
p. 248], J. W. Schmidt's method [12], and the methods of Alefeld and Potra
[1] produce a sequence of enclosing intervals whose diameters are superlinearly
convergent to zero. The highest asymptotic efficiency index of those methods,
1.5537... , is attained by a method of J. W. Schmidt [12] and a slight modifi-
cation of this method due to Alefeld and Potra [1].
In the paper of Alefeld and Potra [2] three iterative methods are proposed that
produce enclosing intervals satisfying (1) and (2) without any convexity assump-
tions on /. Surprisingly enough, under appropriate smoothness assumptions,
one of the methods of [2] has the efficiency index 1.5874... , which is higher
than the efficiency index of the above-mentioned method of J. W. Schmidt [12].
In the present paper two new algorithms for enclosing zeros of nonconvex
functions are presented. Our first method requires at most 3, while our second
method requires at most 4 function evaluations per step. Both methods reduce
the length of the enclosing interval by at least one half at each step, so that in
the worst case scenario our methods require 3 times, respectively 4 times, more
function evaluations than the bisection method. As the bisection method, or
the methods of Brent [5], Dekker [6], or Le [8, 9], our methods are applicable
to rather general problems involving discontinuous functions and derivatives,
multiple zeros, etc. (see Theorem 3.1). However, in case of simple zeros of
C3-functions we can prove that, asymptotically, our first method requires only
2, and our second method only 3 function evaluations per step. Moreover, in
this case the sequence of diameters {(bn - an)}%>=lconverges to zero with R-
order at least 1 + \[2 = 2.414... for our first method, and 7?-order at least
2 + \/5 = 4.236... for our second method. Hence the corresponding efficiency
indicesare \/l + V2 = 1.5537... and y/ÏTTs = (1 + v%)/2 = 1.618... ,
respectively. As far as we know, the latter is the highest efficiency index for
iterative methods that produce monotone enclosing intervals for simple zeros
of sufficiently smooth functions.
This paper improves the results of [2] in two ways. First, by making better use
of available information, we obtain a higher efficiency index. Second, our new
algorithms do not use the exact solution of a quadratic equation at each step.
Instead, we use 2 or 3 Newton steps to get a convenient approximation. This
modification saves the work of computing the square root, makes the subroutine
program much simpler, and preserves the good convergence properties. For
convenience of comparison, we list the three algorithms of [2] in the Appendix
of this paper.
In our numerical experiments we compared our methods with the methods in
[2], with the methods of Dekker [6] and Brent [5] which are used in many stan-
dard software packages, and also with the Algorithm LZ4 of Le [8]. The results
are presented in §5. The numerical results show that the two methods of the
present paper compare well with the other six methods. The second method in
this paper has the best behavior of all, especially when the termination tolerance
is small.
In §6, we show that in a certain sense our second method is an optimal
procedure.
After calling the above subroutine, we will have a new interval [ä, b] c [a, b]
with f(a)f(b) < 0. Furthermore, we will have a point d &[ä, b] such that if
d < â then f(a)f(d) > 0 ; otherwise f(d)f(b) > 0.
Subroutine Newton-Quadratic(a, b, d, r, k).
Set A = f[a,b,d], B = f[a,b];
If /I = 0, then r = a-B~x-f(a);
If A ' f(a) > 0, then r0 = a, else r0 = b;
For i = 1, 2, ... , k do:
(A) r-r P{ri~x) -r P^~l)
W r¡ - ri-i - snz—T - r*-i _
P'in.t) '-' B + A(2ri_l-a-b)'
r = rk. D
and \P'(x)\ > ô > 0 for all x £ [a, b]. Indeed, we have that
(6) \rk-z\ = |r*_i - z|2—J^L < ^_, _ z\2k < XL\r0- zf,
3. Algorithms
In this section we present two algorithms for enclosing a simple zero x* of
a continuous function f(x) in [a, b] where f(a)f(b) < 0. These two algo-
rithms are improvements of the methods in [2]. The first algorithm requires at
most 3, and asymptotically 2, function evaluations per iteration, and the sec-
ond algorithm requires at most 4, and asymptotically 3, function evaluations
per iteration. Under certain assumptions the first algorithm has an asymptotic
efficiency index Vl-h/2 = 1.5537... and the second algorithm has an asymp-
totic index (1 + •v/5)/2= v2 + \/5 = 1.6180... . In the following algorithms,
p < 1 is a positive parameter which is usually chosen as p = 0.5.
Algorithm 1.
1.1 set ax =a, b\=b, C\ = ax - f[ait b\]-xf(a\);
1.2 call bracket(a\ ,b\,c\,a2,b2, d2) ;
For » = 2,3,..., do:
1.3 call Newton-Quadratic(an , b„ , d„ , c„ , 2) ;
1.4 call bracket(an ,_bn, c„, an, bn, d„) ;
1.5 if \f(ä~n)\ < \f(bn)\ > then set un — a„ , else set un = bn\
1.6 set cn = un - 2f[äj,, b~„]-xf(un) ;
1.7 if \c„ - u„\ > 0.5(b„ - an), then c„ = 0.5(b„ + an), else cn = cn ;
1.8 call bracket(a„, b„ , cn , än , b„ , d„) ;
1.9 if b„ - än <p(b„ - an), then an+\ = ân , b„+i = bn , dn+l = dn , else call
bracket(an , b„ , 0.5(â„ + b„), an+\, bn+\, dn+x). D
Algorithm 2.
2.1-2.2: same as 1.1-1.2;
For n = 2,3, ... , do :
2.3 call Newton-Quadratic(an , bn , dn , c„ , 2) ;
2.4 call bracket(an , bn , cn, an , bn , dn) ;
2.5 call Newton-Quadratic(än ,b„,d„,c„,3);
2.6 call bracket(an , bn, cn,an, b„, dn);
2.7-2.11: same as 1.5-1.9. D
The following theorem is a basic property of the above two algorithms, whose
proof is straightforward and hence will be omitted.
Theorem 3.1. Let f be a real function defined on [a, b] suchthat f(a)f(b) < 0,
and consider one of the Algorithms 1 or 2. Then either a zero of f is found in
a finite number of steps, or an infinite sequence of intervals [an, bn] is produced
such that
f(an)f(bn)<\,
an < an+\ < b„+i < b„,
b„+\ -an+\ < \(b„ -an),
lim an = x* = lim bn ,
n—»oo n—»oo
4. Convergence results
In §3 it is easy to see that the intervals {[a„, b„]}^=l produced by either
Algorithm 1 or Algorithm 2 satisfy that bn+\ - an+i < p\(bn - an) for n>2,
where p\ = max{/j, 0.5} . Since p\ < 1, this shows at least linear convergence.
In what follows we show that under certain smoothness assumptions, Algorithm
1 and Algorithm 2 produce intervals whose diameters {(b„ - an)}™=yconverge
to zero with 7?-orders at least 1 + \/2 = 2.414... and 2 + \/5 = 4.236... ,
respectively.
First, we have the following two lemmas.
Lemma 4.1 (Alefeld and Potra [2]). Assume that f is continuously differentiable
in [a, b] and f(a)f(b) < 0, and x» is a simple zero of f(x) in [a, b]. Suppose
that Algorithm 1 (or Algorithm 2) does not terminate after a finite number of
iterations. Then there is an «3 such that for all n > «3, the quantities cn and
u„ instep 1.6 (or in step 2.8) satisfy that
(7) f(Cn)f(Un) < 0.
Lemma 4.2. Under the assumptions of Lemma 4.1, also assume that f(x) is
three times continuously differentiable on [a, b] ; then
(i) for Algorithm 1, there are an r\ > 0 and an n\ such that for all n > n\
(8) \f{cn)\<rx{bn-a„)2(bn-x-an-ù,
where c„ is defined in step 1.3 ;
(ii) for Algorithm 2, there are an r2>0 and an n2 such that for all n > n2
(9) \f(cn)\<r2(bn-an)\bn-x-an-x),
where c„ is defined in step 2.5.
Proof. By Theorem 3.1, b„ - a„ -> 0 and x» £ (an , bn). Since x» is a simple
root, f'(x*) ^ 0. Therefore, when n is big enough, f'(x) ^ 0 for all x €
[a„ , b„]. For simplicity, we assume that f'(x) ¿ 0 for all x £ [a, b]. Also, it
is easy to see that in both algorithms we have that
bn-an< p(bn-{ - a„-i) < (bn-X - an-i).
Since Xo —mina<x<¿, |/'(x)| > 0 and bn-a„ -> 0, then for any fixed 0 < ô < X0
there is an n\ such that for all n > n\ we have that b„ - a„ < 1 and
(i) For Algorithm 1, when n > n\, suppose zn is the unique zero of
P(a„ , b„ , d„)(x) in [a„ , bn]. Then using the error formula for Lagrange inter-
polation, we see that
1/(2,1)1<Xi\zn -a„\\z„ -b„\\z„ -d„\
< 0.25A,(ô„ - an)2(bn-x - «„_,), where A, = I max \f"(x)\.
"• a<x<b
(12) \ 26n )
<X2(bn-an)2(bn-X-an„{), where¿2=(maXa^l/WI) .
\f(c„)\ < \f(z„)\ + ( max |/'(x)| ) \c„ - zn\ < n(b„ - an)2(b„-X - <%,_,),
\a<x<b J
(16) \f(cn)\ < \f(z„)\ + max |/'(x)| \c„ - z„\ < r2(bn - an)4(bn-l - aH-i)
a<x<b
Theorem 4.3. Under the assumptions of Lemma 4.2, the sequence of diameters
{(bn-a,,)}^ produced by Algorithm 1 converges to zero, and there is an L\ > 0
such that
(17) bn+i -an+i <L{(bn-an)2(bn-x -a«-i), V« = 2, 3, ... .
Moreover, there is an N\ such that for all n> N\ we have
an+i = an and bn+x = b„.
Hence, when n > N\, Algorithm 1 requires only two function evaluations per
iteration.
Proof. As in the proof of Lemma 4.2, we assume without loss of generality that
f'(x) t¿ 0 for all x £ [a, b]. Take Nx such that TV-> max{«i, «3} . Then by
Lemma 4.1, (7) holds for all n > N\. For steps 1.6-1.8 of Algorithm 1 and the
fact that un,cn£ [a~n, bn] we deduce that
(18) b„-â„ < \c„-u„\, V«>/Vi.
From step 1.6 we also see that
Finally, since cn £ {än, bn) , we have that \f(u„)\ < \f(cn)\ ■ Combining that
with (18) and (19), we have
Hence, when n > N2, Algorithm 2 requires only three function evaluations per
iteration.
Proof. The proof is almost the same as that of Theorem 4.3. We assume that
f'(x) ^ 0 for all x £ [a, b]. Take N2 such that /V2> max{«2, "3} • Then,
when n > N2, as in the proof of Theorem 4.3, we have that
(23) bn-â„<hf(cn)\.
^0
The rest of the proof is similar to the corresponding part of the proof of Theo-
rem 4.3 and is omitted. D
Corollary 4.6. Under the assumptions of Theorem 4.4, {£„}£!, = {(bn-an)}%L ¡
converges to zero with an R-order at least 2 + V5 = 4.236.... Since asymp-
totically, Algorithm 2 requires only three function evaluations per iteration, its
efficiencyindex is v2 + -\/5=1.618.... D
5. Numerical experiments
In this section we present some numerical experiments. We compared our
methods with the methods in [2], with the methods of Dekker [6] and Brent [5],
and also with the Algorithm LZ4 of Le [8]. In our experiments, the parameter
p in all the methods of this paper and [2] was chosen as 0.5. For Dekker's
method we translated the ALGOL 60 routine Zeroin presented in [6] into For-
tran; for Brent's method we simply used the Fortran routine Zero presented in
the Appendix of [5], while for the Algorithm LZ4 of Le we used his Fortran
code. The machine used was Encore-Multimax, and double precision was used.
The test problems are listed in Table 5.1. The termination criterion was the one
used by Brent [5], i.e.
(25) b-a<2-tole(a,b),
where [a, b] is the current enclosing interval, and
0 ifx = 0
[-1,4]
xe~ otherwise
Í ftft
ft( + sinx- 1) if;c>0
[-104, tt/2] n= 1(1)40
I* —n
20 otherwise
e- 1.859 if x >
« = 20(1)40
e(n+lW2xl03 _ , g59 ¡f x g [0i 2XHCÍJ [-104, 10"4] « = 100(100)1000
-0.859 ifx < 0
Acknowledgment
We thank Dr. D. Le for kindly sending us the Fortran code of his Algorithm
LZ4, and an anonymous referee whose comments led to an improved presenta-
tion of our results.
Bibliography
3. Ned Anderson and Ake Björck, A new high order method of regula falsi type for computing
a root of an equation, BIT 13 (1973), 253-264.
4. Ken Atkinson, An introduction to numerical analysis, Wiley, New York, 1989.
5. R. P. Brent, Algorithms for minimization without derivatives, Prentice-Hall, Englewood
Cliffs,NJ, 1972.
6. T. J. Dekker, Finding a zero by means of successive linear interpolation, Constructive As-
pects of the Fundamental Theorem of Algebra (B. Dejon and P. Henrici, eds.), Wiley-
Interscience, London, 1969, pp. 37-48.
7. R. F. King, Methods without secant steps for finding a bracketed root, Computing 17 ( 1976),
49-57.
8. D. Le, An efficient derivative-free method for solving nonlinear equations, ACM Trans. Math.
Software 11 (1985), 250-262.
9. _, Three new rapidly convergent algorithms for finding a zero of a function, SIAM J. Sei.
Statist. Comput. 16 (1985), 193-208.
10. A. M. Ostrowski, Solution of equations in Banach spaces, Academic Press, New York, 1973.
11. F. A. Potra, On Q-order and R-order of convergence,J. Optim. Theory Appl. 63 (1989),
415-431.
12. J. W. Schmidt, Eingrenzung der Lösungen nichtlinearer Gleichungen mit höherer Konver-
genzgeschwindigkeit,Computing 8 (1971), 208-215.