Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How does the code accomplish the squaring?

accomplish code squaring
0
Posted

How does the code accomplish the squaring?

0

For a large integer occupying N computer words, a simple digit-by-digit (“grammar school”) multiply operation (which needs on the order of N2 machine operations) is much too slow to be practical. Rather, the code uses a multiply algorithm based on the fast Fourier transform (FFT), which is described in many numerical analysis texts, such as the well-known Numerical Recipes (NR) books. (NR even has a set of so-called multiprecision integer routines, but I suggest staying away from them – they’re awful.) The code also uses the now-well-known Discrete Weighted Transform technique of Crandall and Fagin (for a detailed reference, see the source code header or this research paper) to implicitly do the modding. This permits one to “fill” the digits of the input vector to the FFT-based squaring, and thus to reduce the vector length by a factor of 2 or more relative to any pre-1994 codes. The upshot is, to write the world’s fastest Mersenne testing program, one must write (or make use of) the w

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123