nx_f64_oracle_sov.nx
buildroot/runtime/nx_f64_oracle_sov.nx
about
nx_f64_oracle_sov.nx -- SOVEREIGN f64 oracle: pure-Nishi independent recompute
of IEEE 754 binary64 add/sub/mul/div/sqrt expected values (operator law: no py,
no sh -- the Python vector generator becomes a retired debt for ME0).
INDEPENDENCE: this is a structurally different path from nx_f64. The impl
rounds through per-op guard/sticky shortcuts (sticky-jam GRS); the oracle
carries the EXACT result in a two-word 120-bit significand (hi:lo, 60 bits
per word) plus a sticky flag, finds the true msb, and rounds from the full
value. Anchor proof: _f64_soak_gate_authored phase 1 reproduces ALL 1217
hardware-IEEE-anchored KAT expected values; phase 2 soaks random vectors
impl-vs-oracle (sovereign xorshift PRNG).
Word convention: value = (hi*2^60 + lo) * 2^(e112 - 1135); a normal 53-bit
significand sig placed at hi=sig, lo=0 has its msb at bit 112 and biased
exponent e112. orc_pack derives eo = e112 + (msb - 112), denormalizes below
eo=1 into sticky, rounds to nearest even from the exact tail.
license_tier: ORIGINAL
dependencies 2 imports · 1 importers
imports: nx_syscalls.nxnx_tier.nx
imported by: _f64_soak_gate_authored.nx
structs
| none |
consts
| 22 | const ORC_MAGIC_2047: i64 = 2047 |
| 23 | const ORC_MAGIC_1075: i64 = 1075 |
| 24 | const ORC_MAGIC_1107: i64 = 1107 |
| 26 | const ORC_M60: i64 = 0x0FFFFFFFFFFFFFFF // 2^60 - 1 |
| 27 | const ORC_NAN: i64 = 0x7FF8000000000000 |
| 28 | const ORC_INF: i64 = 0x7FF0000000000000 |
| 29 | const ORC_IMP: i64 = 0x0010000000000000 // 1 << 52 |
| 30 | const ORC_M52: i64 = 0x000FFFFFFFFFFFFF |
functions
| 32 | func orc_sign(raw: i64) -> i64 { return (raw >> 63) & 1 } |
| 33 | func orc_ef(raw: i64) -> i64 { return (raw >> 52) & 0x7FF } |
| 34 | func orc_mf(raw: i64) -> i64 { return raw & ORC_M52 } |
| 37 | func orc_cls(raw: i64) -> i64 |
| 47 | func orc_sig_norm(raw: i64, eout: *i64) -> i64 |
| 61 | func orc_bit(hi: i64, lo: i64, i: i64) -> i64 called by 1: orc_pack |
| 67 | func orc_below(hi: i64, lo: i64, i: i64) -> i64 called by 1: orc_pack |
| 81 | func orc_extract53(hi: i64, lo: i64, s: i64) -> i64 called by 1: orc_pack |
| 93 | func orc_pack(sign: i64, e112: i64, hi: i64, lo: i64, sticky_in: i64) -> i64 |
| 154 | func orc_add(a: i64, b: i64) -> i64 |
| 245 | func orc_sub(a: i64, b: i64) -> i64 |
| 251 | func orc_mul(a: i64, b: i64) -> i64 |
| 300 | func orc_div(a: i64, b: i64) -> i64 |
| 337 | func orc_sqrt(a: i64) -> i64 |