back to table · edit · history · where entries came from · files · download
2005 bytes, as of the version from 2026-11-18 10:41 (current). Recorded here, not run.
"""Secondary Feynman-parameter computation for T750; no Bessel evaluation.
Integrates the quadratic in y analytically, then x=q/(1-q) by mpmath
quadrature. D<0 uses atan2; D=0 uses the continuous limit. This program shares the analytic y reduction and tanh-sinh method with
the final parameter generator; it is a branch/implementation check, not
a second mathematical representation. Its
quadrature error is estimated, not rigorous, so this check tests agreement.
Run with SageMath (mpmath included); output JSONL supports resumable checking.
Optional stored.json is the authoritative API document, not generator values.
"""
import mpmath as mp
import json,time,itertools,math
from pathlib import Path
def reference(a,b,c,t,dps):
with mp.workdps(dps):
a,b,c,t=map(mp.mpf,(a,b,c,t))
def f(q):
if q==0 or q==1:return mp.mpf(0)
x=q/(1-q)
A=b*b*(x+1);B=(a*a*x+c*c)*(x+1)+(b*b-t)*x;C=x*(a*a*x+c*c)
D=B*B-4*A*C
if D==0:v=2/B
elif D>0:
d=mp.sqrt(D);v=2*mp.log((B+d)/(2*mp.sqrt(A*C)))/d
else:
d=mp.sqrt(-D);v=2*mp.atan2(d,B)/d
return v/(1-q)**2
# Extra splits resolve unequal-scale systems near x~c/a.
pts=sorted(set([mp.mpf(0),mp.mpf(1)/10,mp.mpf(1)/2,mp.mpf(9)/10,mp.mpf(1),c/(a+c)]))
return +mp.quad(f,pts,method='tanh-sinh')
def independent_selection():
rows=[]
# Different enumeration: direct box, then perimeter order.
for a,b,c in itertools.combinations_with_replacement(range(1,11),3):
if a+b+c<=12 and math.gcd(math.gcd(a,b),c)==1:
for t in set([0,(a+b-c)**2,(a-b+c)**2,(b+c-a)**2]):rows.append((a,b,c,t))
return sorted(rows,key=lambda r:(sum(r[:3]),r))
if __name__=='__main__':
sample={(1,1,1),(1,1,2),(1,2,2),(1,2,4),(2,2,3),(1,1,10),(2,3,7),(3,4,5)}
start=time.time()
for row in independent_selection():
dps=135 if row[:3] in sample else 60
v=reference(*row,dps)
print(json.dumps({'params':dict(zip(('a','b','c','t'),row)),'dps':dps,'value':mp.nstr(v,dps),'elapsed_seconds':time.time()-start}),flush=True)
print('COMPLETE',flush=True)