Skip to main content

On the Division in the Computation of Binary BBP-Type Formulas for Mathematical Constants

  • Conference paper
  • First Online:
Numerical Computations: Theory and Algorithms (NUMTA 2023)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 14477))

  • 146 Accesses

Abstract

In this paper, we discuss the division in the computation of binary Bailey–Borwein–Plouffe (BBP)-type formulas for mathematical constants. To compute a specific digit of a mathematical constant using a BBP-type formula, we need only calculate the fractional part of the sum of quotients. It is sufficient to perform division and summation for BBP-type formulas in fixed-point arithmetic for only the fractional part. In our previous work, calculation of the fractional part of a 128-bit quotient of a 64-bit dividend divided by a 64-bit divisor was performed in fixed-point arithmetic based on the exact division. We extend this to the case where calculation of the fractional part of an m-word quotient of a one-word dividend divided by a one-word divisor is performed in fixed-point arithmetic. When performing an exact division in binary, the denominator of the fraction must be an odd number. We show that even if the denominator of the fraction is an even number, exact division can be performed using the method of applying Montgomery multiplication to modular exponentiation in binary BBP-type formulas. We also show that rounding the quotient in the computation of binary BBP-type formulas reduces the accumulation of the round-off errors better than truncating the quotient.

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

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

References

  1. Adamchik, V., Wagon, S.: \(\pi \): a 2000-year-old search changes direction. Math. Edu. Res. 5, 11–19 (1996)

    MATH  Google Scholar 

  2. Adamchik, V., Wagon, S.: A simple formula for \(\pi \). Am. Math. Mon. 104, 852–855 (1997)

    MathSciNet  MATH  Google Scholar 

  3. Adegoke, K., Lafont, J.O., Layeni, O.: A class of digit extraction BBP-type formulas in general binary bases. Notes Number Theory Discret. Math. 17, 18–32 (2011)

    MATH  Google Scholar 

  4. Bailey, D., Borwein, P., Plouffe, S.: On the rapid computation of various polylogarithmic constants. Math. Comput. 66, 903–913 (1997)

    Article  MathSciNet  MATH  Google Scholar 

  5. Bailey, D.H.: The BBP algorithm for pi (2006). https://www.davidhbailey.com/dhbpapers/bbp-alg.pdf

  6. Bailey, D.H.: A compendium of BBP-type formulas for mathematical constants (2023). https://www.davidhbailey.com/dhbpapers/bbp-formulas.pdf

  7. Bailey, D.H., Crandall, R.E.: On the random character of fundamental constant expansions. Exp. Math. 10, 175–190 (2001)

    Article  MathSciNet  MATH  Google Scholar 

  8. Bellard, F.: A new formula to compute the n’th binary digit of pi (1997). https://bellard.org/pi/pi_bin.pdf

  9. Borwein, J., Bailey, D.: Mathematics by experiment: plausible reasoning in the 21st century, 2nd edn. A K Peters, Natick (2008)

    Book  MATH  Google Scholar 

  10. Craig-Wood, N.: Euler found the first binary digit extraction formula for \(\pi \) in 1779. Euleriana 3, Article 3 (2023)

    Google Scholar 

  11. Fog, A.: Instruction tables: lists of instruction latencies, throughputs and micro-operation breakdowns for Intel, AMD, and VIA CPUs (2022). https://www.agner.org/optimize/instruction_tables.pdf

  12. Jebelean, T.: An algorithm for exact division. J. Symb. Comput. 15, 169–180 (1993)

    Article  MathSciNet  MATH  Google Scholar 

  13. Karrels, E.: Computing the quadrillionth digit of \(\pi \) (2013). https://on-demand.gputechconf.com/gtc/2013/presentations/S3071-Computing-the-Quadrillionth-Digit-of-Pi.pdf

  14. Montgomery, P.L.: Modular multiplication without trial division. Math. Comput. 44, 519–521 (1985)

    Article  MathSciNet  MATH  Google Scholar 

  15. Sze, T.W.: The two quadrillionth bit of pi is 0! distributed computation of pi with Apache Hadoop. In: Proc. 2010 IEEE Second International Conference on Cloud Computing Technology and Science (CloudCom 2010), pp. 727–732 (2010)

    Google Scholar 

  16. Takahashi, D.: Computation of the 100 quadrillionth hexadecimal digit of \(\pi \) on a cluster of Intel Xeon Phi processors. Parallel Comput. 75, 1–10 (2018)

    Article  MathSciNet  MATH  Google Scholar 

  17. Takahashi, D.: On the computation and verification of \(\pi \) using BBP-type formulas. Ramanujan J. 51, 177–186 (2020)

    Article  MathSciNet  MATH  Google Scholar 

  18. Takahashi, D.: On the use of Montgomery multiplication in the computation of binary BBP-type formulas for mathematical constants. Ramanujan J. 59, 211–219 (2022)

    Article  MathSciNet  MATH  Google Scholar 

Download references

Acknowledgments

This work was supported by JSPS KAKENHI Grant Number JP22K12045.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Daisuke Takahashi .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2025 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Takahashi, D. (2025). On the Division in the Computation of Binary BBP-Type Formulas for Mathematical Constants. In: Sergeyev, Y.D., Kvasov, D.E., Astorino, A. (eds) Numerical Computations: Theory and Algorithms. NUMTA 2023. Lecture Notes in Computer Science, vol 14477. Springer, Cham. https://doi.org/10.1007/978-3-031-81244-6_32

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-81244-6_32

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-81243-9

  • Online ISBN: 978-3-031-81244-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics