code wiki / (root) / nx_f64_sqrt.nx

nx_f64_sqrt.nx

buildroot/runtime/nx_f64_sqrt.nx

3301 B94 linesdepth 3pulls 3 transitivereach 149 importersview sourcekind librarytopic f64
docsdependenciesstructsconstsfunctions

about

nx_f64_sqrt.nx -- IEEE 754 binary64 square root (standalone file). Digit-pair (2-bits-per-iteration) restoring square root on the radicand sig * 2^54, fed MSB-first as 54 bit-pairs (27 pairs from the 54-bit adjusted significand, then 27 zero pairs). Produces a 54-bit root = 53-bit mantissa + explicit guard; sticky = remainder nonzero. Correctly rounded RNE for all finite positive inputs including subnormals. Bounds: root < 2^54, trial = (root<<2)|1 < 2^56, rem <= 2*root + pair so rem << 2 < 2^57 -- all comfortably inside i64. IEEE specials: sqrt(+0) = +0, sqrt(-0) = -0, sqrt(+inf) = +inf, sqrt(negative) = NaN, sqrt(NaN) = NaN. license_tier: ORIGINAL

dependencies 3 imports · 8 importers

nx_syscalls.nx nx_tier.nx nx_f64.nx nx_f64_sqrt.nx _bf_pow_gate_authored.nx _f64_exp_gate_authored.nx _f64_gate_authored.nx _f64_log_gate_authored.nx _f64_sincos_gate_authored.nx _f64_soak_gate_authored.nx nx_f64_v8kat_gate.nx nx_js_eval.nx

imports: nx_syscalls.nxnx_tier.nxnx_f64.nx

imported by: _bf_pow_gate_authored.nx_f64_exp_gate_authored.nx_f64_gate_authored.nx_f64_log_gate_authored.nx_f64_sincos_gate_authored.nx_f64_soak_gate_authored.nxnx_f64_v8kat_gate.nxnx_js_eval.nx

structs

none

consts

20const K_MAGIC_1049: i64 = 1049

functions

22func nx_f64_sqrt(a: i64) -> i64