Polynomial Real Root Isolation Using Descarte`s Rule of Signs *

Polynomial Real Root Isolation Using Descarte's Rule of Signs *
George E. Collins
and
A l k i v i a d i s G. Akritas
Computer Sciences Department, University of Wisconsin
1210 W. Dayton Street, Madison, Wisconsin 53706
Abstract
bound of n6 L(d) 2 in place of the bound n7 L(d) 3
Uspensky's 1948 book on the theory of equations
presents an algorithm, based on Descartes' rule
of signs, for i s o l a t i n g the real roots of a
squarefree polynomial with real c o e f f i c i e n t s .
Programmed in SAC-I and applied to several classes
of polynomials with integer c o e f f i c i e n t s ,
Uspensky's method proves to be a strong competitor
of the recently discovered algorithm of Collins and
Loos. I t is shown, however, that i t ' s maximum
computing time is exponential in the c o e f f i c i e n t
length. This motivates a modification of the
Uspensky algorithm which is quadratic in the
c o e f f i c i e n t length and which also performs well in
the practical t e s t cases.
f o r the previous algorithms.
I.
:
ZV=olail and L(d) is the length of the integer d
in radix representation with unspecified integer
radix B ~ 2.
The new algorithm to be described in t h i s paper
is dedicated to J. V. Uspensky, to whose book,
[ 6 ] , i t s discovery is d i r e c t l y a t t r i b u t a b l e .
Our
algorithm is a modification of one which Uspensky
(in 1948) claims is most e f f i c i e n t .
We quote from
page 127 of his book: "The theorem of Rolle and
the rule of signs, though they may often help in
separating the roots of an equation, do not provide
by themselves a complete and exhaustive solution
of t h i s important problem. The application of
R o l l e ' s theorem f o r t h i s purpose requires a
knowledge of the real roots of the d e r i v a t i v e ,
which i s , f o r the most part, lacking. The rule of
signs is a rather weak proposition and, applied to
an equation the nature of whose roots is not known,
does not give the exact number of p o s i t i v e (or
negative) roots except when the number of variations is zero or one. But exactly these two
p a r t i c u l a r cases, when combined with a remarkable
theorem published by Vincent in 1836 and hinted at
e a r l i e r by Fourier, supply the most e f f i c i e n t
method, not only to determine the exact number of
p o s i t i v e and negative roots but also to e f f e c t
t h e i r separation, in case the proposed equation
has no multiple real r o o t s . "
Introduction
A polynomial real root i s o l a t i o n algorithm is
an algorithm which, given a polynomial A(x) with
real c o e f f i c i e n t s , computes a sequence of d i s j o i n t
i n t e r v a l s each containing exactly one real root of
A, and together containing a l l real roots of A.
Heindel, in a 1970 Ph.D. thesis, [ 4 ] , (see [5] f o r
a compact presentation of the main r e s u l t s ) ,
provided the f i r s t implementation using exact
arithmetic within a computer algebra system of
such an algorithm, together with a thorough
analysis of i t s computing time. Heindel's
algorithm was based on tile methodical a p p l i c a t i o n
of Sturm's theorem.
Just recently, Collins and Loos, [ 3 ] , have
given a similar treatment of a new polynomial
real root i s o l a t i o n algorithm, which is based on
recursive application of Rolle's theorem together
with a certain tangent construction. They show
that t h i s new algorithm is s i g n i f i c a n t l y superior
to the Sturm algorithm in most practical cases.
We programmed Uspensky's algorithm and found
that indeed, on the average, i t was f a s t e r than the
Sturm algorithm.
But, as we w i l l show, i t s
maximum computing time is exponential in L(d) and,
f o r the same reason, the observed computing
times are occasionally quite unsatisfactory.
Our
modification of Uspensky's algorithm, which w i l l
be described e x p l i c i t l y below, may be regarded
an application of the algorithm design p r i n c i p l e
of balance (see [ I ] , page 65). Tile modification
tends to increase the computing time when the
roots are well separated, but decreases the
computing time when some roots are very close.
In the following we present another new
algorithm, t h i s one based on the use of Descarte's
rule of signs together with certain l i n e a r f r a c t i o n a l transformations.
We find our algorithm
to be a strong competitor of the Collins-Loos
algorithm; applied to the same examples which ~lere
used in [ 3 ] , i t is from two to eight times f a s t e r
in most cases. Furthermore, we are able to
establish a better theoretical upper bound for i t s
computing time; f o r a squarefree integral polynomial A of degree n with IAIi = d, we obtain a
2.
Uspensky's Algorithm
Let b = (b I . . . . . br) be a sequence of real
numbers.
*Research supported by National Science Foundation
Grant DCR74-13278.
Proceedings of the 1976 ACM Symposium
on Symbolic and Algebraic Compuiation
Here IZV OaiXlll
272
I
Let b' : (b~ . . . . . bs)
be the subsequence
I f m i s the number of s u b s t i t u t i o n s I / ( x + l )
in any path from the root of the tree to any node,
then the Vincent-Uspensky theorem shows t h a t m i s
dominated by L(n) + L ( [ ~ - I ] ) where ~ = sep(A)
is the minimum root separation of A. But i t i s
of non-zero elements of b. Then the number of
v a r i a t i o n s in b, v a r ( b ) , i s the number of i ' s ,
1 ~ i < r , such t h a t sign(b~) = - s i g n ( b ~ + l ) .
If
A ( x ) = Zi=oai
n
x i is a real polynomial, then we
i d e n t i f y A with i t s sequence of c o e f f i c i e n t s
a = (a 0 . . . . . an ) and w r i t e v a r ( A ) .
Descartes' r u l e
known, [ 2 ] , that L ( [ ~ - l ] ) ~ n L ( d )
of signs is a theorem which asserts t h a t the number
of p o s i t i v e real roots ( m u l t i p l i c i t i e s counted) of
a real polynomial A i s equal to var(A) - 2k f o r some
non-negative integer k. The exact number o f
p o s i t i v e real roots is determined j u s t in case
var(A) = 0 or var(A) = I . The theorem can be
applied to negative roots by replacing A(x) by
A ( - x ) , and zero is a root of A j u s t in case a 0 = O.
In the implementation of Uspensky's a l g o r i t h m ,
one may replace the ( p a r t i a l l y - c o n s t r u c t e d )
binary t r e e by a l i s t of pairs corresponding to
i t s terminal nodes, each p a i r c o n s i s t i n g of the
associated polynomial and t r a n s f o r m a t i o n . Moreover, the l i s t may contain p a i r s only f o r those
nodes f o r which the polynomial has at l e a s t two
v a r i a t i o n s . The main loop of the algorithm then
removes a p a i r from the l i l t and produces two new
p a i r s corresponding to the two s u b s t i t u t i o n s .
The
new p a i r s with two or more v a r i a t i o n s are then
returned to the p a i r l i s t while t h e n e w pairs
with one v a r i a t i o n c o n t r i b u t e t h e i r i n t e r v a l s to
an output l i s t .
The loop i s repeated u n t i l the
p a i r l i s t becomes empty. Some observed times f o r
a p p l i c a t i o n of t h i s algorithm are presented in
Section 4.
I f var(A) m 2 and A(O) = a0 ~ O, l e t
Al(X) = A ( x + l ) and A2(x) = ( x + l ) n A ( I / ( x + l ) ) .
If
ml . . . . . mm are the roots of A greater than or equal
to one, then ml-I . . . . . mm-I are the roots of A1
greater than or equal to zero.
I f ml . . . . . mm are
the roots of A between zero and one, then
-I
-I
ml - I . . . . . mm - I are the p o s i t i v e real roots o f A2.
Let Al(X) = xhAl(X) where Ai(O) ~ 0.
I f h > 0,
then l is a root of A and { l } = [ l , l ] is an
i s o l a t i n g interval f o r A. I f var(Al ) = 0, then A
has no roots in ( l , ~ ) , while i f var(Al ) = l then
( l , ~ ) is an i s o l a t i n g i n t e r v a l .
3.
I f var(Al) > l ,
then A1 is subjected to the same two substitutions,
x + l and I / ( x + l ) .
where d = I A I i ,
so m < nL(d).
However, the number of s u b s t i t u t i o n s
x + 1 i s not dominated by any power of L ( d ) , as
may be v e r i f i e d with the example A(x) =
{ a x - ( a - l ) } { ( a + l ) x - a } = (a2+a)x 2 - ( 2 a 2 - 1 ) x + ( a 2 - a ) ,
w i t h a a p o s i t i v e i n t e g e r , a > 2. Here the
maximum value of m i s a - 2, while d = 4a 2 - I .
I t i s possible to construct a s i m i l a r example f o r
every n m 2.
The Hodified Uspensky Algorithm
Table 1 shows the i n t e r v a l s which may occur
at the f i r s t few l e v e l s of the binary t r e e in
Uspensky's a l g o r i t h m . At l e v e l 4, the lengths of
the f i n i t e i n t e r v a l s f l u c t u a t e between 1/15 and I ;
at higher l e v e l s the d i s p a r i t y in lengths grows
r a p i d l y . C l e a r l y there i s a lack of optimal
balance in t h i s algorithm.
S i m i l a r l y , i f var(A2) = 0,
then A has no roots in (0,1); i f var(A2) = l ,
then (0,1) is an i s o l a t i n g interval f o r A; and
i f var(A2) > l , then A2 is subjected to the same
two substitutions.
Table I .
This is Uspensky's a l g o r i t h m .
I t s computations can be represented in tile form of a binary
t r e e in which there i s associated w i t h each node
a polynomial and a t r a n s f o r m a t i o n .
Each path from
a node to a successor corresponds to a s u b s t i t u t i o n
x + 1 or I / ( x + l ) , which s u b s t i t u t i o n i s applied
to both the polynomial and the t r a n s f o r m a t i o n .
Polynomials at terminal nodes have at most one
v a r i a t i o n ; the associated transformations o f those
with one v a r i a t i o n , when applied to ( 0 , ~ ) , produce
is~ating intervals.
Level
Level
Level
Level
0:
l:
2:
3:
Interval's
in Uspensky's A l g o r i t h m
(0,~)
(O,1),(1,~)
(0,I/2),(I/2,1),(1,2),(2,~)
(0,I/3),(I/3,1/2),(I/2,2/3),(2/3,1),
(1,3/2),(3/2,2),(2,3),(3,~)
Level 4:
(0,I/4),(I/4,1/3),(I/3,2/5),2/5,1/2),
(I/2,3/5),(3/5,2/3),(2/3,3/4),(3/4,1),
(I,4/3),(4/3,3/2),(3/2,5/3),(5/3,2),
(2,5/2),(5/2,3),(3,4),(4,~)
Let b be a root bound f o r A, that i s ,
Jml < b for every root m of A. We compute a root
bound as in [ 3 ] , so that b = 2k for some ( p o s i t i v e ,
negative or zero) ineger k. Let A*(x) = A(2Kx) i f
Uspensky applies a theorem of Vincent ( [ 7 ] ,
1836) to show t h a t , when applied to a squarefree
polynomial, the a l g o r i t h m always terminates, i . e . ,
the binary t r e e is f i n i t e .
Vincent's theorem
asserts t h a t i f a squarefree polynomial i s
successively transformed by successive s u b s t i t u t i o n s
k m 0, A*(x) = 2-knA(2kx) i f k < 0. Now A* is an
integral polynomial whose positive real roots are
a l l in the interval (0,1); the roots of A* in
(O,l) correspond to the p o s i t i v e real roots of A.
We associate with A* the interval (O,b). I f
var(A*) = l , then (O,b) is an i s o l a t i n g interval
f o r A; and i f var(A*) = 0, then A has no positive
real roots. I f vat(A*) m 2, then we put the pair
(A*,(O,b)) in a pair l i s t , P. Each pair in P
consists of a polynomial Ai and an intervaJ,
ai + ~x' where the a i are p o s i t i v e i n t e g e r s , one
eventually obtains a polynomial with at most one
v a r i a t i o n . In f a c t , Uspensky's strengthened
version of Vincent's theorem bounds the number of
substitutions I / ( x + l ) as a function of n = deg(A)
and the minimum root separation of A.
273
(ai,bi),
such that the roots of A in ( a i , b i)
We describe the several classes of polynomials
very b r i e f l y ; f u l l descriptions are given in [3].
Tables 2 and 3 pertain to polynomials with random
c o e f f i c i e n t s which are b b i t s long. n denotes the
degree in a l l tables. The polynomials of Table 4
are resultants of random b i v a r i a t e polynomials;
each entry is the average for three resultants
with c o e f f i c i e n t s from I0 to 30 decimal d i g i t s in
length. Table 5 is for products of random l i n e a r
polynomials, with the c o e f f i c i e n t s of the product
truncated to a maximum of 33 b i t s .
Table 6 pertains to the Chebyshev polynomials Tn(X).
correspond to the roots of Ai in ( 0 , I ) and the
intervals
(ai,bi)
are d i s j o i n t .
The roots of Ai
in ( 0 , I ) correspond to the positive real roots of
A~(x) = ( x + l ) n A i ( I / ( x + l ) )
var(A~)
2 for each i .
and so we assume that
Let A~(x) = 2nAi(x/2) and
AV(x) = A}(x+l) = 2 n A i ( - ~ ) .
The roots of A!l in
(0,1) correspond to the roots of Ai in (0,1/2) and
hence to the roots of A in ( a i , c i ) where c i is the
midpoint ( a i + b i ) / 2 .
Similarly,
( 0 , I ) correspond to those of A in ( c i , b i ) .
And
c i is a root of A j u s t in case AV(O) = O.
Thus
i f var(A~*) = I , then ( a i , c i )
Each table has an additional column labeled
B. This is the number of bisections performed in
Algorithm M. rlost of the work of Algorithm rl
consists of performing t r a n s l a t i o n s A*(x) = A ( x + l ) ,
and the number of translations performed is 3B.
I t appears that the average value of B is
approximately l i n e a r in n, with the constant of
p r o p o r t i o n a l i t y dependent on the class of polynomials. Using t h i s observation (or conjecture)
one can argue that the average computing time of
Algorithm M is perhaps approximately codominant with
4
n + n3L(d),"
" which may be compared with the average
the roots of A~i in
is an i s o l a t i n g
interval f o r A, and i f var(A~*) m 2 then
( A ] , ( a i , c i ) is put in the l i s t
A"i,A"*i and ( c i , b i ) ,
P.
S i m i l a r l y for
but with due regard for the
case AV(O)
= 0 as in Uspensky's algorithm.
1
This
bisection process is repeated u n t i l the l i s t P
becomes empty. This is the modified Uspensky
algorithm.
time n4 + n2L(d) 2 conjectured for Algorithm D in
[3].
In the practical cases observed, both
algorithms appear to behave l i k e n3L(d), but with
Algorithm M having a somewhat smaller constant
factor.
Vincent's theorem can be modified to obtain a
proof that the modified algorithm terminates. The
main r e s u l t is the f o l l o w i n g .
Theorem I .
degree n.
TABLE 2
Random Polynomials, b=33
Let A(x) be a real polynomial of
Let c n = ( l + I / n ) I / ( n - l ) - I .
Let ~ be
n
a real root of A with 0 ~ a < m < b. Let C be the
c i r c l e with center (a+b)/2 and radius
(~nl+I/2)(b-a).
Let Al(X ) = A((b-a)x+a).
If all
roots, real and complex, of A other than m are
outside C, then var(A~) = lo
One also uses the known result that i f a l l
roots of a real polynomial A have negative real
parts, then var(A) = O. Combining Theorem l with
B
D
U
M
5
2
0.76
0.07
0.17
10
32]
3.77
0.21
0.66
15
4
8.06
0.32
1.44
20
4½
7
18.4
0.68
2o71
30.2
0.74
7.86
25
TABLE 3
Random Polynomials, n=15
the observation that E- l = O(n2) and the bound of
n
[2] for minimum root separation, one obtains the
following result.
D
Theorem 2. Let A(x) be an integral squarefree polynomial of degree n ~ l and ]A]l = d. The
33
66
99
132
computing time of the modifiedUspensky real root
isolation algorithm (using classical arithmetic
7.9
12.1
10.4
14.2
U
0.32
0.55
0.43
1.16
0.95
1.89
1.61
2.25
algorithms) is dominated by n6L(d)2.
4.
TABLE 4
Random Resultants
Empirical Comparisons
In the following we present several tabl,es
showing the observed computing times, for several
classes of polynomials, for the Collins-Loos
d i f f e r e n t i a t i o n algorithm (D), the Uspensky
algorithm (U), and the modified Uspensky algorithm
(M). The polynomials used in these tests are the
same as those used in [3], and the times for
Algorithm D are taken from [3]. All times are
given in seconds and were obtained using SAC-I on
the University of Wisconsin UNIVAC l l l O computer.
8
18
32
274
7
II
14
3.79
21.0
83.4
0.31
1.76
4.73
1.01
6.73
33.4
References
TABLE 5
Random Products
n
B
5
I0
15
20
25
9
15
32
25
~37
D
1.42
6.83
17.9
38.0
64.0
U
rl
0.14
0.96
4.32
6.77
21.5
0.50
2.23
12.5
17.6
40.4
[l]
A. V. Aho, J. E. Hopcroft, and J. D. Ullman,
The Design and Analysis of Computer Algorithms,
Addison-Wesley, 1974.
[2]
G. E. Collins and E. Horowitz, The rlinimum
Root Separation of a Polynomial, rlath. Comp.,
Vol. 28, No. 126 (April 1974), 589-597.
[3]
G. E. Collins and R. Loos, Polynomial Real
Root I s o l a t i o n by D i f f e r e n t i a t i o n , Proc. 1976
ACM Symposium on Symbolic and Algebraic
Calculation, 1976.
[4]
L. E. Heindel, Algorithms for Exact Polynomial
Root Calculation, Ph.D. Thesis, University
of Hisconsin, 1970.
[5]
L. E. Heindel, Integer A r i t i m e t i c Algorithms
for Polynomial Real Zero Determination,
Jour. ACII, Vol. 18, No. 4 (Oct. 1971),
533-548.
[6]
J. V. Uspensky, Theory of Equations,
McGraw-Hill, 1948.
[7]
r.1. Vinent, Sur la R~solution des ~quations
TABCE 6
Chebyshev Polynomials
n
5
I0
15
20
25
30
5.
B
8
14
18
26
30
36
D
0.78
3.40
8.98
18.6
35.2
M
0.16
1.52
5.36
20.6
47.4
118.9
0.36
2.02
5.07
17.0
31.6
56.0
Conclusions
One may be tempted to conclude from the above
empirical comparisons that the unmodified
Uspensky algorithm is usually f a s t e r than the other
known algorithms and that therefore these other
algorithms do not merit continued use or i n v e s t i gation. Such a simple state of a f f a i r s , however,
does not e x i s t .
Numeriques, Jour. de rlathematiques Pures et
Appliquees, Vol. 1 (1836), 341-372.
For example, the Collins-Loos algorithm
computes i s o l a t i n g i n t e r v a l s not only for A(x) but
also f o r all of i t s derivatives and, as observed
in [ 3 ] , there are important applications where
i s o l a t i n g i n t e r v a l s for several or all derivatives
are needed. Another point to observe is that root
i s o l a t i o n is often used as a prelude to root
refinement or approximation; hence a slower root
i s o l a t i o n method which produces smaller i s o l a t i n g
i n t e r v a l s may not be as bad as i t would appear
from the type of data presented above.
The modified Uspensky method is f a s t e r than
the unmodified Uspensky method in some cases but
slower in others. This appears to be another
case where the f a s t e s t algorithm f o r " d i f f i c u l t "
problems is somewhat slower f o r easier problems.
However, " d i f f i c u l t y " here depends on root
d i s t r i b u t i o n as well as degree and c o e f f i c i e n t
size and since one w i l l generally have l i t t l e ,
if
any, advance information about root d i s t r i b u t i o n ,
the selection of the most appropriate algorithm
w i l l be d i f f i c u l t .
For the present, at least,
a computer algebra system should i d e a l l y supply
several algorithms, allowing the user to exercise
judgement in selection of the most appropriate
algorithm for the problem at hand. In various
contexts the preferred algorithm may be the
Collins-Loos algorithm, the Uspensky algorithm or
the modified Uspensky algorithm. The Sturm
algorithm is generally much slower than the others
but, as the data in [3] show, i t is s l i g h t l y
f a s t e r than the others for Chebyshev polynomials.
Certainly there are many questions deserving
f u r t h e r study.
275