10.12.2012 Views

Prime Numbers

Prime Numbers

Prime Numbers

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

9.5 Large-integer multiplication 491<br />

}<br />

zn = v mod B;<br />

carry = ⌊v/B⌋;<br />

7. [Final digit adjustment]<br />

Delete leading zeros, with possible carry > 0 as a high digit of z;<br />

return z;<br />

This algorithm description is intended to be general, conveying only the<br />

principles of FFT multiplication, which are transforming, rounding, carry<br />

adjustment. There are a great many details left unsaid, not to mention a great<br />

number of enhancements, some of which we address later. But beyond these<br />

minutiae there is one very strong caveat: The accuracy of the floating-point<br />

arithmetic must always be held suspect. A key step in the general algorithm<br />

is the elementwise rounding of the z signal. If floating-point errors in the<br />

FFTs are too large, an element of the convolution z could get rounded to an<br />

incorrect value.<br />

One immediate practical enhancement to Algorithm 9.5.12 is to employ<br />

the balanced representation of Definition 9.1.2. It turns out that floatingpoint<br />

errors are significantly reduced in this representation [Crandall and<br />

Fagin 1994], [Crandall et al. 1999]. This phenomenon of error reduction is<br />

not completely understood, but certainly has to do with the fact of generally<br />

smaller magnitude for the digits, plus, perhaps, some cancellation in the DFT<br />

components because the signal of digits has a statistical mean (in engineering<br />

terms, “DC component”) that is very small, due to the balancing.<br />

Before we move on to algorithmic issues such as further enhancements to<br />

the FFT multiply and the problem of pure-integer convolution, we should<br />

mention that convolutions can appear in number-theoretical work quite<br />

outside the large-integer arithmetic paradigm. We give two examples to end<br />

this subsection; namely, convolutions applied to sieving and to regularity<br />

results on primes.<br />

Consider the following theorem, which is reminiscent of (although<br />

obviously much less profound than) the celebrated Goldbach conjecture:<br />

Theorem 9.5.13. Let N =2·3·5 ···pm be a product of consecutive primes.<br />

Then every sufficiently large even n is a sum n = a+b with each of a, b coprime<br />

to N.<br />

It is intriguing that this theorem can be proved, without too much trouble,<br />

via convolution theory. (We should point out that there are also proofs using<br />

CRT ideas, so we are merely using this theorem to exemplify applications of<br />

discrete convolution methods (see Exercise 9.40).) The basic idea is to consider<br />

a special signal y defined by yj =1ifgcd(j, N) = 1, else yj =0,withthe<br />

signal given some cutoff length D. Now the acyclic convolution y ×A y will tell<br />

us precisely which n

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

Saved successfully!

Ooh no, something went wrong!