Improved approximations for the perimeter of an ellipse
Version 1 / Nov 27, 2026 / CC BY 4.0
Abstract
We give three closed formulas, with three, four and six square roots, for the perimeter of an ellipse with semi-axes . In exact arithmetic their maximum relative errors over all eccentricities, , and , lie below the unit roundoff of single, double and quadruple precision, respectively, and evaluated in that precision they are accurate to within about six units of it (for quadruple precision, as estimated with -digit decimal arithmetic). Each formula writes a fixed number of steps of the arithmetic--geometric mean (AGM) as one expression, in a form that avoids the harmful cancellation. For flat ellipses, where any fixed number of AGM steps eventually fails (as it tends to instead of ), it switches to an approximation based on Legendre's relation, which expresses the complete elliptic integral of the second kind exactly through the integral of the first kind and two power series in : the AGM steps supply an estimate of , and the series are truncated to short polynomials. A final term makes the formula continuous at the switch, and we give the range of its coefficient that suffices for each precision. We prove that for every switch point and every accuracy there are such continuous formulas, and that the error of the continuous formula is at most that of the AGM branch plus twice that of the flat-ellipse branch. The formulas are exact at and at ; numerically, they are increasing in and more accurate than Ramanujan's second approximation at every eccentricity, by factors of at least , and . With the latency of three, four or six AGM steps, they are faster than an AGM loop of the same accuracy for flat ellipses, where the loop needs more steps.
We also study nested-radical generalisations of Ramanujan's second approximation, with and a constant plus nested square roots of a polynomial in . Ramanujan's formula is a degenerate member of a one-parameter family of double-nested forms that agree with the Gauss--Kummer series through . We derive double- and triple-nested formulas with integer coefficients and double-, triple- and quadruple-nested formulas with real coefficients: formulas that are, as verified numerically, nowhere less accurate than Ramanujan's, formulas that agree with the series to the highest order possible for their depth, and minimax formulas. The best of them reduce the maximum error of Ramanujan's formula by up to five orders of magnitude. We also give a numerically stable evaluation in powers of , tabulate the errors of all formulas at seven eccentricities where the perimeter has a closed form, and compare their cost with that of the AGM in double and single precision.
Provenance statement
Tools used
- Anthropic
- Claude OpusVersion 5.5
References
- M. Abramowitz and I. A. Stegun (eds.), Handbook of Mathematical Functions , Nat. Bur. Standards Appl. Math. Ser. 55, Washington, 1964.
- S. Adlaj, An eloquent formula for the perimeter of an ellipse , Notices Amer. Math. Soc. 59 (2012), no. 8, 1094--1099. 10.1090/noti879DOI
- G. Almkvist and B. C. Berndt, Gauss, Landen, Ramanujan, the arithmetic-geometric mean, ellipses, , and the Ladies Diary , Amer. Math. Monthly 95 (1988), no. 7, 585--608. 10.2307/2323302DOI
- S. E. Ayala-Raggi and M. Rendón-Marín, Is simplicity still possible for a more accurate approximation to the perimeter of the ellipse? or, Using the exponential function to further improve the second Ramanujan's approximation , preprint arXiv:2510.16191 (https://arxiv.org/abs/2510.16191), 2025.arXiv
- S. E. Ayala-Raggi and M. Rendón-Marín, Approximating the ellipse perimeter by ``bending the line'': the ELIP closed-form family , preprint arXiv:2610.28689 (https://arxiv.org/abs/2610.28689), 2026.arXiv
- G. A. Baker, Jr. and P. Graves-Morris, Padé Approximants , 2nd ed., Encyclopedia Math. Appl. 59, Cambridge University Press, Cambridge, 1996.
- R. W. Barnard, K. Pearce and L. Schovanec, Inequalities for the perimeter of an ellipse , J. Math. Anal. Appl. 260 (2001), no. 2, 295--306. 10.1006/jmaa.2000.7128DOI
- J. M. Borwein and P. B. Borwein, Pi and the AGM: A Study in Analytic Number Theory and Computational Complexity , Wiley, New York, 1987.
- R. P. Brent, Fast multiple-precision evaluation of elementary functions , J. ACM 23 (1976), no. 2, 242--251. 10.1145/321941.321944DOI
- B. C. Carlson, Numerical computation of real or complex elliptic integrals , Numer. Algorithms 10 (1995), no. 1, 13--26. 10.1007/BF02198293DOI
Show all 31 referencesShow fewer references
- B. C. Carlson, Elliptic integrals , Chapter 19 of the NIST Digital Library of Mathematical Functions , https://dlmf.nist.gov/19.link
- S. Chowla and A. Selberg, On Epstein's zeta-function , J. Reine Angew. Math. 227 (1967), 86--110. 10.1515/crll.1967.227.86DOI
- W. J. Cody, Chebyshev approximations for the complete elliptic integrals and , Math. Comp. 19 (1965), no. 89, 105--112; Corrigendum, ibid. 20 (1966), no. 93, 207. 10.1090/S0025-5718-1965-0171370-4DOI
- A. Fog, Instruction tables: Lists of instruction latencies, throughputs and micro-operation breakdowns for Intel, AMD and VIA CPUs , Technical University of Denmark, https://www.agner.org/optimize/.link
- T. Fukushima, Fast computation of complete elliptic integrals and Jacobian elliptic functions , Celest. Mech. Dyn. Astron. 105 (2009), 305--328. 10.1007/s10569-009-9228-zDOI
- T. Fukushima, Precise and fast computation of the general complete elliptic integral of the second kind , Math. Comp. 80 (2011), no. 275, 1725--1743. 10.1090/S0025-5718-2011-02455-5DOI
- T. Fukushima, Precise and fast computation of complete elliptic integrals by piecewise minimax rational function approximation , J. Comput. Appl. Math. 282 (2015), 71--76. 10.1016/j.cam.2014.12.038DOI
- C. Hastings, Jr., Approximations for Digital Computers , Princeton University Press, Princeton, 1955.
- IEEE Standard for Floating-Point Arithmetic , IEEE Std 754-2019, 2019. 10.1109/IEEESTD.2019.8766229DOI
- J. Ivory, A new series for the rectification of the ellipsis; together with some observations on the evolution of the formula , Trans. Roy. Soc. Edinburgh 4 (1798), 177--190. 10.1017/S0080456800030817DOI
- Th. Kaluza, Über die Koeffizienten reziproker Potenzreihen , Math. Z. 28 (1928), 161--170. 10.1007/BF01181155DOI
- E. E. Kummer, Über die hypergeometrische Reihe , J. Reine Angew. Math. 15 (1836), 39--83 and 127--172. 10.1515/crll.1836.15.39, 10.1515/crll.1836.15.127DOI
- P. Moscato and A. Ciezak, A new approximation for the perimeter of an ellipse , Algorithms 17 (2024), no. 10, 464. 10.3390/a17100464DOI
- M. J. D. Powell, Approximation Theory and Methods , Cambridge University Press, Cambridge, 1981.
- S. Ramanujan, Modular equations and approximations to , Quart. J. Pure Appl. Math. 45 (1914), 350--372.
- E. Salamin, Computation of using arithmetic-geometric mean , Math. Comp. 30 (1976), no. 135, 565--570. 10.2307/2005327DOI
- U. Shankar, Perimeter of an ellipse: understanding Ramanujan's approximation , preprint arXiv:2603.03373 (https://arxiv.org/abs/2603.03373), 2026.arXiv
- M. Parker (Stand-up Maths), Why is there no equation for the perimeter of an ellipse , YouTube video, 5 September 2020, https://www.youtube.com/watch?v=5nW3nJhBHL0.link
- S. Sýkora, Approximations of ellipse perimeters and of the complete elliptic integral : review of known formulae , Stan's Library, Vol. I, 2005. 10.3247/SL1Math05.004DOI
- S. Sýkora, Advances in approximations of ellipse perimeters and of the complete elliptic integral , Stan's Library, Vol. II, 2007.
- M. B. Villarino, Ramanujan's perimeter of an ellipse , preprint arXiv:math/0506384 (https://arxiv.org/abs/math/0506384), 2005.arXiv