Function kummer_elliptic_perimeter_range

Source
fn kummer_elliptic_perimeter_range(radii: Vec2) -> f64
Expand description

This calculates the error range of kummer_elliptic_perimeter. That function returns a lower bound on the true value, and though we do not know what the remainder of the infinite series sums to, we can calculate an upper bound:

∑ binom(1/2, n)^2 for n = 0 to inf = 1 + (1 / 2!!)^2 + (1!! / 4!!)^2 + (3!! / 6!!)^2 + (5!! / 8!!)^2 + .. = 4 / pi with !! the double factorial (equation 274 in “Summation of Series”, L. B. W. Jolley, 1961).

This means the remainder of the infinite series for C, assuming the series was truncated to the mth term and h = 1, sums to 4 / pi - ∑ binom(1/2, n)^2 for n = 0 to m-1

As 0 ≤ h ≤ 1, this is an upper bound.