Storage Allocation for the Karatsuba Integer Multipliation 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.