"""Independent finite construction checks. Standard library only; no model training. Run: python this_file.py. Stdout contains the two figure datasets. """ import json, math from itertools import product, combinations from fractions import Fraction as F figures=[] ns=[1,2,4,8,16,32];theta=-2.;d=1e-6 states=[(1+theta/n)**n for n in ns];grads=[(1+theta/n)**(n-1) for n in ns] for n,g in zip(ns,grads):assert abs(g-(((1+(theta+d)/n)**n-(1+(theta-d)/n)**n)/(2*d)))<1e-8 assert states[0]==-1 and states[1]==0 figures.append(dict(id="euler-state-gradient",x=ns,series=[dict(name="Euler endpoint",y=states),dict(name="Euler derivative",y=grads),dict(name="Exact reference",y=[math.exp(-2)]*len(ns))])) a=[1,2,4,8];amp=[math.exp(x)for x in a] for x,y in zip(a,amp):assert math.isclose((math.exp(-x)+1e-7)*y-1,1e-7*y,rel_tol=1e-7,abs_tol=1e-13) figures.append(dict(id="reverse-conditioning",x=a,y=amp)) assert len(figures)==2 print(json.dumps({"status":"PASS","scope":"Constructed analytic examples only; not neural training, a benchmark, or measured hardware performance.","figures":figures},indent=2))