back to table · edit · history · where entries came from · files · download
1150 bytes, as of the version from 2026-12-01 18:34 (current). Recorded here, not run.
import json,sys
from pathlib import Path
import check_values
from sage.rings.rational_field import QQ
work=Path(__file__).parent
records=json.loads((work/'stored-brackets.json').read_text())
result=check_values.run(records)
generated=json.loads((work/'generated-brackets.json').read_text())
for a,b in zip(records,generated):
assert int(a['M'])==int(b['M'])
assert QQ(a['lo']) < QQ(b['lo']) < QQ(b['hi']) < QQ(a['hi'])
print('STORED_CHECK_JSON '+json.dumps(result),flush=True)
assert not result['failures']
# Check the displayed approximation against each independently certified
# generation bracket. The approximation does not replace sign certification.
scope={}
exec((work/'program.py').read_text(),scope)
mp=scope['mp']; approximate=scope['komornik_loreti']
def rational_to_mp(s):
q=QQ(s)
return mp.mpf(int(q.numerator()))/int(q.denominator())
for r in generated:
q=approximate(int(r['M']))
assert rational_to_mp(r['lo']) < q < rational_to_mp(r['hi'])
print('PROGRAM_CHECK_JSON '+json.dumps({'checked_entries':len(generated),'failures':[],
'mpmath':mp.__version__,'extension_M33':str(approximate(33))}),flush=True)