A New Algorithm for Long Integer Cube Computation with Some Insight into Higher Powers

  • Marco Bodrato
  • Alberto Zanoni
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7442)


A new approach for the computation of long integer cube (third power) based on a splitting-in-two divide et impera approach and on a modified Toom-Cook-3 unbalanced method is presented, showing that the “classical” square-and-multiply algorithm is not (always) optimal. The new algorithm is used as a new basic tool to improve long integer exponentiation: different techniques combining binary and ternary exponent expansion are shown. Effective implementations by using the GMP library are tested, and performance comparisons are presented.

AMS Subject Classification

11N64 11A25 13B25 

Keywords and phrases

Toom-Cook cube third power long integers 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Karatsuba, A.A., Ofman, Y.: Multiplication of multidigit numbers on automata. Soviet Physics Doklady 7(7), 595–596 (1963)Google Scholar
  2. 2.
    Toom, A.L.: The complexity of a scheme of functional elements realizing the multiplication of integers. Soviet Mathematics Doklady 3, 714–716 (1963)Google Scholar
  3. 3.
    Cook, S.A.: On the minimum computation time of functions. PhD thesis, Department of Mathematics, Harvard University (1966)Google Scholar
  4. 4.
    Bodrato, M., Zanoni, A.: Integer and polynomial multiplication: towards optimal Toom-Cook matrices. In: Brown, C. (ed.) ISSAC 2007: Proceedings of the 2007 International Symposium on Symbolic and Algebraic Computation, pp. 17–24. ACM, New York (2007)CrossRefGoogle Scholar
  5. 5.
    Fürer, M.: Faster integer multiplication. In: Johnson, D.S., Feige, U. (eds.) STOC, pp. 57–66. ACM (2007)Google Scholar
  6. 6.
    Schönhage, A., Strassen, V.: Schnelle Multiplikation großer Zahlen. Computing 7(3-4), 281–292 (1971)zbMATHCrossRefGoogle Scholar
  7. 7.
    Granlund, T., et al.: The GNU multiple precision (GMP) library (2010),
  8. 8.
    PARI/GP: PARI/GP, version 2.5.0. The PARI Group, Bordeaux (2012),
  9. 9.
    Zanoni, A.: Another sugar cube, please! or sweetening third powers computation. Technical Report 632, Centro ”Vito Volterra”, Università di Roma ”Tor Vergata” (January 2010)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Marco Bodrato
    • 1
  • Alberto Zanoni
    • 2
  1. 1.mambaSoftTorinoItaly
  2. 2.Dipartimento di Scienze StatisticheUniversità “Sapienza”RomaItaly

Personalised recommendations