FAILURE MAP
← Case archive

FA-16976 / Floating-point arithmetic / Open access

Power increment reflects an invalid base into the real domain · case 01

Power increment reflects an invalid base into the real domain.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Power increment reflects an invalid base into the real domain. The faulty expression is if x<=-1: x=abs(x).

VERIFIED REPAIR

Apply the contract at this fault site using if x<=-1: return 'domain'.

Unsuccessful approach: The attempted local correction if x<=-1: return 'nan' 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: x=abs(x)
        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 fixtureActualExpectedOutcome
tiny amplified2.71828182852.7182818285Passed
negative amplified0.367879441170.36787944117Passed
normal22Passed
negative power0.50.5Passed
zero exponent11Passed
zero increment11Passed
invalid base3domainFailed

SHA-256 / 0b7853b1e7fe435bca7503af63eaa87a5b6ce0ebaf8a542786ca0b0208f2db0c

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 'nan'
        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 fixtureActualExpectedOutcome
tiny amplified2.71828182852.7182818285Passed
negative amplified0.367879441170.36787944117Passed
normal22Passed
negative power0.50.5Passed
zero exponent11Passed
zero increment11Passed
invalid basenandomainFailed

SHA-256 / 536e52d76772ebdc03da2b0bd81c66a30cce322d7d5d1be5cf201bb3eaadeac8

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 fixtureActualExpectedOutcome
tiny amplified2.71828182852.7182818285Passed
negative amplified0.367879441170.36787944117Passed
normal22Passed
negative power0.50.5Passed
zero exponent11Passed
zero increment11Passed
invalid basedomaindomainPassed

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.663974+00:00.

Case digest / 4ab1509f9e2e0fe355cd8d53ac8d825176a56c1b084ae9a4e37d52a0cfdee09a