Irrational base discrete weighted transform
In mathematics, the irrational base discrete weighted transform (IBDWT) is a variant of the fast Fourier transform using an irrational base; it was developed by Richard Crandall (Reed College), Barry Fagin (Dartmouth College) and Joshua Doenias (NeXT Software)[1] in the early 1990s using Mathematica.[2]
The IBDWT is used in the Great Internet Mersenne Prime Search's client Prime95 to perform FFT multiplication, as well as in other programs implementing Lucas–Lehmer test, such as CUDALucas and Glucas.[3]
Algorithm
The IBDWT method, as applied to the Lucas-Lehmer test for Mersenne primes (which requires repeated squaring modulo a Mersenne number ), is based on four key elements developed by Crandall and Fagin:[3]
- Balanced-radix representations: Allows digits to be signed (e.g., in the range ), which reduces error bounds.[3]
- Variable-base digit representations: Allows each digit to have its own base .[3]
- Weighted cyclic convolutions: The multiplication is performed using a Discrete Weighted Transform (DWT).[3]
- Irrational numeric bases: The base used for the transform is irrational.[3]
This approach avoids the need for zero-padding the arrays and performs the multiplication modulo directly.[3] The algorithm to compute the product is as follows:[3]
- Choose a run length (signal-length) .[3]
- Establish a variable base representation for the numbers. For example, .[3] Each term is usually between 16 and 20 bits if using double-precision terms.
- Define a weight-signal where each component , approximated by floats in the interval [1, 2).[3]
- Compute the forward DWT for both numbers: and . This is practically computed using a standard DFT (like an FFT) as .[3]
- Perform a component-wise product of the transformed arrays: .[3]
- Compute the inverse DWT: . This is computed as .[3]
- Round the resulting components to the nearest integer: , optionally checking the roundoff error is no greater than 0.4 (greater indicates too many integer bits stuffed into each term).[3]
- Adjust the resulting digits to restore the variable-base radix representation. This step handles carries and borrows. Single-step partial carrying is sufficient.[3]
References
- ↑ Crandall, Richard (1997). "The Challenge of Large Numbers". Scientific American 276 (2): 74–78. doi:10.1038/scientificamerican0297-74. Bibcode: 1997SciAm.276b..74C. https://jstor.org/stable/24993611. Retrieved 29 March 2023.
- ↑ "Mathematica Use of Renowned Computational Scientist and Author Richard Crandall". Wolfram Research. https://wolfram.com/customer-stories/mathematica-use-of-renowned-computational-scientist-and-author-richard-crandall.html.
- ↑ 3.00 3.01 3.02 3.03 3.04 3.05 3.06 3.07 3.08 3.09 3.10 3.11 3.12 3.13 3.14 3.15 Thall, Andrew. "Fast Mersenne Prime Testing on the GPU". https://ece.northeastern.edu/groups/nucar/GPGPU4/files/thall.pdf.
- Richard Crandall, Barry Fagin: Discrete weighted transforms and large-integer arithmetic, Mathematics of Computation 62, 205, 305-324, January 1994 (PDF file)
- Richard Crandall: Topics in Advanced Scientific Computation, TELOS/Springer-Verlag
