code wiki / _hdl_build / _bf_tan_gate_authored.nx
_bf_tan_gate_authored.nx
buildroot/runtime/_hdl_build/_bf_tan_gate_authored.nx
about
_bf_tan_gate_authored.nx -- self-anchor gate for the SOVEREIGN bigfloat tan
oracle (nx_bigfloat120_tan). No external oracle:
1. HALF-ANGLE: tan(2u) = 2t/(1-t^2), t = tan(u), at 150 banded points --
u and 2u take DIFFERENT reduction paths (k vs ~2k), so the algebraic
identity catches reduction and quadrant-table defects. rel < 2^-100
(points with |1-t^2| below 2^-30 are skipped-and-counted: cancellation
there honestly exceeds the bar).
2. PI-SHIFT: tan(x + pi) = tan(x) with the EXACT bigfloat pi, 50 points.
3. f64 tie to the BLESSED organs: |tan(x) - fl(sin(x)/cos(x))| <= 2 ulp
(quotient of two correctly-rounded values bounds at ~1.5 ulp + 0.5).
4. Specials + pole signs: tan(fl(pi/2)) huge POSITIVE, next ulp NEGATIVE,
oddness, +-0, NaN/inf/refusal.
Markers: BFTAN-HALF / BFTAN-PISHIFT / BFTAN-QUOT / BFTAN-SPEC / verdict=
dependencies 7 imports · 0 importers
imports: nx_syscalls.nxnx_f64.nxnx_f64_div.nxnx_bigfloat120.nxnx_bigfloat120_div.nxnx_bigfloat120_trig.nxnx_bigfloat120_tan.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
| none |
functions
| 23 | func btg_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 24 | func btg_putn(v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64 = v; if m < 0 { m = 0 - m; sys_write(1, "-" 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); m = m / 10; k = k + 1 }; var i: i64 = 0; while i < k { bb[i] = t[k-1-i]; i = i + 1 }; sys_write(1, bb, k); return 0 } |
| 25 | func btg_puthex(v: i64) -> i64 { let bb: *u8 = sys_mmap(20); var i: i64 = 0; while i < 16 { let nib: i64 = (v >> ((15 - i) * 4)) & 15; if nib < 10 { bb[i] = 48 + nib } else { bb[i] = 55 + nib } i = i + 1 } sys_write(1, bb, 16); return 0 } |
| 27 | func btg_rng(state: *i64) -> i64 called by 1: main |
| 36 | func btg_relok(a: *i64, b: *i64, bits: i64) -> i64 |
| 44 | func btg_ord(v: i64) -> i64 called by 1: btg_ulp |
| 49 | func btg_ulp(a: i64, b: i64) -> i64 |
| 56 | func main() -> i64 |