



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Webb Miller* Computer Science Dept. Penn State University Park, Pa. 16802
ABSTRACT: Limiting consideration to algorithms satisfying various numerical stability require- ments may change lower bounds for computational complexity and/or make lower bounds easier to prove. We will show that, under a sufficiently strong restriction upon numerical stability, any algorithm for multiplying two n x n matrices using only +, - and x requires at least n 3 multiplica- tions. We conclude with a survey of results con- cerning the numerical stability of several algori- thms which have been considered by complexity theorists.
I. Introduction
Proofs of lower bounds for the computational complexity of a given problem must generally con- sider only a few measurements of cost and ignore the others. For example a discussion of the com- plexity of the problem of sorting a list of items may count only the number of comparisons, disre- garding issues like non-comparison operations, storage requirements and programming simplicity.
When the problem under consideration in- volves real (i.e., floating-point) arithmetic, then another factor is relevant, namely the pro- pagation of rounding errors. In a recent survey of arithmetic complexity Borodin [2, p. 174] remarks:
But eventually we will have to develop results which simultaneously talk about arithmetic costs, and the "robustness" or "stability" of the algorithm. Perhaps if we were more formal about the numerical properties of an algorithm, then it might be easier to produce non trivial lower bounds.
Of course many people have given simulta- neous consideration to complexity and stability. In particular numerical analysts are daily faced with the trade-off between stability and the operation count. Moreover, investigations have been made of the effects of rounding errors upon several algorithms of interest to complexity theorists (for a survey see section 6).
Rather~ the first sentence quoted from Borodin seems to suggest the possible existence of problems for which the fastest algorithms must be
less than optimal with regard to stability. One motivation for this paper is to present several such examples. Thus we are interested in the ef- fects upon complexity lower bounds of various stability requirements (essentially the opposite problem of maximizing stability subject to complex- ity constraints is investigated by Babuska [i] and Viten'ko [15]).
However, our primary motivation is to be found in Borodin's second sentence. When we limit con- sideration to all programs (in a given language) which evaluate a fixed function and which satisfy a certain stability ~e~uirement it is entirely possible that the fastest programs are excluded. More intriguing to us is the possibility that the remaining programs have a simple structure which makes finding a program that is optimal with re- spect to some measurement of cost substantially easier than if arbitrary (and less stable) pro- grams are allowed to compete.
Here we have focussed on the evaluation of systems of bilinear forms by programs which apply only the operations +, - and ×. For simplicity we have not allowed constants, though almost every- thing carries over with minor modifications. One of our results is that if only such programs meet- ing a very restrictive stability requirement are considered, then n 3 multiplications are needed to find the product of two n x n matrices. Under a somewhat relaxed stability assumption we will show that computing the product of a 2 x 2 matrix and a 2 x n matrix requires at least 7n/2 multi- plications. In each case, if the stability re- quirement is dropped, then faster algorithms can be found and tight lower bounds seem to become harder to verify (they are not yet known).
The concepts of numerical stability which we employ are closely related to those currently used by experts in roundoff analysis (e.g., Wilkinson [16,17]). They are idealized in at least two re- spects. First they use very few of the actual properties of floating-point arithmetic. This creates a tendency for pessimistic results in that algorithms may be more stable than we can prove (see the remarks by Kahan [9, pp. 1232-1234] on Viten'ko [15]. Second we consider only the first- order effects of rounding errors, so algorithms
*Most of the work for this paper was done at the IBM Thomas J. Watson Research Center.
may be less stable than results like ours suggest. (In section 5 we will detail several more reasons why the practical significance of the results given here is not especially great.)
We hope that this paper offers supporting evidence for Borodin's cited belief and for our conviction that numerical analysts and complexity theorists can benefit from an exchange of ideas.
A polynomial program is a sequence of in- structions of the form
V ~- W#X (2-1) where # is one of +, - or x. For simplicity we require that each operand, W or X, is a variable (initial or defined).
We can think of the program as specifying a sequence of floating-point operations to be per- formed on the data d = (dl,...,dn). In many con-
texts it is helpful to take the alternative point of view that the program specifies symbolic opera- tions to be performed on multivariate polynomicals in the initial variables d. Any resulting poly- nomial V(d) has integer coefficients and no con- stant term.
Let V be a defined variable of such a program, i.e., V appears on the left of a unique instruction (2-1). If we omit tile instruction defining V and consider V an initial variable, then any variable Z can be considered a polynomial Z(d,V).
Define
AZv(i) ~ ~v(d,V(d))'V(!)
The polynomial AZv(d) measures the sensitivity of the numerical evaluation of Z(d) to a floating- point rounding error committed in the operation producing V(d). For suppose that the evaluation is performed exactly except that V(d)(l+6) is used in place of V(d). The induced error is Z(d,V(d)(l+6)) - Z(! )
= Z ( d , V ( d ) ( l + ~ ) ) - Z (! , V ( d ) )
~ 6 •Az v (d~ i. ! for small 6.
For example let d = (al,a2,bl,b2) and con- sider
T ÷ a I x @ 2 U + b I x "b 2
V ÷ a I + b 2 W ÷ a 2 + b I (2-2) X + V x W Y + X - T
Z ÷ y - u
One easily computes
Z(d) = alb I + a2b 2
Z(d,W) - (a I + b2)W - ala 2 - blb 2
~ (! , W ) = a I + b 2
AZw(d) = (a I + b2)(a 2 + b I)
Stability conditions can sometimes be inter- preted as restricting the form of certain polynomi- als AZv(d). I f
~Z ~V(i,v(i)) ~ 0 (2-3)
then the form of V(d) is also restricted since
V(!) '~(!,V(d_~) = AZv(d_).
Our g0al in the remainder of this section is to ex- hibit a useful condition which guarantees (2-3).
Let Z be a defined variable of a polynomial program. Consider the following process for marking certain instructions of the program. If Z is de- fined by an addition or subtraction, then mark that instruction. If an instruction
V ÷ X#Y , # is + or - is marked and if X and/or Y is defined by + or -, then mark those instructions.
Now delete any unmarked instructions. The set l(Z) of initial (i.e., undefined) variables of the resulting polynomial program contains only variables which were originally either initial or defined by multiplication (take I(Z) = {Z} if Z is defined by multiplication).
Clearly Z is a linear combination of the U in l(Z). Specifically, there exists a unique integer iz(U) for each U in I(Z) such that in the resulting program
Z E ~ I (^) iz(U)'U
The dependence of Z on I(Z) is essentially the same in the original program. In particular,
Z(d) ~ ~ I iz(U)'U(~) (2-4)
and for any defined variable V we have
Z(!'V) ~ ~ I iz(U)'U(!'V) (2-5)
For an example of these notions recall (2-2). We find that I(Z) = {T,U,X} and
1 = iz(X ) = -iz(T ) = -iz(U )
Theorem i.i. If V is a defined variable in l(Z) and if iz(V) # 0, then
~v(d,V(d)) ~ 0
Proof: If U in I(Z) is originally defined bY a multiplication then U may depend on V in the sense that
~-~(d,V(d)) ~ 0
The only other U in l(Z) are originally initial variables and do not depend on V. From (2-5) we compute
Example 4.2. Often one does not count multi- plications which are "preconditioning", i.e., which produce only polynomials in a alone or in b alone. To reduce the number of multiplications in a poly- nomial program by preconditioning, one must sacri- fice simultaneous Brent stability.
Example 4.3. It can be shown that any program of the "LI(i) × L2(b)" form must exhibit simul-
taneous Brent stability. Thus Strassen's algori- thm for matrix multiplication has simultaneous Brent stability (see also Brent [3]).
Conclusion 2. If each B k is a permutation bi-
linear form, then any polynomial program with si- multaneous strong stability must perform t multi- plications, where t is the number of pairs (i,j) such that some ~ijk in (4-1) is nonzero.
Example 4.4. The n 3 multiplications in the usual algorithm for multiplying n x n matrices make it optimal among polynomial programs with simul- taneous strong stability. For general polynomial programs the arithmetic complexity of matrix multi- plication seems far from resolved.
Example 4.5. Conclusion 2 also applies to the multiplication of complex numbers or polynomials (i.e., computing the coefficients of the product of polynomials). Consider
(a I + a2i ) x (b I + b2i )
i.e., computing
Bl(a,b) = alb I - a2b 2 = real part
B2(a,b) = alb 2 + a2b I = imaginary part.
If we compute B I = X - Y and B 2 = X - Z where
X = (a I + a2)b 1
y = a2(b I + b 2)
Z = al(b I - b2)
then our previous results indicate that the in- fluence of roundoff error upon B I should be
"unduly large" for a , b such that
l(~,k) IBl << l~l'l~I
The correct result for (0.0015 + l. Oli) × (i.01 + O.O01i)
is B I = 0.000505, whereas computing in "three- digit floating-point arithmetic", i.e., rounding symmetrically to three digits after each operation, gives 0.00051 with the usual method, and 0.0 with the "fast" method.
The practical value of the above results is limited by several factors.
multiplications, then it can be evaluated with n multiplications of the form
Ll(a,b) × L2(a_,b)
for linear L i (Winograd [18]. Such polynomial pro-
grams (with constants) are "nearly Brent stable" in the sense that ABv(a,b ) = 0([max{lail,lbjl}12 )
for all B and defined V. They can be given simul- taneous Brent stability be scaling a and b to have roughly the same size (see Brent [3,4] for a special case).
override general results like ours.
This section contains a brief review of sta- bility results concerning algorithms of (possible) interest to complexity theorists. (a) Evaluation of a polynomial
n (^) i p(x) = ~'- aix i=
given x, a0, ..., a n. A popular stability __,c°ndi- tion is that the computed value be exactly ~ a i x i
where each relative difference lai-ail/lail is small. Following our approach this might be for- malized as
APv(x,a ) = 0(ZlaixlI)
for all defined variables V. There is nothing uni- quely plausible about this requirement, and others have been considered, e.g., [i0]. However, the condition does seem to be widely applicable. Both Horner's role and the naive method are easily seen to be stable in this sense. Also, Wozniakowski [19] has verified this property for a family of algorithms of Shaw and Traub [14] for evaluating a polynomial and its normalized de- rivat ives. (b) Polynomial evaluation with precondition- ing. Workers involved in producing subroutines for evaluating common functions have considered the possible use of the Pan and Motzkin-Belaga forms. However, these procedures are too often contaminat- ed by numerical errors (see Rice [13] or pp. 67-
(c) Interpolation. A semi-formal roundoff analysis of Lagrange's formula can be found on pp. 287-291 of Dorn and McCracken [6]. It seems natural to compare Lagrange's or Newton's form with fast methods [2], both in their use for evaluating
*On the other hand, preliminary work by M. Rabin and S. Winograd indicates the existence of stable preconditioning methods of practical value.