code wiki / _hdl_build / nx_recip_div24_test.nx
nx_recip_div24_test.nx
buildroot/runtime/_hdl_build/nx_recip_div24_test.nx
about
nx_recip_div24_test.nx -- TRIANGULATED 1:1 proof of the W=24 Newton/Goldschmidt
reciprocal divider gate-network (nx_recip_div24_synth), the first rung that
composes the proven 64x64->128 wide multiplier (x*t overflows i64 at W=24).
Three independent legs must agree on every vector (a bug would have to fool all
three): LEG A the GATE-NETWORK Newton divider via nx_nxgate_sim (q and r);
LEG B an independent restoring (shift-subtract) divider, W=24, SCALAR; LEG C
the i64 oracle / and %. Battery (2,297,160 vectors): dense D in [1,256] x
N in [0,8191] + 200,000 random FULL 24-bit (N,D in [1,2^24-1]) + 8 edges.
Known answer (FAIL LOUD): "2297160 2297160 1763 4" rc=0 (ok total q_chk r_chk;
12345/7 = 1763 rem 4). Built on the known-good compiler.
dependencies 1 imports · 0 importers
imports: nx_recip_div24.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 16 | const RT_W24: i64 = 16777215 // 2^24 - 1 |
| 17 | const RT_LCG_A: i64 = 6364136223846793005 |
| 18 | const RT_LCG_C: i64 = 1442695040888963407 |
functions
| 20 | func _emit_num(v: i64) -> i64 called by 1: main |
| 28 | func _nl() -> i64 { let z: *u8 = sys_mmap(2); z[0] = 10; sys_write(1, z, 1); return 0 } called by 1: main |
| 31 | func rt_restoring(N: i64, D: i64) -> i64 called by 1: main |
| 44 | func rt_run(g: *NxGsim, qnet: i64, rnet: i64, N: i64, D: i64, r_out: *i64) -> i64 |
| 52 | func main() -> i64 |