Storage allocation for the Karatsuba integer multiplication algorithm
The Karatsuba (or 3-for-4) integer multiplication algorithm needs some amount of auxiliary memory (in addition to the memory needed to store the result). We give sharp upper and lower bounds for the amount of auxiliary storage required and discuss implementation issues. Since we must never allocate too few memory cells, an asymptotic formula is not sufficient. The bounds are 2(n−4 + 3⌈log2(n−3)⌋) and 2(n−6 + 2⌈log2(n−2)⌋), respectively. The formula for the amount of auxiliary storage is obtained by an exact closed-form solution of a recursion formula involving the floor and ceiling functions. Comparing the upper and lower bounds shows that this simple allocation formula does not waste much memory for any input size.
KeywordsRecursive Call Input Size Recursive Step Ceiling Function Storage Allocation
Unable to display preview. Download preview PDF.
- 1.A. Karatsuba and Yu. Ofman. Multiplication of many-digital numbers by automatic computers. Doklady Akademii nauk SSSR, 145(2), 1962. (in Russian).Google Scholar
- 2.A. Karatsuba and Yu. Ofman. Multiplication of multidigit numbers on automata. Soviet physics doklady, 7(7), 1963.Google Scholar
- 3.D. E. Knuth. Seminumerical Algorithms, volume 2 of The Art of Computer Programming. Addison-Wesley, second edition, 1981.Google Scholar
- 4.Donald E. Knuth, Ronald L. Graham, and Oren Patashnik. Concrete Mathematics. Addison-Wesley, 1989.Google Scholar
- 5.Wolfgang W. Kuechlin, David Lutz, and Nicholas Nevin. Integer multiplication in PARSAC-2 on stock microprocessors. In Proc. AAECC-9, New Orleans. Lecture Notes in Computer Science 539. Berlin: Springer 1991.Google Scholar