code wiki / _hdl_build / nx_geo_haversine_gate.nx

nx_geo_haversine_gate.nx

buildroot/runtime/_hdl_build/nx_geo_haversine_gate.nx

3494 B65 linesdepth 7pulls 8 transitivereach 0 importersview sourcekind gate/prooftopic geo
docsdependenciesstructsconstsfunctions

about

nx_geo_haversine_gate.nx -- GATE for GEO-003b great-circle (haversine) distance. Proves: same-point : d(NYC,NYC) == 0 NYC -> London : haversine within 2% of the true great-circle ~5,570 km NYC -> Sydney : haversine within 2% of the true great-circle ~15,990 km MEASURED EXCEED : for NYC->Sydney, |haversine - true| < |equirectangular - true| -- haversine is strictly CLOSER to the true great-circle than the GEO-003 flat-earth baseline. This is the no-wave proof that GEO-003b adds real precision over GEO-003 at continental scale. Evidence -> knowledge/status/geo_haversine.log (GEOHAVGATE authored=organ ... verdict=GREEN). license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_geo_haversine.nx nx_geo_distance.nx nx_syscalls.nx nx_geo_haversine_gate.nx

imports: nx_geo_haversine.nxnx_geo_distance.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 geo_haversine_m fx_sin fx_sin_cos fx_normalize_angle fx_cordic_atan hav_micro_to_q16 fx_cos fx_sin_cos ↻ nx_isqrt geo_atan2 fx_cordic_atan ↻ geo_distance_m fx_cos ↻ nx_isqrt ↻ gh_abs gh_relnear gh_abs ↻ gh_emit gh_w sys_write gh_wn sys_mmap sys_write ↻ sys_openat_append sys_close

structs

none

consts

15const GH_LOG: *u8 = "knowledge/status/geo_haversine.log"

functions

17func gh_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 1: gh_emit calls 1: sys_write
18func gh_wn(fd: i64, v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64=v; if m<0 {m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8 = sys_mmap(28); var k: i64=0; if m==0 {t[0]=48;k=1}; while m>0 {t[k]=(48+(m%10)) as u8; m=m/10; k=k+1}; var i: i64=0; while i<k {bb[i]=t[k-1-i]; i=i+1}; sys_write(fd, bb, k); return 0 }
called by 1: gh_emit calls 2: sys_mmapsys_write
20func gh_abs(x: i64) -> i64 { if x < 0 { return 0 - x } return x }
called by 2: gh_relnearmain
22func gh_relnear(a: i64, b: i64, num: i64, den: i64) -> i64 { if gh_abs(a - b) * den <= b * num { return 1 } return 0 }
called by 1: main calls 1: gh_abs
24func gh_emit(fd: i64, zero: i64, lon: i64, syd: i64, equi: i64, haverr: i64, equierr: i64, ok: i64) -> i64
called by 1: main calls 2: gh_wgh_wn
35func main() -> i64