FA-16191 / Floating-point arithmetic / Open access
Sigmoid reuses the negative-branch numerator on positive inputs · case 01
Sigmoid reuses the negative-branch numerator on positive inputs.
ROOT CAUSE
Sigmoid reuses the negative-branch numerator on positive inputs. The faulty expression is result=z/(1+z).
THE FAILURE
Sigmoid reuses the negative-branch numerator on positive inputs. The faulty expression is result=z/(1+z).
Unsuccessful approach: The attempted local correction result=1-z still violates the explicit regression fixtures.
Case contract
Evaluate 1/(1+exp(-x)) using a stable branch for negative x. Return a nonnegative probability. 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>=0:
z=math.exp(-x)
result=z/(1+z)
else:
z=math.exp(x)
result=z/(1+z)
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('negative huge', solve(-1000.0*N), "0")
check('positive huge', solve(1000.0*N), "1")
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), "0.5")
check('positive moderate', solve(float(N)), render(1/(1+math.exp(-N))))
check('negative moderate', solve(-float(N)), render(1/(1+math.exp(N))))
check('small', solve(N*1e-8), render(1/(1+math.exp(-N*1e-8))))
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 |
|---|---|---|---|
| negative huge | 0 | 0 | Passed |
| positive huge | 0 | 1 | Failed |
| negative tail | 7.0954741623e-23 | 7.0954741623e-23 | Passed |
| zero | 0.5 | 0.5 | Passed |
| positive moderate | 0.26894142137 | 0.73105857863 | Failed |
| negative moderate | 0.26894142137 | 0.26894142137 | Passed |
| small | 0.4999999975 | 0.5000000025 | Failed |
SHA-256 / 57d5c0ddd8db5efa095a302277895def0235907daabe0aa22463b12cc685438d
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>=0:
z=math.exp(-x)
result=1-z
else:
z=math.exp(x)
result=z/(1+z)
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('negative huge', solve(-1000.0*N), "0")
check('positive huge', solve(1000.0*N), "1")
check('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))
check('zero', solve(0.0), "0.5")
check('positive moderate', solve(float(N)), render(1/(1+math.exp(-N))))
check('negative moderate', solve(-float(N)), render(1/(1+math.exp(N))))
check('small', solve(N*1e-8), render(1/(1+math.exp(-N*1e-8))))
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 |
|---|---|---|---|
| negative huge | 0 | 0 | Passed |
| positive huge | 1 | 1 | Passed |
| negative tail | 7.0954741623e-23 | 7.0954741623e-23 | Passed |
| zero | 0 | 0.5 | Failed |
| positive moderate | 0.63212055883 | 0.73105857863 | Failed |
| negative moderate | 0.26894142137 | 0.26894142137 | Passed |
| small | 9.9999999392e-09 | 0.5000000025 | Failed |
SHA-256 / bf0b8da4f8d72197ae948cfb14ec29d794ddec0f796878106c903e287db52940
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:34.047071+00:00.
Case digest / 257fae22b5b4345ded86595e56d6d1f7ad25e658021a72118628b0d666324bfe