19.07.2014 Views

Contents - Student subdomain for University of Bath

Contents - Student subdomain for University of Bath

Contents - Student subdomain for University of Bath

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

226 APPENDIX B. EXCURSUS<br />

B.3.2<br />

Karatsuba’s method and sparse polynomials<br />

The use <strong>of</strong> the Karatsuba <strong>for</strong>mula and its variants <strong>for</strong> sparse polynomials is<br />

less obvious. One preliminary remark is in order: in the dense case we split<br />

the multiplicands in equation (B.6) or its equivalent in two (the same point <strong>for</strong><br />

each), and we were multiplying components <strong>of</strong> half the size. This is no longer<br />

the case <strong>for</strong> sparse polynomials, e.g. every splitting point <strong>of</strong><br />

(a 7 x 7 + a 6 x 6 + a 5 x 5 + a 0 )(b 7 + b 2 x 2 + b 1 x + b 0 ) (B.7)<br />

gives a 3–1 split <strong>of</strong> one or the other: indeed possibly both, as when we use x 4<br />

as the splitting point.<br />

Worse, in equation (B.5), the component multiplications were on ‘smaller’<br />

polynomials, whereas, measured in number <strong>of</strong> terms, this is no longer the case.<br />

If we split equation (B.7) at x 4 , the sub-problem corresponding to (a+b)∗(c+d)<br />

in equation (B.5) is<br />

(a 7 x 3 + a 6 x 2 + a 5 x 1 + a 0 )(b 3 + b 2 x 2 + b 1 x + b 0 )<br />

which has as many terms as the original (B.7). This difficulty led [Fat03] to<br />

conclude that Karatsuba-based methods did not apply to sparse polynomials.<br />

It is clear that they cannot always apply, since the product <strong>of</strong> a polynomial<br />

with m terms by one with n terms may have mn terms, but it is probaby the<br />

difficulty <strong>of</strong> deciding when they apply that has led system designers to shun<br />

them.<br />

B.3.3<br />

Karatsuba’s method and multivariate polynomials<br />

TO BE COMPLETED<br />

B.3.4<br />

Faster still<br />

It is possible to do still better than 3 k = ( 2 k) log 2 3<br />

<strong>for</strong> multiplying dense polynomials<br />

f and g with n = 2 k coefficients. Let α 0 , . . . , α 2n−1 be distinct values.<br />

If h = fg is the desired product, then h(α i ) = f(α i )g(α i ). Hence if we write<br />

˜f <strong>for</strong> the vector f(α 0 ), f(α 1 ), . . . , f(α 2n−1 ), then ˜h = ˜f ∗ ˜g, where ∗ denoted<br />

element-by-element multiplication <strong>of</strong> vectors, an O(n) operation on vectors <strong>of</strong><br />

length 2n. This gives rise to three questions.<br />

1. What should the α i be?<br />

2. How do we efficiently compute ˜f from f (and ˜g from g)?<br />

3. How do we efficiently compute h from ˜h?<br />

The answer to the first question is that the α j should be the 2n-th roots <strong>of</strong> unity<br />

in order, i.e. over C we would have α i = e 2πij/2n . In practice, though, we work<br />

over a finite field in which these roots <strong>of</strong> unity exist. If we do this, then the

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!