FAILURE MAP
← Case archive

FA-17001 / Floating-point arithmetic / Open access

Exponential divided difference reverses its exponent separation · case 01

Exponential divided difference reverses its exponent separation.

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

ROOT CAUSE

Exponential divided difference reverses its exponent separation. The faulty expression is d=a-b.

THE FAILURE

Exponential divided difference reverses its exponent separation. The faulty expression is d=a-b.

Unsuccessful approach: The attempted local correction d=abs(b-a) still violates the explicit regression fixtures.

Case contract

Evaluate (exp(b)-exp(a))/(b-a) with continuous value exp(a) when a=b. Fixture exponents are bounded; use expm1 for close endpoints. 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(a,b):
    try:
        if a==b: return render(math.exp(a))
        d=a-b
        if abs(d)<1e-8:
            ratio=1+d/2+d*d/6
        else:
            ratio=math.expm1(d)/d
        result=math.exp(a)*ratio
        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('coincident', solve(float(N),float(N)), render(math.exp(N)))
check('near endpoints', solve(0.0,N*2.0**-60), "1")
check('shifted near', solve(1.0,1.0+N*2.0**-50), render(math.exp(1)*(1+N*2.0**-50/2)))
check('forward', solve(0.0,float(N)), render(math.expm1(N)/N))
check('reverse', solve(float(N),0.0), render(math.expm1(N)/N))
check('negative interval', solve(-float(N),0.0), render(-math.expm1(-N)/N))
check('separated', solve(-1.0,1.0), render((math.exp(1)-math.exp(-1))/2))
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
coincident2.71828182852.7182818285Passed
near endpoints11Passed
shifted near2.71828182852.7182818285Passed
forward0.632120558831.7182818285Failed
reverse4.67077427051.7182818285Failed
negative interval0.232544157930.63212055883Failed
separated0.15904618641.1752011936Failed

SHA-256 / 0812c0a79acd8d2193ed3094a1063567f32715520a44fe94b1a07ec65273961b

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(a,b):
    try:
        if a==b: return render(math.exp(a))
        d=abs(b-a)
        if abs(d)<1e-8:
            ratio=1+d/2+d*d/6
        else:
            ratio=math.expm1(d)/d
        result=math.exp(a)*ratio
        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('coincident', solve(float(N),float(N)), render(math.exp(N)))
check('near endpoints', solve(0.0,N*2.0**-60), "1")
check('shifted near', solve(1.0,1.0+N*2.0**-50), render(math.exp(1)*(1+N*2.0**-50/2)))
check('forward', solve(0.0,float(N)), render(math.expm1(N)/N))
check('reverse', solve(float(N),0.0), render(math.expm1(N)/N))
check('negative interval', solve(-float(N),0.0), render(-math.expm1(-N)/N))
check('separated', solve(-1.0,1.0), render((math.exp(1)-math.exp(-1))/2))
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
coincident2.71828182852.7182818285Passed
near endpoints11Passed
shifted near2.71828182852.7182818285Passed
forward1.71828182851.7182818285Passed
reverse4.67077427051.7182818285Failed
negative interval0.632120558830.63212055883Passed
separated1.17520119361.1752011936Passed

SHA-256 / 6b56252c10d5a1011fa160a85753aa2c9e9aa1c33d31f223bbefe9460927cb94

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

Case digest / 981abc4f69857ad23db9c948e435d6f17a3c54938a3f3338b9d967cac1dc392c