back to table · edit · history · where entries came from · files · download
2625 bytes, as of the version from 2026-11-18 10:41 (current). Recorded here, not run.
"""Independent direct-r Bessel ball quadrature for the T750 parameter method.
Uses the factor-four Bessel transform, not analytic integration of the graph
polynomial. Actual retained digit accuracy, analytic guards, endpoint/tail
bounds and every selected identity are recorded. Output is JSONL checkpoints.
Uses scaled Kummer functions for r>=1 to control exponential dependency.
"""
import numberdb.sage as n
from sage.rings.rational_field import QQ
from sage.rings.real_arb import RealBallField
from sage.rings.complex_arb import ComplexBallField
import json,time,math,itertools
def bessel(row,digits=50):
a,b,c,t=row;bits=n.bits(digits+75);R=RealBallField(bits);C=ComplexBallField(bits)
s=R(t).sqrt();delta=R(a+b+c)-s;half=QQ(1)/2
L=digits+35;eps=R(-L).exp();cutoff=int((R(3*(digits+25))/delta).upper().ceil())
def unscaled(r,analytic):
if analytic and not r.real()>0:return C('nan')
return 4*r*(r*a).bessel_K(0)*(r*b).bessel_K(0)*(r*c).bessel_K(0)*((r*C(t).sqrt()).bessel_I(0) if t else 1)
def scaled(r,analytic):
if analytic and not r.real()>0:return C('nan')
factor=((-2*C(t).sqrt()*r).hypergeometric([half],[1]) if t else 1)
return 4*r*C.pi()**(QQ(3)/2)*(-(C(a+b+c)-C(t).sqrt())*r).exp()*(2*a*r).hypergeometric_U(half,1)*(2*b*r).hypergeometric_U(half,1)*(2*c*r).hypergeometric_U(half,1)*factor
tol=R(10)**(-digits-8);total=C(0)
pts=[eps,QQ(1)/64,QQ(1)/8,QQ(1)/2,1]
for lo,hi in zip(pts,pts[1:]):total+=C.integral(unscaled,lo,hi,abs_tol=tol,rel_tol=tol,eval_limit=30000,depth_limit=100)
pts=sorted(set([1]+[x for x in (4,16,64) if x<cutoff]+[cutoff]))
for lo,hi in zip(pts,pts[1:]):total+=C.integral(scaled,lo,hi,abs_tol=tol,rel_tol=tol,eval_limit=30000,depth_limit=100)
h=R(2).log()+1+L
small=4*(s*eps).exp()*eps**2/2*(h**3+QQ(3)/2*h**2+QQ(3)/2*h+QQ(3)/4)
tail=4*(R.pi()/2)**(QQ(3)/2)/R(a*b*c).sqrt()*R(cutoff)**(-QQ(1)/2)*(-delta*cutoff).exp()/delta
result=total.real().add_error(small+tail)
if not result.is_finite() or not total.imag().contains_zero():raise ArithmeticError('Nonfinite Bessel check')
return result
def rows():
return sorted([(a,b,c,t) 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])],key=lambda r:(sum(r[:3]),r))
if __name__=='__main__':
start=time.time()
for i,row in enumerate(rows(),1):
v=bessel(row,50);lo,hi=v.endpoints()
print(json.dumps({'index':i,'params':dict(zip(('a','b','c','t'),row)),'lo':str(QQ(lo)),'hi':str(QQ(hi)),'accuracy_bits':int(v.accuracy()),'elapsed_seconds':time.time()-start}),flush=True)
print('COMPLETE',flush=True)