Submitted works

Advanced search

math.CA — Classical Analysis and ODEs

Improved approximations for the perimeter of an ellipse

Contributed by Mika Inki

We give three closed formulas, with three, four and six square roots, for the perimeter PP of an ellipse with semi-axes a≥b≥0a\ge b\ge0. In exact arithmetic their maximum relative errors over all eccentricities, 4.0×10−84.0\times10^{-8}, 4.1×10−174.1\times10^{-17} and 8.1×10−378.1\times10^{-37}, 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 3434-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 b→0b\to0 it tends to 2πa2\pi a instead of 4a4a), it switches to an approximation based on Legendre's relation, which expresses the complete elliptic integral EE of the second kind exactly through the integral KK of the first kind and two power series in b/ab/a: the AGM steps supply an estimate of KK, 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 b=0b=0 and at b=ab=a; numerically, they are increasing in bb and more accurate than Ramanujan's second approximation at every eccentricity, by factors of at least 289289, 2.8×10112.8\times10^{11} and 4.1×10324.1\times10^{32}. 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 P≈π(a+b)(1+3h/D)P\approx\pi(a+b)(1+3h/D) of Ramanujan's second approximation, with h=((a−b)/(a+b))2h=((a-b)/(a+b))^2 and DD a constant plus nested square roots of a polynomial in hh. Ramanujan's formula is a degenerate member of a one-parameter family of double-nested forms that agree with the Gauss--Kummer series through h4h^4. 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 1−h1-h, 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.

Primarily AI-generated textHuman understanding: some partsGauss-Kummer seriesLegendre's relationPerimeter of an ellipseRamanujan's approximationsarithmetic-geometric meancomplete elliptic integralsminimax approximationnested radicals
Nov 27, 202629 pages
PDFView work