code wiki / (root) / nx_appliedmath_gate.nx

nx_appliedmath_gate.nx

buildroot/runtime/nx_appliedmath_gate.nx

14602 B195 linesdepth 4pulls 12 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_appliedmath_gate.nx -- THE APPLIED MATHEMATICS THE ESTATE ALREADY COMPUTES, PROVED BY IDENTITY. WHY THIS EXISTS (measured 2026-09-03): a capability census found real applied mathematics scattered across this estate and presented as MATHEMATICS NOWHERE -- a Weibull wear-and-tear core in pure integer fixed point, loan amortization whose header claims "conservation-proven" with no gate to prove it, single-pass streaming statistics with a parallel MERGE, and general matrix algebra. /compare/computational grades only the SYMBOLIC stack against Wolfram and SymPy; none of these organs appear on any board, and none had a gate. THE FIELD'S OWN COMPLAINT IS THE OPPORTUNITY. The mathematics community's documented grievance against computer algebra is not breadth, it is TRUST: a published account records Mathematica computing a determinant wrongly and returning DIFFERENT answers for the same determinant on two evaluations, inside a system whose source cannot be inspected. Meanwhile numerical analysis is the branch largely ABSENT from mathlib, so the applied half of mathematics has almost no machine-checked corpus at all. This estate's applied math is integer-exact and bit-reproducible by construction, which is worth nothing until something CHECKS it. This gate is that check. EVERY TOOTH IS AN IDENTITY OR A CONSERVATION LAW, TRUE INDEPENDENTLY OF ANY IMPLEMENTATION: money -- the principal repaid over the schedule equals the principal borrowed, to the penny survival -- ln and exp are inverses; ln(1)=0; exp(0)=1; a longer exposure cannot lower failure probability statistics -- merging two streams gives the mean, count and extrema of the single stream over their union matrices -- transpose is an involution, (AB)^T = B^T A^T, a repeated row makes the determinant vanish Tolerances are DECLARED, never implied: the fixed-point transcendentals are checked to a stated number of Q20 units, and the tolerance is named in the tooth so a reader cannot mistake approximate for exact. license_tier: ORIGINAL

dependencies 5 imports · 0 importers

nx_amort_lib.nx nx_hazard_lib.nx nx_sketch_stream_stats.nx nx_matrix.nx nx_gate_verdict.nx nx_appliedmath_gate.nx

imports: nx_amort_lib.nxnx_hazard_lib.nxnx_sketch_stream_stats.nxnx_matrix.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main gv_head gv_puts sys_write gv_ctr sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ amort_level_payment amort_monthly_interest amort_balance_after gv_check gv_puts ↻ amort_principal_sum amort_level_payment ↻ gv_check_eq gv_check ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap amort_monthly_interest ↻ amort_total_interest amort_level_payment ↻ amort_final_payment amort_level_payment ↻ amort_balance_after ↻

structs

none

consts

31const AM_Q14: i64 = 16384 // nx_matrix's fixed-point unit
32const AM_LN_TOL: i64 = 2000 // Q20 units accepted on an ln/exp round trip (~0.0019 absolute)
33const AM_LN2_TOL: i64 = 200 // Q20 units accepted against the banked ln(2) constant
34const AM_PRINCIPAL: i64 = 25000000 // 250,000.00 in pennies
35const AM_RATE_BP: i64 = 625 // 6.25% annual, in basis points
36const AM_TERM: i64 = 360 // 30 years, monthly
37const AM_BPS: i64 = 10000

functions

39func am_abs(v: i64) -> i64 { if v < 0 { return 0 - v } return v }
called by 1: am_near
40func am_near(a: i64, b: i64, tol: i64) -> i64 { if am_abs(a - b) <= tol { return 1 } return 0 }
calls 1: am_abs
47func am_meq(a: *Matrix, b: *Matrix, rows: i64, cols: i64) -> i64
called by 1: main calls 1: nx_matrix_get
60func main() -> i64