nx_bigfloat120_atan.nx
buildroot/runtime/nx_bigfloat120_atan.nx
about
nx_bigfloat120_atan.nx -- SOVEREIGN atan oracle on the 120-bit bigfloat.
General atan from NO new primitives: the reduction subtracts table angles
atan(1/n) (bf_atan_inv -- the Machin organ already blessed inside bf_pi)
via the addition formula
atan(x) - atan(1/n) = atan((x - 1/n) / (1 + x/n))
choosing n = nearest(1/x) bumped so 1/n <= x: the residual is nonnegative
and falls below 1/8 within ~3 rounds from anywhere in [0, 1]; a 30-term
Taylor tail finishes (ratio < 2^-6 per term -> truncation < 2^-180).
Positive-only core (bigfloat law); signs handled at the f64 boundary.
|x| > 1 folds through atan(x) = pi/2 - atan(1/x); atan is total (no refusal).
Self-anchor (see _bf_atan_gate_authored): Machin recombination through the
GENERAL path reproduces pi, and tan(atan(x)) = x against the blessed
bf_sin_r/bf_cos_r organ to < 2^-100 -- no external oracle anywhere.
license_tier: ORIGINAL
dependencies 5 imports · 4 importers
imports: nx_syscalls.nxnx_tier.nxnx_bigfloat120.nxnx_bigfloat120_div.nxnx_bigfloat120_trig.nx
imported by: _bf_atan_gate_authored.nx_f64_atan_gate_authored.nx_f64_atan_gate_emitted.nxnx_mathspec_atan.nx
structs
| none |
consts
| 22 | const K_MAGIC_2047: i64 = 2047 |
functions
| 26 | func bf_atan_taylor(out: *i64, x: *i64) -> i64 |
| 57 | func bf_atan01(out: *i64, xin: *i64) -> i64 called by 4: bag_tan_rtmainbf_atan_f64mat_atan_j8 calls 13: bf_is_zerobf_copybf_newbf_set_intbf_cmpbf_pi+7 |
| 111 | func bf_atan_f64(x: i64) -> i64 |