# Ordinary reciprocal-cubic Mahler measure at one real argument.
# Recompute radicals inside a callable, for example lambda: 4+2*mp.sqrt(5).
import mpmath as mp
def g(argument, working=140):
with mp.workdps(working):
k = mp.mpf(argument() if callable(argument) else argument)
if not mp.isfinite(k):
raise ValueError('A finite real argument is required.')
if k == 0:
return mp.mpf(0)
edges = [mp.mpf(0), mp.pi/2]
if -1 <= k < 0:
edges += [mp.acos((1+s*mp.sqrt(1+k))/2) for s in [-1, 1]]
elif 0 < k < 8:
edges += [mp.acos((mp.sqrt(1+k)-1)/2)]
edges = sorted(set(edges))
pieces = []
for left, right in zip(edges, edges[1:]):
c = mp.cos((left+right)/2)
active = abs(k-4*c*c) >= 4*c
def integrand(theta):
c = mp.cos(theta)
if not active:
return mp.log(2*c)
b = abs(k-4*c*c)
return mp.log((b+mp.sqrt(max(0, b*b-16*c*c)))/2)
result, error = mp.quad(integrand, [left, right],
error=True, maxdegree=9)
if not mp.isfinite(result) or error >= mp.power(10, -working+15):
raise ArithmeticError('Quadrature did not converge.')
pieces.append(result)
return 2*mp.fsum(pieces)/mp.pi
low = g(4, 140)
high = g(4, 190)
with mp.workdps(200):
assert abs(low-high) < mp.mpf('1e-115')*max(1, abs(high))
print(mp.nstr(high, 100))
# Precision agreement and quadrature estimates are not certified bounds.
The generator evaluates the real Jensen integral (1) by adaptive tanh-sinh quadrature at 140 and 190 working decimal digits. Every crossing $|k-4\cos^2\theta|=4\cos\theta$ is an integration breakpoint. Radical arguments are recomputed at each precision. All 36 nonzero entries agree to at least 139 digits relative to the larger of one and the value magnitude; 100 significant digits are retained. The quadrature convergence estimates and agreement checks are not certified error bounds. The entry $k=0$ is exact by factorization.
A separate implementation integrates the logarithms of the root moduli of $P_k(e^{i\theta},y)$ directly at 125 working digits and agrees for all 37 arguments to more than 110 digits. It first reproduces the nonzero control $g(-1)=2\mu_3$, with $\mu_3$ independently evaluated by Hurwitz zeta functions. The direct-root check shares Jensen's principle with the generator but uses the original complex polynomial.
Further checks use Rogers and Zudilin's equation (7) only outside its excluded interval $[-4,2]$, the exact factorizations at $k=0,-1$, the spanning-tree evaluation at $k=8$, PARI elliptic-curve $L$-values of conductors 14, 20 and 36, and the positive quadratic identity. The elliptic models have the stated conductors and match the cited eta products through $q^{80}$. A deliberately perturbed value is rejected. The attached checks and numerical evidence record the computations and comparisons with values read back from the database.