FA-16041 / Floating-point arithmetic / Open access
Exponent and fraction are intersected instead of combined · case 01
Exponent and fraction are intersected instead of combined.
ROOT CAUSE
Exponent and fraction are intersected instead of combined. The faulty expression is return sign|((exponent<<3)&fraction).
THE FAILURE
Exponent and fraction are intersected instead of combined. The faulty expression is return sign|((exponent<<3)&fraction).
Unsuccessful approach: The attempted local correction return sign|(exponent+fraction) still violates the explicit regression fixtures.
Case contract
Encode finite exactly represented dyadic x into sign/4-bit-exponent/3-bit-fraction toy float with bias 7, gradual underflow, round-to-nearest-even and infinity overflow. Return the unsigned byte. The miniature format is stipulated, not a hardware conformance claim.
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(x):
sign=128 if math.copysign(1.0,x)<0 else 0
x=abs(x)
if x == 0: return sign
if x >= 248: return sign|120
if x < 2**-6:
q=round(x*512)
return sign|q
m,e=math.frexp(x)
e-=1
q=round(m*16)
if q == 16:
q=8
e+=1
if e>7: return sign|120
exponent=e+7
fraction=q-8
return sign|((exponent<<3)&fraction)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('zero', solve(0.0), 0)
check('negative zero', solve(-0.0), 128)
check('subnormal', solve(N/512), N)
check('negative subnormal', solve(-N/512), 128|N)
check('underflow tie', solve(1/1024), 0)
check('subnormal carry', solve(15/1024), 8)
check('normal varying', solve(2.0**N), (N+7)<<3)
check('normal fraction', solve((8+N)/8), 56+N)
check('binade carry', solve(1.9375), 64)
check('below midpoint', solve(1.90625), 63)
check('largest finite', solve(240.0), 119)
check('overflow tie', solve(248.0), 120)
check('negative overflow', solve(-256.0), 248)
check('minimum normal', solve(1/64), 8)
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 | 0 | 0 | Passed |
| negative zero | 128 | 128 | Passed |
| subnormal | 1 | 1 | Passed |
| negative subnormal | 129 | 129 | Passed |
| underflow tie | 0 | 0 | Passed |
| subnormal carry | 8 | 8 | Passed |
| normal varying | 0 | 64 | Failed |
| normal fraction | 0 | 57 | Failed |
| binade carry | 0 | 64 | Failed |
| below midpoint | 0 | 63 | Failed |
| largest finite | 0 | 119 | Failed |
| overflow tie | 120 | 120 | Passed |
| negative overflow | 248 | 248 | Passed |
| minimum normal | 0 | 8 | Failed |
SHA-256 / d58bd2722edef02c18982bd631344b8b6687b05e244825f70d9ef0eadf9b9ba2
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(x):
sign=128 if math.copysign(1.0,x)<0 else 0
x=abs(x)
if x == 0: return sign
if x >= 248: return sign|120
if x < 2**-6:
q=round(x*512)
return sign|q
m,e=math.frexp(x)
e-=1
q=round(m*16)
if q == 16:
q=8
e+=1
if e>7: return sign|120
exponent=e+7
fraction=q-8
return sign|(exponent+fraction)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('zero', solve(0.0), 0)
check('negative zero', solve(-0.0), 128)
check('subnormal', solve(N/512), N)
check('negative subnormal', solve(-N/512), 128|N)
check('underflow tie', solve(1/1024), 0)
check('subnormal carry', solve(15/1024), 8)
check('normal varying', solve(2.0**N), (N+7)<<3)
check('normal fraction', solve((8+N)/8), 56+N)
check('binade carry', solve(1.9375), 64)
check('below midpoint', solve(1.90625), 63)
check('largest finite', solve(240.0), 119)
check('overflow tie', solve(248.0), 120)
check('negative overflow', solve(-256.0), 248)
check('minimum normal', solve(1/64), 8)
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 | 0 | 0 | Passed |
| negative zero | 128 | 128 | Passed |
| subnormal | 1 | 1 | Passed |
| negative subnormal | 129 | 129 | Passed |
| underflow tie | 0 | 0 | Passed |
| subnormal carry | 8 | 8 | Passed |
| normal varying | 8 | 64 | Failed |
| normal fraction | 8 | 57 | Failed |
| binade carry | 8 | 64 | Failed |
| below midpoint | 14 | 63 | Failed |
| largest finite | 21 | 119 | Failed |
| overflow tie | 120 | 120 | Passed |
| negative overflow | 248 | 248 | Passed |
| minimum normal | 1 | 8 | Failed |
SHA-256 / 584b829ab88599a65d887a0eac6f73685a08175dd9a71cbc3d7ffd543c92bb34
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 14 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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:32.729985+00:00.
Case digest / 7a891d8daa928883724f6dce560cd8882966e0a26974275b36845d58b6aa3426