code wiki / _hdl_build / nx_f32_adam_gate.nx

nx_f32_adam_gate.nx

buildroot/runtime/_hdl_build/nx_f32_adam_gate.nx

6948 B96 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic f32
docsdependenciesstructsconstsfunctions

dependencies 4 imports · 0 importers

nx_gate_gn.nx nx_gate_base.nx nx_f32_hw.nx nx_syscalls.nx nx_f32_adam_gate.nx

imports: nx_gate_gn.nxnx_gate_base.nxnx_f32_hw.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main gw sys_write f32_div f32_of sys_mmap loss f32_of ↻ f32_sub f32_neg f32_add f32_mul f32_mul ↻ f32_sub ↻ f32_add ↻ f32_sqrt f32_of ↻ f32_div ↻ f32_add ↻ f32_le f32_sub ↻ gm gn f32_int f32_mul ↻ f32_of ↻ f32_abs f32_int ↻ gn ↻ sys_exit

structs

none

consts

none

functions

18func grow(name: *u8, ok: i64) -> i64 { if ok==1 { gw(" PASS " as *u8) } else { gw(" FAIL " as *u8) } gw(name); gw("
calls 1: gw
20func gm(x: i64) -> i64 { return gn(f32_int(f32_mul(x, f32_of(1000)))) }
called by 1: main
21func f32_abs(x: i64) -> i64 { return x & 0x7FFFFFFF }
called by 1: main calls 1: f32_sub
22func f32_le(x: i64, y: i64) -> i64 { let d: i64=f32_sub(x,y) & 0xFFFFFFFF; if ((d>>31)&1)==1 { return 1 } if (d & 0x7FFFFFFF)==0 { return 1 } return 0 }
called by 1: main calls 3: f32_off32_divf32_add
23func f32_sqrt(x: i64) -> i64 { if (x & 0x7FFFFFFF)==0 { return f32_of(0) } var y: i64=x; var i: i64=0; while i<16 { y=f32_div(f32_add(y, f32_div(x,y)), f32_of(2)); i=i+1 } return y }
26func loss(theta: *i64, target: *i64, n: i64) -> i64 { var L: i64=f32_of(0); var i: i64=0; while i<n { let d: i64=f32_sub(theta[i],target[i]); L=f32_add(L, f32_mul(d,d)); i=i+1 } return L }
28func main() -> i64