FA-15881 / Floating-point arithmetic / Open access
Subnormals acquire an implicit leading one · case 01
Subnormals acquire an implicit leading one.
ROOT CAUSE
A hidden leading bit is inserted into every finite significand.
VERIFIED REPAIR
Add the hidden bit only for normal encodings.
Unsuccessful approach: Removing the bit universally corrupts normals.
Case contract
Decode an unsigned 64-bit IEEE binary64 encoding into sign, kind, unbiased exponent, integer significand, quiet flag and payload. Nonfinite fields use null; zero and subnormal exponents are -1022.
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):
sign = -1 if bits >> 63 else 1
exp = (bits >> 52) & 2047
fraction = bits & ((1 << 52)-1)
if exp == 2047:
kind = 'nan' if fraction else 'infinity'
quiet = bool(fraction & (1 << 51)) if fraction else None
payload = fraction & ((1 << 51)-1) if fraction else None
return [sign, kind, None, None, quiet, payload]
kind = 'zero' if exp == 0 and fraction == 0 else 'subnormal' if exp == 0 else 'normal'
unbiased = exp-1023 if exp else -1022
significand = fraction | (1 << 52)
return [sign, kind, unbiased, significand, None, None]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive zero', solve(0), [1,'zero',-1022,0,None,None])
check('negative zero', solve(1<<63), [-1,'zero',-1022,0,None,None])
check('tiny subnormal', solve(N), [1,'subnormal',-1022,N,None,None])
check('negative subnormal', solve((1<<63)|N), [-1,'subnormal',-1022,N,None,None])
check('normal exact power', solve((1023+N)<<52), [1,'normal',N,1<<52,None,None])
check('normal fraction', solve((1023<<52)|N), [1,'normal',0,(1<<52)|N,None,None])
check('positive infinity', solve(2047<<52), [1,'infinity',None,None,None,None])
check('negative infinity', solve((1<<63)|(2047<<52)), [-1,'infinity',None,None,None,None])
check('quiet payload', solve((2047<<52)|(1<<51)|N), [1,'nan',None,None,True,N])
check('signaling payload', solve((2047<<52)|N), [1,'nan',None,None,False,N])
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 |
|---|---|---|---|
| positive zero | [1, 'zero', -1022, 4503599627370496, None, None] | [1, 'zero', -1022, 0, None, None] | Failed |
| negative zero | [-1, 'zero', -1022, 4503599627370496, None, None] | [-1, 'zero', -1022, 0, None, None] | Failed |
| tiny subnormal | [1, 'subnormal', -1022, 4503599627370497, None, None] | [1, 'subnormal', -1022, 1, None, None] | Failed |
| negative subnormal | [-1, 'subnormal', -1022, 4503599627370497, None, None] | [-1, 'subnormal', -1022, 1, None, None] | Failed |
| normal exact power | [1, 'normal', 1, 4503599627370496, None, None] | [1, 'normal', 1, 4503599627370496, None, None] | Passed |
| normal fraction | [1, 'normal', 0, 4503599627370497, None, None] | [1, 'normal', 0, 4503599627370497, None, None] | Passed |
| positive infinity | [1, 'infinity', None, None, None, None] | [1, 'infinity', None, None, None, None] | Passed |
| negative infinity | [-1, 'infinity', None, None, None, None] | [-1, 'infinity', None, None, None, None] | Passed |
| quiet payload | [1, 'nan', None, None, True, 1] | [1, 'nan', None, None, True, 1] | Passed |
| signaling payload | [1, 'nan', None, None, False, 1] | [1, 'nan', None, None, False, 1] | Passed |
SHA-256 / 7b00cfcff5338f9242c365c08d19afe5df77db1fef78ceb79ba029b1b45fbb42
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):
sign = -1 if bits >> 63 else 1
exp = (bits >> 52) & 2047
fraction = bits & ((1 << 52)-1)
if exp == 2047:
kind = 'nan' if fraction else 'infinity'
quiet = bool(fraction & (1 << 51)) if fraction else None
payload = fraction & ((1 << 51)-1) if fraction else None
return [sign, kind, None, None, quiet, payload]
kind = 'zero' if exp == 0 and fraction == 0 else 'subnormal' if exp == 0 else 'normal'
unbiased = exp-1023 if exp else -1022
significand = fraction
return [sign, kind, unbiased, significand, None, None]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive zero', solve(0), [1,'zero',-1022,0,None,None])
check('negative zero', solve(1<<63), [-1,'zero',-1022,0,None,None])
check('tiny subnormal', solve(N), [1,'subnormal',-1022,N,None,None])
check('negative subnormal', solve((1<<63)|N), [-1,'subnormal',-1022,N,None,None])
check('normal exact power', solve((1023+N)<<52), [1,'normal',N,1<<52,None,None])
check('normal fraction', solve((1023<<52)|N), [1,'normal',0,(1<<52)|N,None,None])
check('positive infinity', solve(2047<<52), [1,'infinity',None,None,None,None])
check('negative infinity', solve((1<<63)|(2047<<52)), [-1,'infinity',None,None,None,None])
check('quiet payload', solve((2047<<52)|(1<<51)|N), [1,'nan',None,None,True,N])
check('signaling payload', solve((2047<<52)|N), [1,'nan',None,None,False,N])
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 |
|---|---|---|---|
| positive zero | [1, 'zero', -1022, 0, None, None] | [1, 'zero', -1022, 0, None, None] | Passed |
| negative zero | [-1, 'zero', -1022, 0, None, None] | [-1, 'zero', -1022, 0, None, None] | Passed |
| tiny subnormal | [1, 'subnormal', -1022, 1, None, None] | [1, 'subnormal', -1022, 1, None, None] | Passed |
| negative subnormal | [-1, 'subnormal', -1022, 1, None, None] | [-1, 'subnormal', -1022, 1, None, None] | Passed |
| normal exact power | [1, 'normal', 1, 0, None, None] | [1, 'normal', 1, 4503599627370496, None, None] | Failed |
| normal fraction | [1, 'normal', 0, 1, None, None] | [1, 'normal', 0, 4503599627370497, None, None] | Failed |
| positive infinity | [1, 'infinity', None, None, None, None] | [1, 'infinity', None, None, None, None] | Passed |
| negative infinity | [-1, 'infinity', None, None, None, None] | [-1, 'infinity', None, None, None, None] | Passed |
| quiet payload | [1, 'nan', None, None, True, 1] | [1, 'nan', None, None, True, 1] | Passed |
| signaling payload | [1, 'nan', None, None, False, 1] | [1, 'nan', None, None, False, 1] | Passed |
SHA-256 / 3d6a0dddf63e723d60ea3f7d52792c6c7d124d82c49e971b0150662ff5f06415
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):
sign = -1 if bits >> 63 else 1
exp = (bits >> 52) & 2047
fraction = bits & ((1 << 52)-1)
if exp == 2047:
kind = 'nan' if fraction else 'infinity'
quiet = bool(fraction & (1 << 51)) if fraction else None
payload = fraction & ((1 << 51)-1) if fraction else None
return [sign, kind, None, None, quiet, payload]
kind = 'zero' if exp == 0 and fraction == 0 else 'subnormal' if exp == 0 else 'normal'
unbiased = exp-1023 if exp else -1022
significand = fraction | (1 << 52) if exp else fraction
return [sign, kind, unbiased, significand, None, None]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('positive zero', solve(0), [1,'zero',-1022,0,None,None])
check('negative zero', solve(1<<63), [-1,'zero',-1022,0,None,None])
check('tiny subnormal', solve(N), [1,'subnormal',-1022,N,None,None])
check('negative subnormal', solve((1<<63)|N), [-1,'subnormal',-1022,N,None,None])
check('normal exact power', solve((1023+N)<<52), [1,'normal',N,1<<52,None,None])
check('normal fraction', solve((1023<<52)|N), [1,'normal',0,(1<<52)|N,None,None])
check('positive infinity', solve(2047<<52), [1,'infinity',None,None,None,None])
check('negative infinity', solve((1<<63)|(2047<<52)), [-1,'infinity',None,None,None,None])
check('quiet payload', solve((2047<<52)|(1<<51)|N), [1,'nan',None,None,True,N])
check('signaling payload', solve((2047<<52)|N), [1,'nan',None,None,False,N])
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 |
|---|---|---|---|
| positive zero | [1, 'zero', -1022, 0, None, None] | [1, 'zero', -1022, 0, None, None] | Passed |
| negative zero | [-1, 'zero', -1022, 0, None, None] | [-1, 'zero', -1022, 0, None, None] | Passed |
| tiny subnormal | [1, 'subnormal', -1022, 1, None, None] | [1, 'subnormal', -1022, 1, None, None] | Passed |
| negative subnormal | [-1, 'subnormal', -1022, 1, None, None] | [-1, 'subnormal', -1022, 1, None, None] | Passed |
| normal exact power | [1, 'normal', 1, 4503599627370496, None, None] | [1, 'normal', 1, 4503599627370496, None, None] | Passed |
| normal fraction | [1, 'normal', 0, 4503599627370497, None, None] | [1, 'normal', 0, 4503599627370497, None, None] | Passed |
| positive infinity | [1, 'infinity', None, None, None, None] | [1, 'infinity', None, None, None, None] | Passed |
| negative infinity | [-1, 'infinity', None, None, None, None] | [-1, 'infinity', None, None, None, None] | Passed |
| quiet payload | [1, 'nan', None, None, True, 1] | [1, 'nan', None, None, True, 1] | Passed |
| signaling payload | [1, 'nan', None, None, False, 1] | [1, 'nan', None, None, False, 1] | Passed |
SHA-256 / ade469eac871c68aa636078841755720c4f4167ad2c11862b5cbea2f94e013a1
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.115738+00:00.
Case digest / 13a5db1801898a791687864228ddbf445f182644803d1334915062cc38009135