back to table · edit · history · where entries came from · files · download
1579 bytes, as of the version from 2026-11-16 22:11 (current). Recorded here, not run.
"""Read-only T728 reproducibility and stored-interval mathematical checks.
Download generate.py, hardy_arb.pyx, checks.py, check.py and numerical-evidence.json
beside this file. Configure NUMBERDB_API_KEY for a private draft. Run with Sage.
"""
import os,sys,json,hashlib
from pathlib import Path
import numberdb.sage as numberdb
from generate import XiStrongLehmerCondition,PAIR_INDICES,pair_value
from checks import inside,rational
from numberdb._generate import _stored_entries
if os.environ.get('NUMBERDB_KEY_FROM_STDIN')=='1':os.environ['NUMBERDB_API_KEY']=sys.stdin.read().strip()
g=XiStrongLehmerCondition();report=g.verify(sample=None);assert report.ok
stored=_stored_entries(numberdb.table('T728'));assert list(stored)==[str(n) for n in PAIR_INDICES]
e=json.loads(Path(__file__).with_name('numerical-evidence.json').read_text());rows={str(r['n']):r for r in e['rows']}
for n,text in stored.items():
assert text==rows[n]['number'] and inside(pair_value(int(n),100),text)
for dps in [130,165]:assert inside(rational(rows[n][f'mpmath_{dps}dps']),text)
for c in e['contour_checks']:assert inside(rational(c['value']),stored[str(c['n'])])
print('READBACK_JSON '+json.dumps({'table':'T728','checked_entries':len(stored),'generator_verify_all':True,'stored_intervals_checked_against_two_precision_product_rule_values':True,'stored_intervals_checked_against_contours':16,'selection_matches_default_enumeration':True,'source_sha256':{n:hashlib.sha256(Path(__file__).with_name(n).read_bytes()).hexdigest() for n in ['generate.py','hardy_arb.pyx','checks.py','readback.py']}}))