Content deleted Content added
→Schönhage–Strassen: Better description |
|||
Line 381:
{{Main|Schönhage–Strassen algorithm}}
[[File:Integer multiplication by FFT.svg|thumb|350px|Demonstration of multiplying 1234 × 5678 = 7006652 using fast Fourier transforms (FFTs). [[Number-theoretic transform]]s in the integers modulo 337 are used, selecting 85 as an 8th root of unity. Base 10 is used in place of base 2<sup>''w''</sup> for illustrative purposes.]]
The basic idea due to [[Volker Strassen|Strassen]] (1968) is to use fast polynomial multiplication to perform fast integer multiplication. The algorithm was made practical and theoretical guarantees were provided in 1971 by [[Arnold Schönhage|Schönhage]] and Strassen resulting in the [[Schönhage–Strassen algorithm]].<ref name="schönhage">{{cite journal |first1=A. |last1=Schönhage |first2=V. |last2=Strassen |title=Schnelle Multiplikation großer Zahlen |journal=Computing |volume=7 |issue= 3–4|pages=281–292 |date=1971 |doi=10.1007/BF02242355 |s2cid=9738629 |url=https://link.springer.com/article/10.1007/BF02242355}}</ref> The details are the following: We choose the largest integer ''w'' that will not cause [[Integer overflow|overflow]] during the process outlined below. Then we split the two numbers into ''m'' groups of ''w'' bits as follows▼
Every number in base B, can be written as a polynomial:
Furthermore, multiplication of two numbers could be thought of as a product of two polynomials:
Because,for <math> B^k </math>: <math>c_k =\sum_{(i,j):i+j=k}^k {a_ib_j} = \sum_{i=0}^k {a_ib_{k-i}} </math>,
we have a convolution.
By using fft (fast fourier transformation), we can get
We have reduced our convolution problem
to product problem, through fft.
By finding ifft (polynomial interpolation), for each <math>c_k </math>, one get the desired coeffesients.
Algorithm uses divide and conquer strategy, to divide problem to subproblems.
What is important, is to make subproblems of equal size. Using even and odd indexes, give subproblems of same size.
It han an time complexity of O(''n'' log(''n'') log(log(''n''))).
==== History ====
▲
=== Further improvements ===
|