FAILURE MAP
← Case archive

FA-16321 / Floating-point arithmetic / Open access

Relative logarithm clamps a pole to a finite denominator · case 01

Relative logarithm clamps a pole to a finite denominator.

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

ROOT CAUSE

Relative logarithm clamps a pole to a finite denominator. The faulty expression is if x<=-1: x=-0.999999999.

THE FAILURE

Relative logarithm clamps a pole to a finite denominator. The faulty expression is if x<=-1: x=-0.999999999.

Unsuccessful approach: The attempted local correction if x<=-1: return '+infinity' still violates the explicit regression fixtures.

Case contract

Evaluate log1p(x)/x on x>-1 with continuous value one at zero. 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<=-1: x=-0.999999999
        if x==0: return '1'
        if abs(x)<1e-8:
            result=1-x/2+x*x/3
        else:
            result=math.log1p(x)/x
        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('zero', solve(0.0), "1")
check('tiny', solve(N*1e-10), render(1-N*1e-10/2))
check('negative tiny', solve(-N*1e-10), render(1+N*1e-10/2))
check('normal', solve(float(N)), render(math.log1p(N)/N))
check('negative normal', solve(-0.125*N), render(math.log1p(-0.125*N)/(-0.125*N)))
check('domain', solve(-1.0), "domain")
check('transition', solve(1e-7), render(math.log1p(1e-7)/1e-7))
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
zero11Passed
tiny0.999999999950.99999999995Passed
negative tiny1.00000000011.0000000001Passed
normal0.693147180560.69314718056Passed
negative normal1.0682511411.068251141Passed
domain20.723265886domainFailed
transition0.999999950.99999995Passed

SHA-256 / 4be07c611c72a284777c16f2cb63a8e862527d67db295f4d3175f1d6ea50a800

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<=-1: return '+infinity'
        if x==0: return '1'
        if abs(x)<1e-8:
            result=1-x/2+x*x/3
        else:
            result=math.log1p(x)/x
        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('zero', solve(0.0), "1")
check('tiny', solve(N*1e-10), render(1-N*1e-10/2))
check('negative tiny', solve(-N*1e-10), render(1+N*1e-10/2))
check('normal', solve(float(N)), render(math.log1p(N)/N))
check('negative normal', solve(-0.125*N), render(math.log1p(-0.125*N)/(-0.125*N)))
check('domain', solve(-1.0), "domain")
check('transition', solve(1e-7), render(math.log1p(1e-7)/1e-7))
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
zero11Passed
tiny0.999999999950.99999999995Passed
negative tiny1.00000000011.0000000001Passed
normal0.693147180560.69314718056Passed
negative normal1.0682511411.068251141Passed
domain+infinitydomainFailed
transition0.999999950.99999995Passed

SHA-256 / 668333d7e142f7966f8435c79d51b00ebe2166df0a7382a8a42f0da20395b477

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 7 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:35.357058+00:00.

Case digest / b7da5388adf9bba318b1c4e77ed50817760fa0570d8e2512edcfb01e240542a1