Top Qs
Timeline
Chat
Perspective
Irrational base discrete weighted transform
Variant of fast Fourier transform From Wikipedia, the free encyclopedia
Remove ads
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. It implies a fast, practical implementation of large-number modular multiplication on modern computers, at asymptotically 2× faster than non-modular FFT multiplication.[2][3]
It is most notably used in the Great Internet Mersenne Prime Search.
Remove ads
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:[4]
- Balanced-radix representations: Allows digits to be signed (e.g., in the range ), which reduces error bounds.[4]
- Variable-base digit representations: Allows each digit to have its own base .[4]
- Weighted cyclic convolutions: The multiplication is performed using a Discrete Weighted Transform (DWT).[4]
- Irrational numeric bases: The base used for the transform is irrational.[4]
This approach avoids the need for zero-padding the arrays and performs the multiplication modulo directly.[4] The algorithm to compute the product is as follows:[4]
- Choose a run length (signal-length) .[4]
- Establish a variable base representation for the numbers. For example, .[4] Each term is usually between 16 and 20 bits if using double-precision terms. The maximum size of each term is determined empirically,[a] at least before the contribution of Percival 2003.
- Define a weight-signal where each component , approximated by floats in the interval [1, 2).[4]
- Compute the forward DWT for both numbers: and . This is practically computed using a standard DFT (like an FFT) as .[4]
- Perform a component-wise product of the transformed arrays: .[4]
- Compute the inverse DWT: . This is computed as .[4]
- 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).[4]
- Adjust the resulting digits to restore the variable-base radix representation. This step handles carries and borrows. Single-step partial carrying is sufficient.[4]
Remove ads
Applications
Summarize
Perspective
Double-precision IBDWT is used in the Great Internet Mersenne Prime Search's x86 client Prime95 to perform modular multiplication in the Lucas–Lehmer test and Fermat primarily tests. The prime95 IBDWT library gwnum is also used in programs such as PrimeGrid's LLR2 and PRST. It is chosen because x86 CPUs since Pentium 4 have so much double-precision floating-point computing power that it is much faster to multiply numbers using IBDWT than to do the so using a more straightforward integer FFT (NTT).
Double-precision IBDWT has also been ported to other CPU architectures in the form of Glucas. It has also been ported to GPUs in the form of CUDALucas, GPUowl, and PRPLL.[4]
IBDWT can also be done using integer arithmetic modulo 264-232+1, a number theoretic transform. This approach was first demonstrated by Nick Craig-Wood in ARMPrime.[5] This too has been ported to GPUs, providing an alternative for consumer GPUs with weak double-precision computing power but acceptable 32-bit integer power, especially Nvidia models from the 2020s boasting "1:1" or "1:2" 32-bit integer multiplication speed but "1:64" double-precision speed relative to 32-bit floating-point.[6]
Derived methods
Granger and Scott demonstrated using IBDWT-inspired "GRP (generalized repunit prime) multiplication" to accelerate eliptic curve cryptography over F(2521-1), the P-521. This is a Karatsuba-like technique featuring a cyclic convolution similar to IBDWT.[3]
Remove ads
Notes
References
Further reading
Wikiwand - on
Seamless Wikipedia browsing. On steroids.
Remove ads