compute.py

back to table · edit · history · where entries came from · files · download

915 bytes, as of the version from 2026-11-18 03:54 (current). Recorded here, not run.

import sys,json,time,hashlib,platform
sys.path.insert(0,'/work')
from generate import *
g=EllipticR()
for params in g.enumerate():
    t=time.time();n=parse_key(params['k']);v=g.value(params,100)
    # Plain 100 significant decimal digits carry one last-place uncertainty.
    with mp.workdps(200):
        a=v['number'];mid=(mp.mpf(str(a.lower()))+mp.mpf(str(a.upper())))/2
        text=mp.nstr(mid,100,strip_zeros=False)
        ulp=mp.power(10,mp.floor(mp.log10(abs(mid)))-99)
        assert mp.mpf(str(a.absolute_diameter())) < ulp/100
    r={'params':params,'number':text}
    if 'param-latex' in v:r['param-latex']=v['param-latex']
    print('ENTRY '+json.dumps({'record':r,'agreement_interval':str(a),'native_type':type(a).__name__,'seconds':time.time()-t}),flush=True)
print('VERSIONS '+json.dumps({'python':sys.version,'mpmath':__import__('mpmath').__version__,'platform':platform.platform()}),flush=True)