back to table · edit · history · where entries came from · files · download
915 bytes, as of the version from 2026-11-17 01:53 (current). Recorded here, not run.
import json,sys
from pathlib import Path
sys.path.insert(0,str(Path(__file__).resolve().parent))
import mpmath as mp
import numberdb.sage as numberdb
import checks
from sage.rings.rational_field import QQ
from sage.rings.real_arb import RealBallField
D=json.load(open(Path(__file__).with_name('stored-document.json')));ns={};exec(D['Programs']['example']['code'],ns)
r=[]
for d in [1,2,3,100]:
val=ns['mu'](d);lo,hi=checks.decimal_bounds(D['Numbers'][str(d)])
# This checks the mpmath example numerically. It is not rigorous evidence.
passed=mp.mpf(str(lo.numerator()))/int(lo.denominator())<val<mp.mpf(str(hi.numerator()))/int(hi.denominator())
r.append({'d':d,'value_110_digits':mp.nstr(val,110),'inside_stored_interval':bool(passed)})
assert all(x['inside_stored_interval'] for x in r)
print('PROGRAM_CHECK_JSON='+json.dumps({'mpmath_version':mp.__version__,'working_decimal_digits':mp.mp.dps,'samples':r}))