FA-17166 / Floating-point arithmetic / Open access
Split base-two exponential underflows its scale before multiplication · case 01
Split base-two exponential underflows its scale before multiplication.
ROOT CAUSE
Split base-two exponential underflows its scale before multiplication. The faulty expression is result=mantissa*(2.0**k).
THE FAILURE
Split base-two exponential underflows its scale before multiplication. The faulty expression is result=mantissa*(2.0**k).
Unsuccessful approach: The attempted local correction result=max(2.0**k,2.0**-1022)*(2.0**f) still violates the explicit regression fixtures.
Case contract
Compute 2**x for finite x by separating its integer exponent from a bounded fractional exponential. Values x>=1024 return positive infinity; x<=-1075 return positive zero under nearest-even rounding. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.
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
def render(x):
if math.isnan(x): return 'nan'
if math.isinf(x): return '-infinity' if x<0 else '+infinity'
return format(x,'.11g')
N = 1
observations = []
def solve(x):
try:
if x>=1024: return '+infinity'
if x<=-1075: return '0'
k=math.floor(x)
f=x-k
mantissa=2.0**f
result=mantissa*(2.0**k)
return render(result)
except (ValueError, OverflowError, ZeroDivisionError, TypeError):
return "arithmetic-error"
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('integer', solve(float(N)), render(2.0**N))
check('negative integer', solve(-float(N)), render(2.0**(-N)))
check('fraction', solve(N+0.5), render(2.0**(N+0.5)))
check('large finite', solve(1023.0), render(2.0**1023))
check('small subnormal', solve(-1074.0), render(math.ldexp(1.0,-1074)))
check('subnormal half above', solve(-1074.5), render(math.ldexp(1.0,-1074)))
check('underflow midpoint', solve(-1075.0), "0")
check('overflow', solve(1024.0), "+infinity")
check('negative fraction', solve(-N-0.5), render(2.0**(-N-0.5)))
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 |
|---|---|---|---|
| integer | 2 | 2 | Passed |
| negative integer | 0.5 | 0.5 | Passed |
| fraction | 2.8284271247 | 2.8284271247 | Passed |
| large finite | 8.9884656743e+307 | 8.9884656743e+307 | Passed |
| small subnormal | 4.9406564584e-324 | 4.9406564584e-324 | Passed |
| subnormal half above | 0 | 4.9406564584e-324 | Failed |
| underflow midpoint | 0 | 0 | Passed |
| overflow | +infinity | +infinity | Passed |
| negative fraction | 0.35355339059 | 0.35355339059 | Passed |
SHA-256 / 644c3ab0a8b4a8d6054db26c716f93860bb4d49a8ab077b1dcda3e66a82f35c0
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import struct
def render(x):
if math.isnan(x): return 'nan'
if math.isinf(x): return '-infinity' if x<0 else '+infinity'
return format(x,'.11g')
N = 1
observations = []
def solve(x):
try:
if x>=1024: return '+infinity'
if x<=-1075: return '0'
k=math.floor(x)
f=x-k
mantissa=2.0**f
result=max(2.0**k,2.0**-1022)*(2.0**f)
return render(result)
except (ValueError, OverflowError, ZeroDivisionError, TypeError):
return "arithmetic-error"
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('integer', solve(float(N)), render(2.0**N))
check('negative integer', solve(-float(N)), render(2.0**(-N)))
check('fraction', solve(N+0.5), render(2.0**(N+0.5)))
check('large finite', solve(1023.0), render(2.0**1023))
check('small subnormal', solve(-1074.0), render(math.ldexp(1.0,-1074)))
check('subnormal half above', solve(-1074.5), render(math.ldexp(1.0,-1074)))
check('underflow midpoint', solve(-1075.0), "0")
check('overflow', solve(1024.0), "+infinity")
check('negative fraction', solve(-N-0.5), render(2.0**(-N-0.5)))
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 |
|---|---|---|---|
| integer | 2 | 2 | Passed |
| negative integer | 0.5 | 0.5 | Passed |
| fraction | 2.8284271247 | 2.8284271247 | Passed |
| large finite | 8.9884656743e+307 | 8.9884656743e+307 | Passed |
| small subnormal | 2.2250738585e-308 | 4.9406564584e-324 | Failed |
| subnormal half above | 3.146729628e-308 | 4.9406564584e-324 | Failed |
| underflow midpoint | 0 | 0 | Passed |
| overflow | +infinity | +infinity | Passed |
| negative fraction | 0.35355339059 | 0.35355339059 | Passed |
SHA-256 / 1c469ddc20a32c7e39693d2b5c2719711e1d4e0acdc96084f29ce33cc46a2c6b
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 9 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:43.717815+00:00.
Case digest / 96bdd89c9a0367a9e8ba3bbbd8f42f8edb7468eaed7e64734e2790ac10ce3350