back to table · edit · history · where entries came from · files · download
1789 bytes, as of the version from 2026-10-30 06:27 (current). Recorded here, not run.
"""Run both precision policies and analytic controls; save stdout as numerical-evidence.json."""
import json,time
import numberdb.sage as numberdb
from sage.rings.real_arb import RealBallField
from sage.rings.real_mpfr import RealField
from sage.rings.rational_field import QQ
from tidal_solver import integrate
CONFIG={150:(160,12,'1/2'),210:(210,18,'2/3')}
INDICES=('0','1/2','1','3/2','2','5/2','3','7/2','4','9/2')
if __name__=='__main__':
result={'skill_manifest':'../20261030T054723Z-build-skills/manifest.json','skill_sha256':'28ecbeeccb0c5e5d6eb541b5a5b0f88aec47b154374d909085116d34f5629199','rigour':'heuristic (agreement-checked)','models':{}}
F=RealField(numberdb.bits(240));worst=F(0)
for n in ('0','1','1/2','3/2','2','5/2','3','7/2','4','9/2'):
runs={}
for work,config in CONFIG.items():
begin=time.monotonic();v,meta=integrate(n,work,*config)
runs[str(work)]={'values':list(map(str,v)),'meta':meta,'seconds':time.monotonic()-begin}
print('progress',n,work,'steps',meta['steps'],'seconds',round(time.monotonic()-begin,2),flush=True)
errors=[abs(F(a)-F(b))/abs(F(b)) for a,b in zip(runs['150']['values'],runs['210']['values'])]
assert max(errors)<F('1e-120'),(n,errors)
if n in ('0','1'):
pi=F.pi()
exact=[F(3)/4,F(3)/8] if n=='0' else [(15-pi*pi)/(2*pi*pi),(105-10*pi*pi)/(6*pi*pi)]
for a,b in zip(runs['210']['values'],exact):assert abs(F(a)-b)<F('1e-180')
worst=max(worst,max(errors));result['models'][n]={'runs':runs,'relative_differences':list(map(str,errors))}
print('model',n,json.dumps(result['models'][n]),flush=True)
result['worst_relative_difference']=str(worst)
print('EVIDENCE_JSON '+json.dumps(result),flush=True)