import mpmath as mp
def W(k, working=150):
# mpmath elliptic K uses the parameter m, not the modulus.
# This program gives approximations; the attached generator uses Arb balls.
with mp.workdps(working):
k = mp.mpf(k)
if not mp.isfinite(k) or k < 8:
raise ValueError("A finite real k >= 8 is required.")
alpha = (1-mp.sqrt(1-64/k**2))/2
return mp.nstr((2*mp.ellipk(alpha)/mp.pi)**2, 100)
# The table's integer reference selection:
for k in range(8, 33):
print(k, W(k))
The attached generator evaluates the elliptic formula in Arb ball arithmetic at 461 bits for 100 significant decimal digits. Exact rational arguments are enclosed before square root, elliptic K, pi and squaring; the edge uses the exact elliptic parameter 1/2. Every returned value is a finite RealBall with at least 456 relative accuracy bits. The stored decimals denote intervals with uncertainty of one unit in the last place.
A separate implementation checks all 24 exterior values with exact central-binomial coefficients and a rigorous geometric tail x^(N+1)/(1-x), x=64/k^2. The endpoint is checked by Gamma(1/4)^4/(4*pi^3). These independent enclosures lie strictly within all 25 written intervals. Original-kernel two-angle integration, with a triangle substitution removing the endpoint corner singularity, also checks every entry to approximately eleven decimal places; that double-precision quadrature is heuristic corroboration. Direct step counting verifies the first four return counts, and nonzero known-answer and deliberately wrong normalization, power, elliptic-convention, last-place and invalid-ball controls are preserved. See numerical-evidence.md and the executable checks.