four stages: (1) testing program robustness, (2) testing for convergence difficulties, ... used are of only limited usefulness in terms of evaluating reliability or ... The numerical solution of polynomial equations has been the subject of intensive research .... (i) Does the program test whether a leading coefficient is zero or "nearly".
Principles for Testing Polynomial Zerofmding Programs M.A. JENKINS Queen's University and J.F. TRAUB Carnegie-Mellon University
T h e s t a t e of t h e art in p o l y n o m i a l zerofmding a l g o r i t h m s a n d programs is briefly s u m m a r i z e d , w i t h emphasis on t h e principles for testing s u c h programs. T h e authors v i e w t e s t i n g as requiring four s t a g e s : (1) t e s t i n g program robustness, (2) t e s t i n g for convergence difficulties, (3) t e s t i n g for specific w e a k n e s s of t h e algorithms, (4) a s s e s s m e n t of program performance b y s t a t i s t i c a l testing. I t is emphasized t h a t t h e statistical testing m u s t b e d o n e w i t h care. T h e r e are m a n y w a y s t o generate 'random" p o l y n o m i a l s , b u t t w o classes of r a n d o m p o l y n o m i a l s w h i c h h a v e b e e n w i d e l y used are of o n l y l i m i t e d usefulness in terms of e v a l u a t i n g reliability or performance b e c a u s e t h e y produce p o l y n o m i a l s w i t h v e r y similar characteristics. Classes of r a n d o m p o l y n o m i a l s w h i c h s h o u l d b e used are discussed. 1
K e y W o r d s a n d P h r a s e s : p o l y n o m i a l zeros, m a t h e m a t i c a l software, statistical testing, program testing C R C a t e g o r i e s : 5.15, 5 . 1 0
1.
INTRODUCTION
T h e n u m e r i c a l s o l u t i o n of p o l y n o m i a l e q u a t i o n s h a s b e e n t h e s u b j e c t of i n t e n s i v e r e s e a r c h i n r e c e n t y e a r s w i t h p r o p o s a l s of n e w a l g o r i t h m s a p p e a r i n g f r e q u e n t l y
in
t h e n u m e r i c a l a n a l y s i s l i t e r a t u r e . W h i l e m a n y of t h e a l g o r i t h m s w h i c h a r e p r o p o s e d a r e m a t h e m a t i c a l l y i n t e r e s t i n g , o n l y a f e w a r e s e r i o u s c o n t e n d e r s a s t h e b a s i s of f a s t , r e l i a b l e , m a t h e m a t i c a l s o f t w a r e for t h i s p r o b l e m . T h e p u r p o s e of t h i s p a p e r i s t o p r o p o s e m e a n s of t e s t i n g programs
for p o l y n o m i a l z e r o f m d i n g i n o r d e r t o s e p a -
C o p y r i g h t © 1975, Association for C o m p u t i n g M a c h i n e r y , I n c . General permission t o republish, b u t n o t for profit, all or p a r t of this material is g r a n t e d p r o v i d e d t h a t A C M ' s c o p y r i g h t n o t i c e is g i v e n a n d t h a t reference is m a d e t o t h e publication, t o i t s d a t e of issue, a n d t o t h e fact t h a t reprinting privileges were granted b y permission of t h e Association for C o m p u t i n g M a c h i n e r y . A version of this paper w a s presented a t M a t h e m a t i c a l Software I I , a conference held a t P u r d u e U n i v e r s i t y , W e s t L a f a y e t t e , Indiana, M a y 2 9 - 3 1 , 1974. T h e work reported in this paper w a s s u p p o r t e d in part ( M . A . Jenkins) b y t h e D e f e n s e R e s e a r c h B o a r d of C a n a d a under Grant 9540-32, a n d b y t h e N a t i o n a l Research Council of C a n a d a under G r a n t A 7 8 9 2 , a n d in part (J.F. T r a u b ) b y t h e N a t i o n a l Science F o u n d a t i o n under G r a n t G J 3 2 1 1 1 and t h e Office of N a v a l Research under C o n t r a c t N 0 0 1 4 - 6 7 - A - 0 3 1 4 - 0 0 1 0 , N R 0 4 4 - 4 2 2 . A u t h o r s ' addresses: M . A . Jenkins, D e p a r t m e n t of C o m p u t i n g a n d I n f o r m a t i o n Science, Queen's U n i v e r s i t y , K i n g s t o n , O n t . , C a n a d a ; J . F . T r a u b , D e p a r t m e n t of C o m p u t e r Science, CarnegieM e l l o n U n i v e r s i t y , P i t t s b u r g h , P A 15213. ACM Transactions on Mathematical Software, Vol. 1, No. 1, March 1975, Pages 26-34.
Principles for Testing Polynomial Zerofinding Programs
•
27
r a t e t h o s e w h i c h s h o u l d b e r e c o m m e n d e d a s c o n t e n d e r s for i n c l u s i o n i n p r o g r a m libraries a n d those which should be considered only m a t h e m a t i c a l novelties. T h e e m p h a s i s h e r e is o n t h e t e s t i n g of a s i n g l e p r o g r a m w h i c h i m p l e m e n t s a p a r t i c u l a r a l g o r i t h m , b u t s i m i l a r t e c h n i q u e s m a y b e u s e d for c o m p a r i n g t h e r e l a t i v e m e r i t s of s e v e r a l a l g o r i t h m s . W e e m p h a s i z e t h a t s t a t i s t i c a l t e s t i n g m u s t b e d o n e w i t h c a r e if i t is t o b e m e a n i n g f u l . T h e p o l y n o m i a l z e r o f m d i n g p r o b l e m is a difficult c o m p u t a t i o n a l p r o b l e m . I t c a n b e v i e w e d a s a n o n l i n e a r p r o b l e m or, i n t e r m s of l i n e a r a l g e b r a , a s a s p e c i a l c a s e of a n o n - H e r m i t i a n e i g e n v a l u e p r o b l e m w i t h (in g e n e r a l ) n o n l i n e a r d i v i s o r s . M a n y a l g o r i t h m s w h i c h w o r k e a s i l y o n e x a m p l e s w i t h w e l l - s e p a r a t e d s i m p l e z e r o s fail o n m o r e difficult e x a m p l e s . A l g o r i t h m s c a n b e classified a s t h o s e w h i c h find a s i n g l e z e r o o r a p a i r of z e r o s a t a t i m e o r t h o s e w h i c h d e t e r m i n e all t h e z e r o s s i m u l t a n e o u s l y . T h e f o r m e r r e q u i r e t h e u s e of s o m e d e f l a t i o n t e c h n i q u e , e i t h e r e x p l i c i t o r i m p l i c i t [ 1 6 ] , t o r e m o v e t h e zeros already d e t e r m i n e d . W e assume here t h a t we are discussing a p r o g r a m which is i n t e n d e d t o find all t h e z e r o s of a n a r b i t r a r y p o l y n o m i a l w i t h r e a l o r c o m p l e x coefficients. T h e p r o c e e d i n g s of t h e R u s c h l i k o n s y m p o s i u m [ 6 ] p r o v i d e a n i l l u s t r a t i o n of the diverse approaches which have been applied to this fundamental problem. A d i s c u s s i o n of t h e b a s i c a p p r o a c h e s m a y b e f o u n d i n [ 1 1 ] . O u r e x p e r i e n c e i n t e s t i n g polynomial zerofinding p r o g r a m s has been gained while developing algorithms w h i c h u s e a c o m b i n a t i o n of a p p r o a c h e s ( s e p a r a t i o n of z e r o s b y p o w e r i n g f o l l o w e d b y f u n c t i o n a l i t e r a t i o n [ 9 , 1 0 ] t o find l i n e a r o r q u a d r a t i c f a c t o r s ) a n d w h i c h u s e e x p l i c i t d e f l a t i o n t o r e d u c e t o a s m a l l e r p r o b l e m . T o s o m e e x t e n t t h i s v i e w of t h e z e r o f i n d i n g p r o c e s s b i a s e s o u r p r e s e n t a t i o n of t h e p r i n c i p l e s for t e s t i n g ; h o w e v e r , w e a t t e m p t t o discuss t h e issues in general t e r m s . 2.
OBJECTIVES
W e a r e c o n c e r n e d w i t h a l m o s t foolproof a l g o r i t h m s a n d p r o g r a m s for t h e f o l l o w i n g m a t h e m a t i c a l p r o b l e m . G i v e n t h e d e g r e e n a n d t h e coefficients a , a . . . , a of t h e polynomial 0
P(z)
n
n
l
= aoZ + aiz ~
+
• • • + a»,
a
h
POO
2
= a (z
-
0
a
i
)
m
i
n
0,
0
w e a r e t o find t h e n u m b e r of d i s t i n c t z e r o s , k, t h e z e r o s a c o r r e s p o n d i n g m u l t i p l i c i t i e s m m , . . . , mu s u c h t h a t P(z) tored form as
h
h
a , . . • , a*, a n d t h e is e x p r e s s e d i n a f a c 2
m
... ( z -
a) K k
I n c o m p u t a t i o n a l w o r k t h e s h a r p distinction b e t w e e n m u l t i p l e zeros a n d closely c l u s t e r e d d i s t i n c t z e r o s is b l u r r e d , a n d w e u s u a l l y s e t t l e for f i n d i n g n a p p r o x i m a t i o n s ai, a , . . . , a t o t h e z e r o s w h i c h s a t i s f y a t l e a s t o n e of t h e f o l l o w i n g t w o o b j e c t i v e s : (i) a s e t of a p p r o x i m a t i o n s