Skip to main content

Easy Multiple-Precision Divisors and Word-RAM Constants

  • Conference paper
  • First Online:
Mathematical Foundations of Computer Science 2015 (MFCS 2015)

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 9235))

  • 940 Accesses

Abstract

For integers \(b\ge 2\) and \(w\ge 1\), define the (b, w) cover size of an integer A as the smallest nonnegative integer k such that A can be written in the form \(A=\sum _{i=1}^k(-1)^{\sigma _i}b^{\ell _i}d_i\), where \(\sigma _i\), \(\ell _i\) and \(d_i\) are nonnegative integers and \(0\le d_i<b^w\), for \(i=1,\ldots ,k\). We study the efficient execution of arithmetic operations on (multiple-precision) integers of small (bw) cover size on a word RAM with words of w b-ary digits and constant-time multiplication and division. In particular, it is shown that if A is an n-digit integer and B is a nonzero m-digit integer of (bw) cover size k, then \(\lfloor A/B\rfloor \) can be computed in \(O(1+{{(k n+m)}/w})\) time. Our results facilitate a unified description of word-RAM algorithms operating on integers that may occupy a fraction of a word or several words.

As an application, we consider the fast generation of integers of a special form for use in word-RAM computation. Many published word-RAM algorithms divide a w-bit word conceptually into equal-sized fields and employ full-word constants whose field values depend in simple ways on the field positions. The constants are either simply postulated or computed with ad-hoc methods. We describe a procedure for obtaining constants of the following form in constant time: The ith field, counted either from the right or from the left, contains g(i), where g is a constant-degree polynomial with integer coefficients that, disregarding mild restrictions, can be arbitrary. This general form covers almost all cases known to the author of word-RAM constants used in published algorithms.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Aho, A.V., Hopcroft, J.E., Ullman, J.D.: The Design and Analysis of Computer Algorithms. Addison-Wesley, Reading (1974)

    MATH  Google Scholar 

  2. Andersson, A., Hagerup, T., Nilsson, S., Raman, R.: Sorting in linear time? J. Comput. Syst. Sci. 57(1), 74–93 (1998)

    Article  MathSciNet  MATH  Google Scholar 

  3. Brand, M.: Constant-time sorting. Inform. Comput. 237, 142–150 (2014)

    Article  MathSciNet  MATH  Google Scholar 

  4. Cole, R., Vishkin, U.: Deterministic coin tossing with applications to optimal parallel list ranking. Inform. Control 70(1), 32–53 (1986)

    Article  MathSciNet  MATH  Google Scholar 

  5. Fredman, M.L., Willard, D.E.: Surpassing the information theoretic bound with fusion trees. J. Comput. Syst. Sci. 47(3), 424–436 (1993)

    Article  MathSciNet  MATH  Google Scholar 

  6. Fürer, M.: Faster integer multiplication. SIAM J. Comput. 39(3), 979–1005 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  7. Graham, R.L., Knuth, D.E., Patashnik, O.: Concrete Mathematics: A Foundation for Computer Science. Addison-Wesley, Reading (1989)

    MATH  Google Scholar 

  8. Hagerup, T., Kammer, F.: Dynamic data structures for the succinct RAM (2015) (in preparation)

    Google Scholar 

  9. Knuth, D.E.: The Art of Computer Programming, Volume 2: Seminumerical Algorithms, 3rd edn. Addison-Wesley, Upper Saddle River (1998)

    MATH  Google Scholar 

  10. Knuth, D.E.: The Art of Computer Programming, Volume 4A: Combinatorial Algorithms, Part 1. Addison-Wesley, Upper Saddle River (2011)

    Google Scholar 

  11. Schönhage, A.: Storage modification machines. SIAM J. Comput. 9(3), 490–508 (1980)

    Article  MathSciNet  MATH  Google Scholar 

  12. Schönhage, A., Strassen, V.: Schnelle Multiplikation großer Zahlen. Computing 7(3–4), 281–292 (1971)

    Article  MathSciNet  MATH  Google Scholar 

  13. Warren Jr., H.S.: Hacker’s Delight, 2nd edn. Addison-Wesley, Upper Saddle River (2013)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Torben Hagerup .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Hagerup, T. (2015). Easy Multiple-Precision Divisors and Word-RAM Constants. In: Italiano, G., Pighizzini, G., Sannella, D. (eds) Mathematical Foundations of Computer Science 2015. MFCS 2015. Lecture Notes in Computer Science(), vol 9235. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-662-48054-0_31

Download citation

  • DOI: https://doi.org/10.1007/978-3-662-48054-0_31

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-662-48053-3

  • Online ISBN: 978-3-662-48054-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics