FA-16971 / Floating-point arithmetic / Open access
Power increment uses zero as its multiplicative identity · case 01
Power increment uses zero as its multiplicative identity.
ROOT CAUSE
Power increment uses zero as its multiplicative identity. The faulty expression is if y==0 or x==0: return '0'.
VERIFIED REPAIR
Apply the contract at this fault site using if y==0 or x==0: return '1'.
Unsuccessful approach: The attempted local correction if y==0 or x==0: return render(y) still violates the explicit regression fixtures.
Case contract
Evaluate (1+x)**y without first rounding a small increment into unity. Domain requires x>-1; y is finite, and fixtures have finite results. 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,y):
try:
if x<=-1: return 'domain'
if y==0 or x==0: return '0'
exponent=y*math.log1p(x)
result=math.exp(exponent)
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('tiny amplified', solve(N*2.0**-60,2.0**60), render(math.exp(N)))
check('negative amplified', solve(-N*2.0**-60,2.0**60), render(math.exp(-N)))
check('normal', solve(1.0,float(N)), render(2.0**N))
check('negative power', solve(1.0,-float(N)), render(2.0**(-N)))
check('zero exponent', solve(0.5,0.0), "1")
check('zero increment', solve(0.0,float(N)), "1")
check('invalid base', solve(-2.0,float(N)), "domain")
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 |
|---|---|---|---|
| tiny amplified | 2.7182818285 | 2.7182818285 | Passed |
| negative amplified | 0.36787944117 | 0.36787944117 | Passed |
| normal | 2 | 2 | Passed |
| negative power | 0.5 | 0.5 | Passed |
| zero exponent | 0 | 1 | Failed |
| zero increment | 0 | 1 | Failed |
| invalid base | domain | domain | Passed |
SHA-256 / 5d40300786f1d589750ff81ccdccfabe0686ff3d33a660e7a8b9299d52884e06
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,y):
try:
if x<=-1: return 'domain'
if y==0 or x==0: return render(y)
exponent=y*math.log1p(x)
result=math.exp(exponent)
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('tiny amplified', solve(N*2.0**-60,2.0**60), render(math.exp(N)))
check('negative amplified', solve(-N*2.0**-60,2.0**60), render(math.exp(-N)))
check('normal', solve(1.0,float(N)), render(2.0**N))
check('negative power', solve(1.0,-float(N)), render(2.0**(-N)))
check('zero exponent', solve(0.5,0.0), "1")
check('zero increment', solve(0.0,float(N)), "1")
check('invalid base', solve(-2.0,float(N)), "domain")
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 |
|---|---|---|---|
| tiny amplified | 2.7182818285 | 2.7182818285 | Passed |
| negative amplified | 0.36787944117 | 0.36787944117 | Passed |
| normal | 2 | 2 | Passed |
| negative power | 0.5 | 0.5 | Passed |
| zero exponent | 0 | 1 | Failed |
| zero increment | 1 | 1 | Passed |
| invalid base | domain | domain | Passed |
SHA-256 / f93ff2167c204441dd2fb554ee3cd27c6091de6b2abe18817dbd3838a6734ff9
3 / The verified repair
Exit 0"""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,y):
try:
if x<=-1: return 'domain'
if y==0 or x==0: return '1'
exponent=y*math.log1p(x)
result=math.exp(exponent)
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('tiny amplified', solve(N*2.0**-60,2.0**60), render(math.exp(N)))
check('negative amplified', solve(-N*2.0**-60,2.0**60), render(math.exp(-N)))
check('normal', solve(1.0,float(N)), render(2.0**N))
check('negative power', solve(1.0,-float(N)), render(2.0**(-N)))
check('zero exponent', solve(0.5,0.0), "1")
check('zero increment', solve(0.0,float(N)), "1")
check('invalid base', solve(-2.0,float(N)), "domain")
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 |
|---|---|---|---|
| tiny amplified | 2.7182818285 | 2.7182818285 | Passed |
| negative amplified | 0.36787944117 | 0.36787944117 | Passed |
| normal | 2 | 2 | Passed |
| negative power | 0.5 | 0.5 | Passed |
| zero exponent | 1 | 1 | Passed |
| zero increment | 1 | 1 | Passed |
| invalid base | domain | domain | Passed |
SHA-256 / c4b47d9a689e667e8fe276dbfd388973a6af1c5fd37c142044212b14d63fbbf6
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:41.645020+00:00.
Case digest / ae62af4ea6957fb9d976073a2e2b40a2bb67e91ed46ea41aad39f950f2f81d9e