FA-14726 / Numerics / Open access
Forward difference newton basis: difference orientation · case 01
The exact forward difference newton basis result violates the stated contract at difference orientation.
ROOT CAUSE
The difference orientation step uses row[i]-row[i+1] instead of row[i+1]-row[i].
VERIFIED REPAIR
Use row[i+1]-row[i] at the difference orientation step.
Unsuccessful approach: The partial repair row[i+1]+row[i] still violates the difference orientation invariant.
Case contract
Input nonempty integer sequence f(0)..f(n); return binomial-basis coefficients Delta^k f(0).
Why this case matters
Exact discrete arithmetic with observable algorithmic state; no floating point approximation is used.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
row=x[:];out=[]
for _ in range(len(x)):
if not row:break
out.append(row[0])
row=[row[i]-row[i+1] for i in range(len(row)-1)]
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([-1, 0], [-1, 1]), ([-1, -1], [-1, 0]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([0], [0]), ([1], [1]), ([-1, 1], [-1, 2]), ([0, -1], [0, -1])], [([-1, 1], [-1, 2]), ([1, -1], [1, -2]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([-1, 0, 1], [-1, 1, 0]), ([-1, 1, -1], [-1, 2, -4]), ([-1, 1, 0], [-1, 2, -3]), ([-1, 1, 1], [-1, 2, -2])], [([0, -1], [0, -1]), ([-1, -1, -1], [-1, 0, 0]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([1, 0, 0], [1, -1, 1]), ([1, 0, 1], [1, -1, 2]), ([1, 1, -1], [1, 0, -2]), ([1, 1, 0], [1, 0, -1])], [([0, 1], [0, 1]), ([-1, 0, -1], [-1, 1, -2]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([-1, 0, 0, -1], [-1, 1, -1, 0]), ([-1, 0, 0, 0], [-1, 1, -1, 1]), ([-1, 0, 0, 1], [-1, 1, -1, 2]), ([-1, 0, 1, -1], [-1, 1, 0, -3])], [([1, -1], [1, -2]), ([-1, 1, -1], [-1, 2, -4]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([0, -1, -1, 1], [0, -1, 1, 1]), ([0, -1, 0, -1], [0, -1, 2, -4]), ([0, -1, 0, 0], [0, -1, 2, -3]), ([0, -1, 0, 1], [0, -1, 2, -2])]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("explicit oracle %d" % i, solve(args), expected)
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 |
|---|---|---|---|
| explicit oracle 0 | [-1, -1] | [-1, 1] | Failed |
| explicit oracle 1 | [-1, 0] | [-1, 0] | Passed |
| explicit oracle 2 | [-1] | [-1] | Passed |
| explicit oracle 3 | [1, 0, 0, 0, 0] | [1, 0, 0, 0, 0] | Passed |
| explicit oracle 4 | [0] | [0] | Passed |
| explicit oracle 5 | [1] | [1] | Passed |
| explicit oracle 6 | [-1, -2] | [-1, 2] | Failed |
| explicit oracle 7 | [0, 1] | [0, -1] | Failed |
SHA-256 / 3c78a4140433df1bf331aa15be666fa674c5d614392eeab91034b997c46e5624
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
row=x[:];out=[]
for _ in range(len(x)):
if not row:break
out.append(row[0])
row=[row[i+1]+row[i] for i in range(len(row)-1)]
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([-1, 0], [-1, 1]), ([-1, -1], [-1, 0]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([0], [0]), ([1], [1]), ([-1, 1], [-1, 2]), ([0, -1], [0, -1])], [([-1, 1], [-1, 2]), ([1, -1], [1, -2]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([-1, 0, 1], [-1, 1, 0]), ([-1, 1, -1], [-1, 2, -4]), ([-1, 1, 0], [-1, 2, -3]), ([-1, 1, 1], [-1, 2, -2])], [([0, -1], [0, -1]), ([-1, -1, -1], [-1, 0, 0]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([1, 0, 0], [1, -1, 1]), ([1, 0, 1], [1, -1, 2]), ([1, 1, -1], [1, 0, -2]), ([1, 1, 0], [1, 0, -1])], [([0, 1], [0, 1]), ([-1, 0, -1], [-1, 1, -2]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([-1, 0, 0, -1], [-1, 1, -1, 0]), ([-1, 0, 0, 0], [-1, 1, -1, 1]), ([-1, 0, 0, 1], [-1, 1, -1, 2]), ([-1, 0, 1, -1], [-1, 1, 0, -3])], [([1, -1], [1, -2]), ([-1, 1, -1], [-1, 2, -4]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([0, -1, -1, 1], [0, -1, 1, 1]), ([0, -1, 0, -1], [0, -1, 2, -4]), ([0, -1, 0, 0], [0, -1, 2, -3]), ([0, -1, 0, 1], [0, -1, 2, -2])]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("explicit oracle %d" % i, solve(args), expected)
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 |
|---|---|---|---|
| explicit oracle 0 | [-1, -1] | [-1, 1] | Failed |
| explicit oracle 1 | [-1, -2] | [-1, 0] | Failed |
| explicit oracle 2 | [-1] | [-1] | Passed |
| explicit oracle 3 | [1, 2, 4, 8, 16] | [1, 0, 0, 0, 0] | Failed |
| explicit oracle 4 | [0] | [0] | Passed |
| explicit oracle 5 | [1] | [1] | Passed |
| explicit oracle 6 | [-1, 0] | [-1, 2] | Failed |
| explicit oracle 7 | [0, -1] | [0, -1] | Passed |
SHA-256 / 0faea2cad593ac933cbcb87a21b62c7e1ab1b6389301c37e95aa079669dcf54a
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
import itertools
from fractions import Fraction
N = 1
observations = []
def solve(x):
row=x[:];out=[]
for _ in range(len(x)):
if not row:break
out.append(row[0])
row=[row[i+1]-row[i] for i in range(len(row)-1)]
return out
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([-1, 0], [-1, 1]), ([-1, -1], [-1, 0]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([0], [0]), ([1], [1]), ([-1, 1], [-1, 2]), ([0, -1], [0, -1])], [([-1, 1], [-1, 2]), ([1, -1], [1, -2]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([-1, 0, 1], [-1, 1, 0]), ([-1, 1, -1], [-1, 2, -4]), ([-1, 1, 0], [-1, 2, -3]), ([-1, 1, 1], [-1, 2, -2])], [([0, -1], [0, -1]), ([-1, -1, -1], [-1, 0, 0]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([1, 0, 0], [1, -1, 1]), ([1, 0, 1], [1, -1, 2]), ([1, 1, -1], [1, 0, -2]), ([1, 1, 0], [1, 0, -1])], [([0, 1], [0, 1]), ([-1, 0, -1], [-1, 1, -2]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([-1, 0, 0, -1], [-1, 1, -1, 0]), ([-1, 0, 0, 0], [-1, 1, -1, 1]), ([-1, 0, 0, 1], [-1, 1, -1, 2]), ([-1, 0, 1, -1], [-1, 1, 0, -3])], [([1, -1], [1, -2]), ([-1, 1, -1], [-1, 2, -4]), ([-1], [-1]), ([1, 1, 1, 1, 1], [1, 0, 0, 0, 0]), ([0, -1, -1, 1], [0, -1, 1, 1]), ([0, -1, 0, -1], [0, -1, 2, -4]), ([0, -1, 0, 0], [0, -1, 2, -3]), ([0, -1, 0, 1], [0, -1, 2, -2])]]
for i, (args, expected) in enumerate(fixtures[N-1]):
check("explicit oracle %d" % i, solve(args), expected)
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 |
|---|---|---|---|
| explicit oracle 0 | [-1, 1] | [-1, 1] | Passed |
| explicit oracle 1 | [-1, 0] | [-1, 0] | Passed |
| explicit oracle 2 | [-1] | [-1] | Passed |
| explicit oracle 3 | [1, 0, 0, 0, 0] | [1, 0, 0, 0, 0] | Passed |
| explicit oracle 4 | [0] | [0] | Passed |
| explicit oracle 5 | [1] | [1] | Passed |
| explicit oracle 6 | [-1, 2] | [-1, 2] | Passed |
| explicit oracle 7 | [0, -1] | [0, -1] | Passed |
SHA-256 / 89eaa579d5a72df810392ae05740af714aadfe7fdd12322b8c1902f2e47ea3ff
Verification & scope
A deterministic bounded teaching model. Inputs are restricted to the explicit contract; this is not a production algebra library. 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:19.786040+00:00.
Case digest / e273e93061baa6c9eecd0df888dabb7265aaf1450f5b63500ee1ac62bd0b85a0