Open Petersutor Honorsthesis.Pdf

Open Petersutor Honorsthesis.Pdf

THE PENNSYLVANIA STATE UNIVERSITY SCHREYER HONORS COLLEGE DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING AN IMPLEMENTATION AND ANALYSIS OF FÜRER’S FASTER INTEGER MULTIPLICATION ALGORITHM PETER SUTOR JR. SPRING 2014 A thesis submitted in partial fulfillment of the requirements for baccalaureate degrees in Computer Science and Mathematics with honors in Computer Science Reviewed and approved* by the following: Martin Fürer Professor of Computer Science and Engineering Thesis Supervisor John Joseph Hannan Associate Professor of Computer Science and Engineering Honors Adviser * Signatures are on file in the Schreyer Honors College. i ABSTRACT For over 35 years, the fastest known method of computing the product of two integers has been the Schönhage-Strassen algorithm, until Fürer’s algorithm was created in 2007. Since then, however, no known implementations of Fürer’s algorithm have ever been created. In this thesis, an implementation of Fürer’s algorithm is presented, coded in Java, and analyzed. This implementation is then compared to an implementation of the Schönhage-Strassen algorithm to analyze the running speeds for increasing values of , the length of the two integers to multiply in binary. For large enough , Fürer’s algorithm is asymptotically faster than Schönhage-Strassen’s algorithm. The claim that an implementation of Fürer’s algorithm should then be faster for comparable is investigated and conclusions are drawn about the practicality of Fürer’s algorithm in practice, using observations from the implementation. ii TABLE OF CONTENTS List of Definitions ................................................................................................................................. iii List of Theorems ................................................................................................................................... iv List of Algorithms ................................................................................................................................. v List of Figures ....................................................................................................................................... vi List of Tables ......................................................................................................................................... vii Acknowledgements ............................................................................................................................... viii Chapter 1: Introduction ......................................................................................................................... 1 Chapter 2: The Schönhage-Strassen Algorithm of Integer Multiplication ............................................ 4 Section 2.1: Integer Multiplication ............................................................................................... 4 Section 2.2: The Discrete and the Fast Fourier Transform (DFT / FFT) ...................................... 7 Section 2.3: The Convolution Theorem ........................................................................................ 13 Section 2.4: The Schönhage-Strassen Algorithm ......................................................................... 16 Chapter 3: Fürer’s Algorithm of Faster Integer Multiplication ............................................................. 19 Section 3.1: The Idea .................................................................................................................... 19 Section 3.2: Fürer’s Fast Fourier Transform ................................................................................. 21 Section 3.3: Fürer’s Ring R .......................................................................................................... 25 Section 3.4: The Faster Integer Multiplication Algorithm ............................................................ 28 Chapter 4: Java Implementations of the Algorithms ............................................................................. 35 Section 4.1: Classes and Implementation Details ......................................................................... 35 Section 4.2: The Schönhage-Strassen Implementation ................................................................. 36 Section 4.3: The Faster Integer Multiplication Implementation ................................................... 38 Chapter 5: Analysis of the Implementations ......................................................................................... 40 Section 5.1: Runtime Comparisons............................................................................................... 40 Section 5.2: Implementation Analysis .......................................................................................... 43 Section 5.3: Conclusions............................................................................................................... 44 Chapter 6: Appendices and References ................................................................................................. 46 Appendix A: Fürer’s Faster Integer Multiplication Java Implementation ................................... 47 Appendix B: Fürer’s Faster Integer Multiplication Java Implementation ................................... 49 Appendix C: Fürer’s Faster Integer Multiplication Java Implementation ................................... 52 Appendix D: Fürer’s Faster Integer Multiplication Java Implementation ................................... 54 Appendix E: Fürer’s Faster Integer Multiplication Java Implementation .................................... 56 Appendix F: Fürer’s Faster Integer Multiplication Java Implementation .................................... 59 References .................................................................................................................................... 66 iii LIST OF DEFINITIONS Definition 1-1. The Log Star Operation ................................................................................... 3 Definition 2.1-1. Integer .......................................................................................................... 4 Definition 2.1-2. Integer Multiplication. .................................................................................. 5 Definition 2.1-3. Polynomial Interpolation. ............................................................................. 7 Definition 2.2-1. The Discrete Fourier Transform. .................................................................. 9 Definition 2.2-2. Primitive th Root of Unity. ........................................................................ 10 Definition 2.2-3. Principal th Root of Unity. ......................................................................... 10 Definition 2.2-4. The Inverse Discrete Fourier Transform. ..................................................... 10 Definition 2.3-1. The Convolution. .......................................................................................... 13 Definition 2.3-2. The Circular Convolution............................................................................. 14 Definition 2.3-3. The Discrete Circular Convolution. ............................................................. 14 Definition 3.1-1. Rings. ........................................................................................................... 19 Definition 3.1-2. The Fermat Numbers. ................................................................................... 20 Definition 3.2-1. Twiddle Factors. ........................................................................................... 23 Definition 3.2-2. -point Half-DFT. ....................................................................................... 23 Definition 3.3-1. A Polynomial Ring. ...................................................................................... 25 iv LIST OF THEOREMS Theorem 2.1-1. Unisolvence Theorem .................................................................................... 6 Theorem 2.2-1. DFT Bijectivity. ............................................................................................. 10 Theorem 2.2-2. Euler’s Formula .............................................................................................. 12 Theorem 2.3-1. The Convolution Theorem ............................................................................. 15 Theorem 2.3-2. The Modified Convolution Theorem ............................................................. 15 Theorem 2.4-1. Floating Point Precision For SSA .................................................................. 17 Theorem 3.3-1. The Chinese Remainder Theorem .................................................................. 25 Theorem 3.3-2. The Half-DFT Isomorphism........................................................................... 26 Theorem 3.3-3. Principal th Root of Unity for a Power of 2 ............................................ 27 Theorem 3.3-4. The Variable in R ........................................................................................ 27 Theorem 3.3-5. The Norm of .......................................................................................... 27 v LIST OF ALGORITHMS Algorithm 2.1-1. The Long Multiplication Algorithm ............................................................ 5 Algorithm 2.2-1. The Cooley-Tukey Fast Fourier Transform ................................................. 11 Algorithm 2.2-2. The Inverse Cooley-Tukey Fast Fourier Transform .................................... 13 Algorithm

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    77 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us