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 (b, w) 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 (b, w) 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.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Aho, A.V., Hopcroft, J.E., Ullman, J.D.: The Design and Analysis of Computer Algorithms. Addison-Wesley, Reading (1974)
Andersson, A., Hagerup, T., Nilsson, S., Raman, R.: Sorting in linear time? J. Comput. Syst. Sci. 57(1), 74–93 (1998)
Brand, M.: Constant-time sorting. Inform. Comput. 237, 142–150 (2014)
Cole, R., Vishkin, U.: Deterministic coin tossing with applications to optimal parallel list ranking. Inform. Control 70(1), 32–53 (1986)
Fredman, M.L., Willard, D.E.: Surpassing the information theoretic bound with fusion trees. J. Comput. Syst. Sci. 47(3), 424–436 (1993)
Fürer, M.: Faster integer multiplication. SIAM J. Comput. 39(3), 979–1005 (2009)
Graham, R.L., Knuth, D.E., Patashnik, O.: Concrete Mathematics: A Foundation for Computer Science. Addison-Wesley, Reading (1989)
Hagerup, T., Kammer, F.: Dynamic data structures for the succinct RAM (2015) (in preparation)
Knuth, D.E.: The Art of Computer Programming, Volume 2: Seminumerical Algorithms, 3rd edn. Addison-Wesley, Upper Saddle River (1998)
Knuth, D.E.: The Art of Computer Programming, Volume 4A: Combinatorial Algorithms, Part 1. Addison-Wesley, Upper Saddle River (2011)
Schönhage, A.: Storage modification machines. SIAM J. Comput. 9(3), 490–508 (1980)
Schönhage, A., Strassen, V.: Schnelle Multiplikation großer Zahlen. Computing 7(3–4), 281–292 (1971)
Warren Jr., H.S.: Hacker’s Delight, 2nd edn. Addison-Wesley, Upper Saddle River (2013)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights 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)