FA-15936 / Floating-point arithmetic / Open access
ULP scaling underflows below the subnormal spacing · case 01
ULP scaling underflows below the subnormal spacing.
ROOT CAUSE
ULP scaling underflows below the subnormal spacing. The faulty expression is e=e-53.
VERIFIED REPAIR
Apply the contract at this fault site using e=max(e-53,-1074).
Unsuccessful approach: The attempted local correction e=max(e-53,-1022) still violates the explicit regression fixtures.
Case contract
Return a finite binary64 ulp as a hex string; NaN maps to nan and either infinity maps to infinity. For subnormals and zero the ulp is the minimum positive subnormal.
Why this case matters
An offline floating representation model isolates a reproducible arithmetic fault.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import struct
N = 1
observations = []
def solve(bits):
x=struct.unpack('>d',bits.to_bytes(8,'big'))[0]
if math.isnan(x): return 'nan'
if math.isinf(x): return 'infinity'
x=abs(x)
if x == 0: return float.fromhex('0x0.0000000000001p-1022').hex()
m,e=math.frexp(x)
e=e-53
return math.ldexp(1.0,e).hex()
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('zero', solve(0), '0x0.0000000000001p-1022')
check('negative zero', solve(1<<63), '0x0.0000000000001p-1022')
check('subnormal', solve(N), '0x0.0000000000001p-1022')
check('power boundary', solve((1023+N)<<52), math.ldexp(1.0,N-52).hex())
check('negative power', solve((1<<63)|((1023+N)<<52)), math.ldexp(1.0,N-52).hex())
check('below power', solve(((1023+N)<<52)-1), math.ldexp(1.0,N-53).hex())
check('infinity', solve(0x7ff0000000000000), 'infinity')
check('nan', solve(0x7ff8000000000000|N), 'nan')
check('maximum', solve(0x7fefffffffffffff), '0x1.0000000000000p+971')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| zero | 0x0.0000000000001p-1022 | 0x0.0000000000001p-1022 | Passed |
| negative zero | 0x0.0000000000001p-1022 | 0x0.0000000000001p-1022 | Passed |
| subnormal | 0x0.0p+0 | 0x0.0000000000001p-1022 | Failed |
| power boundary | 0x1.0000000000000p-51 | 0x1.0000000000000p-51 | Passed |
| negative power | 0x1.0000000000000p-51 | 0x1.0000000000000p-51 | Passed |
| below power | 0x1.0000000000000p-52 | 0x1.0000000000000p-52 | Passed |
| infinity | infinity | infinity | Passed |
| nan | nan | nan | Passed |
| maximum | 0x1.0000000000000p+971 | 0x1.0000000000000p+971 | Passed |
SHA-256 / 630d54d47a13f5119890de50bd5bbdb6697bee3e5fbb29f0b9a2df43137a535f
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import struct
N = 1
observations = []
def solve(bits):
x=struct.unpack('>d',bits.to_bytes(8,'big'))[0]
if math.isnan(x): return 'nan'
if math.isinf(x): return 'infinity'
x=abs(x)
if x == 0: return float.fromhex('0x0.0000000000001p-1022').hex()
m,e=math.frexp(x)
e=max(e-53,-1022)
return math.ldexp(1.0,e).hex()
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('zero', solve(0), '0x0.0000000000001p-1022')
check('negative zero', solve(1<<63), '0x0.0000000000001p-1022')
check('subnormal', solve(N), '0x0.0000000000001p-1022')
check('power boundary', solve((1023+N)<<52), math.ldexp(1.0,N-52).hex())
check('negative power', solve((1<<63)|((1023+N)<<52)), math.ldexp(1.0,N-52).hex())
check('below power', solve(((1023+N)<<52)-1), math.ldexp(1.0,N-53).hex())
check('infinity', solve(0x7ff0000000000000), 'infinity')
check('nan', solve(0x7ff8000000000000|N), 'nan')
check('maximum', solve(0x7fefffffffffffff), '0x1.0000000000000p+971')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| zero | 0x0.0000000000001p-1022 | 0x0.0000000000001p-1022 | Passed |
| negative zero | 0x0.0000000000001p-1022 | 0x0.0000000000001p-1022 | Passed |
| subnormal | 0x1.0000000000000p-1022 | 0x0.0000000000001p-1022 | Failed |
| power boundary | 0x1.0000000000000p-51 | 0x1.0000000000000p-51 | Passed |
| negative power | 0x1.0000000000000p-51 | 0x1.0000000000000p-51 | Passed |
| below power | 0x1.0000000000000p-52 | 0x1.0000000000000p-52 | Passed |
| infinity | infinity | infinity | Passed |
| nan | nan | nan | Passed |
| maximum | 0x1.0000000000000p+971 | 0x1.0000000000000p+971 | Passed |
SHA-256 / e8d67f78095b0f336f753de5d2426120a7f382956d90d3b45a1a11aec428970f
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
import struct
N = 1
observations = []
def solve(bits):
x=struct.unpack('>d',bits.to_bytes(8,'big'))[0]
if math.isnan(x): return 'nan'
if math.isinf(x): return 'infinity'
x=abs(x)
if x == 0: return float.fromhex('0x0.0000000000001p-1022').hex()
m,e=math.frexp(x)
e=max(e-53,-1074)
return math.ldexp(1.0,e).hex()
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('zero', solve(0), '0x0.0000000000001p-1022')
check('negative zero', solve(1<<63), '0x0.0000000000001p-1022')
check('subnormal', solve(N), '0x0.0000000000001p-1022')
check('power boundary', solve((1023+N)<<52), math.ldexp(1.0,N-52).hex())
check('negative power', solve((1<<63)|((1023+N)<<52)), math.ldexp(1.0,N-52).hex())
check('below power', solve(((1023+N)<<52)-1), math.ldexp(1.0,N-53).hex())
check('infinity', solve(0x7ff0000000000000), 'infinity')
check('nan', solve(0x7ff8000000000000|N), 'nan')
check('maximum', solve(0x7fefffffffffffff), '0x1.0000000000000p+971')
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| zero | 0x0.0000000000001p-1022 | 0x0.0000000000001p-1022 | Passed |
| negative zero | 0x0.0000000000001p-1022 | 0x0.0000000000001p-1022 | Passed |
| subnormal | 0x0.0000000000001p-1022 | 0x0.0000000000001p-1022 | Passed |
| power boundary | 0x1.0000000000000p-51 | 0x1.0000000000000p-51 | Passed |
| negative power | 0x1.0000000000000p-51 | 0x1.0000000000000p-51 | Passed |
| below power | 0x1.0000000000000p-52 | 0x1.0000000000000p-52 | Passed |
| infinity | infinity | infinity | Passed |
| nan | nan | nan | Passed |
| maximum | 0x1.0000000000000p+971 | 0x1.0000000000000p+971 | Passed |
SHA-256 / 2d845f1224db3a884bf6208ebd3d50326ec5c32e26c953c914127acaad9dc1f2
Verification & scope
Controlled binary64 or explicitly stipulated miniature format; no hardware exception flags or platform floating environment are modeled. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:39:31.496730+00:00.
Case digest / b5e3eaac107a48f7f54801c2a4bf6ce44797c9577b90a1d821ac0bddb99c4fcc