Abstract
We consider the computation of Bernoulli, Tangent (zag), and Secant (zig or Euler) numbers. In particular, we give asymptotically fast algorithms for computing the first n such numbers O(n 2(logn)2 + o(1)). We also give very short in-place algorithms for computing the first n Tangent or Secant numbers in O(n 2) integer operations. These algorithms are extremely simple and fast for moderate values of n. They are faster and use less space than the algorithms of Atkinson (for Tangent and Secant numbers) and Akiyama and Tanigawa (for Bernoulli numbers).
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Abramowitz, M., Stegun, I.A.: Handbook of Mathematical Functions. Dover (1973)
Atkinson, M.D.: How to compute the series expansions of sec x and tan x. Am. Math. Monthly 93, 387–389 (1986)
Bailey, D.H., Borwein, J.M., Crandall, R.E.: On the Khintchine constant. Math. Comput. 66, 417–431 (1997)
Borwein, J.M., Corless, R.M.: Emerging tools for experimental mathematics. Am. Math. Mon. 106, 899–909 (1999)
Bosma, W., Cannon, J., Playoust, C.: The Magma algebra system. I: the user language. J. Symbolic Comput. 24, 235–265 (1997)
Brent, R.P.: Unrestricted algorithms for elementary and special functions. Information Processing, vol. 80, pp. 613–619. North-Holland, Amsterdam (1980). arXiv:1004.3621v1
Brent, R.P., Zimmermann, P.: Modern Computer Arithmetic. Cambridge University Press, Cambridge (2010). arXiv:1004.4710v1
Buhler, J., Crandall, R., Sompolski, R.: Irregular primes to one million. Math. Comput. 59, 717–722 (1992)
Buhler, J., Crandall, R., Ernvall, R., Metsänkylä, T.: Irregular primes to four million. Math. Comput. 61, 151–153 (1993)
Buhler, J., Crandall, R., Ernvall, R., Metsänkylä, T., Shokrollahi, M.A.: Irregular primes and cyclotomic invariants to twelve million. J. Symbolic Comput. 31, 89–96 (2001)
Buhler, J., Harvey, D.: Irregular primes to 163 million. Math. Comput. 80, 2435–2444 (2011)
Clausen, T.: Theorem. Astron. Nachr. 17, 351–352 (1840)
Crandall, R.E.: Topics in Advanced Scientific Computation. Springer, New York (1996)
Crandall, R.E., Pomerance, C.: Prime Numbers: A Computational Perspective. Springer, New York (2001)
Dilcher, K., Slavutskii, I.Sh.: A Bibliography of Bernoulli Numbers (last updated March 3, 2007). http://www.mscs.dal.ca/%7Edilcher/bernoulli.html.
Ferguson, H.R.P., Bailey, D.H., Arno, S.: Analysis of PSLQ, an integer relation finding algorithm. Math. Comput. 68, 351–369 (1999)
Fürer, M.: Faster integer multiplication. Proceedings of 39th Annual ACM Symposium on Theory of Computing (STOC), pp. 57–66. ACM, San Diego (2007)
Graham, R.L., Knuth, D.E., Patashnik, O.: Concrete Mathematics, 3rd edn. Addison-Wesley, Reading (1994)
Hare, K.: Multisectioning, rational poly-exponential functions and parallel computation. M.Sc. thesis, Department of Mathematics and Statistics, Simon Fraser University, Canada (2002)
Harvey, D.: A multimodular algorithm for computing Bernoulli numbers. Math. Comput. 79, 2361–2370 (2010)
Kaneko, M.: The Akiyama–Tanigawa algorithm for Bernoulli numbers. J. Integer Seq. 3, Article 00.2.9, 6 (2000). http://www.cs.uwaterloo.ca/journals/JIS/
Knuth, D.E.: Euler’s constant to 1271 places. Math. Comput. 16, 275–281 (1962)
Knuth, D.E., Buckholtz, T.J.: Computation of Tangent, Euler, and Bernoulli numbers. Math. Comput. 21, 663–688 (1967)
Kung, H.T.: On computing reciprocals of power series. Numer. Math. 22, 341–348 (1974)
Schönhage, A., Strassen, V.: Schnelle Multiplikation großer Zahlen. Computing 7, 281–292 (1971)
Sieveking, M.: An algorithm for division of power series. Computing 10, 153–156 (1972)
Sloane, N.J.A.: The on-line encyclopedia of integer sequences. http://oeis.org
Von Staudt, K.G.C.: Beweis eines Lehrsatzes, die Bernoullischen Zahlen betreffend. J. Reine Angew. Math. 21, 372–374 (1840). http://gdz.sub.uni-goettingen.de
Steel, A.: Reduce everything to multiplication. Presented at Computing by the Numbers: Algorithms, Precision and Complexity. Workshop for Richard Brent’s 60th Birthday, Berlin, 2006. http://www.mathematik.hu-berlin.de/%7Egaggle/EVENTS/2006/BRENT60/
Stein, W. et al.: Sage. http://www.sagemath.org/
Titchmarsh, E.C.: The Theory of the Riemann Zeta-Function, 2nd edn (revised by D. R. Heath-Brown). Clarendon Press, Oxford (1986)
Acknowledgements
We thank Jon Borwein for encouraging the belief that high-precision computations are useful in “experimental” mathematics [4], e.g. in the PSLQ algorithm [16]. Ben F. “Tex” Logan, Jr. (unpublished observation, mentioned in [18, Sect. 6.5]) suggested the use of Tangent numbers to compute Bernoulli numbers. Christian Reinsch (about 1979, acknowledged in [6], Personal communication to R.P. Brent) pointed out the numerical instability of the recurrence (8.7) and suggested the use of the numerically stable recurrence (8.8). Christopher Heckman kindly drew our attention to Atkinson’s algorithm [2]. We thank Paul Zimmermann for his comments. Some of the material presented here is drawn from the recent book Modern Computer Arithmetic [7] (and as-yet-unpublished solutions to exercises in the book). In particular, see [7, Sect. 4.7.2 and Exercises 4.35–4.41]. Finally, we thank David Bailey, Richard Crandall, and two anonymous referees for suggestions and pointers to additional references.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Additional information
Note added in proof
Recently the second author [A subquadratic algorithm for computing the n-th Bernoulli number, arXiv:1209.0533, to appear in Mathematics of Computation] has given an improved algorithm for the computation of a single Bernoulli number. The new algorithm reduces the exponent from 2 + o(1) to \(4/3 + o(1)\).
Communicated by David H. Bailey.
Rights and permissions
Copyright information
© 2013 Springer Science+Business Media New York
About this paper
Cite this paper
Brent, R.P., Harvey, D. (2013). Fast Computation of Bernoulli, Tangent and Secant Numbers. In: Bailey, D., et al. Computational and Analytical Mathematics. Springer Proceedings in Mathematics & Statistics, vol 50. Springer, New York, NY. https://doi.org/10.1007/978-1-4614-7621-4_8
Download citation
DOI: https://doi.org/10.1007/978-1-4614-7621-4_8
Published:
Publisher Name: Springer, New York, NY
Print ISBN: 978-1-4614-7620-7
Online ISBN: 978-1-4614-7621-4
eBook Packages: Mathematics and StatisticsMathematics and Statistics (R0)