FA-14711 / Numerics / Open access
Newton divided difference table: newton coefficient extraction · case 01
The exact newton divided difference table result violates the stated contract at newton coefficient extraction.
ROOT CAUSE
The newton coefficient extraction step uses c[::-1] instead of c.
VERIFIED REPAIR
Use c at the newton coefficient extraction step.
Unsuccessful approach: The partial repair c[1:]+c[:1] still violates the newton coefficient extraction invariant.
Case contract
Input distinct integer nodes and integer values [nodes,values]; return Newton coefficients [p,q] in original node order.
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):
nodes,values=x
c=list(map(Fraction,values));n=len(c)
for order in range(1,n):
for i in range(n-1,order-1,-1):
den=nodes[i]-nodes[i-order]
if den==0:return None
c[i]=(c[i]-c[i-1])/den
return [[v.numerator,v.denominator] for v in c[::-1]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[-2, 0, 3], [-1, -1, -1]], [[-1, 1], [0, 1], [0, 1]]), ([[0, 2, 3, 7], [2, 2, 2, 2]], [[2, 1], [0, 1], [0, 1], [0, 1]]), ([[-2, 0, 3], [-1, -1, 0]], [[-1, 1], [0, 1], [1, 15]]), ([[-2, 0, 3], [-1, -1, 1]], [[-1, 1], [0, 1], [2, 15]]), ([[-2, 0, 3], [-1, -1, 2]], [[-1, 1], [0, 1], [1, 5]]), ([[-2, 0, 3], [-1, 0, -1]], [[-1, 1], [1, 2], [-1, 6]]), ([[-2, 0, 3], [-1, 0, 0]], [[-1, 1], [1, 2], [-1, 10]]), ([[-2, 0, 3], [-1, 0, 1]], [[-1, 1], [1, 2], [-1, 30]])], [([[-2, 0, 3], [-1, -1, 0]], [[-1, 1], [0, 1], [1, 15]]), ([[-2, 0, 3], [-1, -1, 2]], [[-1, 1], [0, 1], [1, 5]]), ([[-2, 0, 3], [-1, -1, -1]], [[-1, 1], [0, 1], [0, 1]]), ([[0, 2, 3, 7], [2, 2, 2, 2]], [[2, 1], [0, 1], [0, 1], [0, 1]]), ([[-2, 0, 3], [0, -1, 0]], [[0, 1], [-1, 2], [1, 6]]), ([[-2, 0, 3], [0, -1, 1]], [[0, 1], [-1, 2], [7, 30]]), ([[-2, 0, 3], [0, -1, 2]], [[0, 1], [-1, 2], [3, 10]]), ([[-2, 0, 3], [0, 0, -1]], [[0, 1], [0, 1], [-1, 15]])], [([[-2, 0, 3], [-1, -1, 1]], [[-1, 1], [0, 1], [2, 15]]), ([[-2, 0, 3], [-1, 0, 1]], [[-1, 1], [1, 2], [-1, 30]]), ([[-2, 0, 3], [-1, -1, -1]], [[-1, 1], [0, 1], [0, 1]]), ([[0, 2, 3, 7], [2, 2, 2, 2]], [[2, 1], [0, 1], [0, 1], [0, 1]]), ([[-2, 0, 3], [1, -1, 1]], [[1, 1], [-1, 1], [1, 3]]), ([[-2, 0, 3], [1, -1, 2]], [[1, 1], [-1, 1], [2, 5]]), ([[-2, 0, 3], [1, 0, -1]], [[1, 1], [-1, 2], [1, 30]]), ([[-2, 0, 3], [1, 0, 0]], [[1, 1], [-1, 2], [1, 10]])], [([[-2, 0, 3], [-1, -1, 2]], [[-1, 1], [0, 1], [1, 5]]), ([[-2, 0, 3], [-1, 1, 0]], [[-1, 1], [1, 1], [-4, 15]]), ([[-2, 0, 3], [-1, -1, -1]], [[-1, 1], [0, 1], [0, 1]]), ([[0, 2, 3, 7], [2, 2, 2, 2]], [[2, 1], [0, 1], [0, 1], [0, 1]]), ([[-2, 0, 3], [2, -1, 2]], [[2, 1], [-3, 2], [1, 2]]), ([[-2, 0, 3], [2, 0, -1]], [[2, 1], [-1, 1], [2, 15]]), ([[-2, 0, 3], [2, 0, 0]], [[2, 1], [-1, 1], [1, 5]]), ([[-2, 0, 3], [2, 0, 1]], [[2, 1], [-1, 1], [4, 15]])], [([[-2, 0, 3], [-1, 0, -1]], [[-1, 1], [1, 2], [-1, 6]]), ([[-2, 0, 3], [-1, 2, -1]], [[-1, 1], [3, 2], [-1, 2]]), ([[-2, 0, 3], [-1, -1, -1]], [[-1, 1], [0, 1], [0, 1]]), ([[0, 2, 3, 7], [2, 2, 2, 2]], [[2, 1], [0, 1], [0, 1], [0, 1]]), ([[0, 1, 2], [-1, 0, -1]], [[-1, 1], [1, 1], [-1, 1]]), ([[0, 1, 2], [-1, 0, 0]], [[-1, 1], [1, 1], [-1, 2]]), ([[0, 1, 2], [-1, 0, 1]], [[-1, 1], [1, 1], [0, 1]]), ([[0, 1, 2], [-1, 0, 2]], [[-1, 1], [1, 1], [1, 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 | [[0, 1], [0, 1], [-1, 1]] | [[-1, 1], [0, 1], [0, 1]] | Failed |
| explicit oracle 1 | [[0, 1], [0, 1], [0, 1], [2, 1]] | [[2, 1], [0, 1], [0, 1], [0, 1]] | Failed |
| explicit oracle 2 | [[1, 15], [0, 1], [-1, 1]] | [[-1, 1], [0, 1], [1, 15]] | Failed |
| explicit oracle 3 | [[2, 15], [0, 1], [-1, 1]] | [[-1, 1], [0, 1], [2, 15]] | Failed |
| explicit oracle 4 | [[1, 5], [0, 1], [-1, 1]] | [[-1, 1], [0, 1], [1, 5]] | Failed |
| explicit oracle 5 | [[-1, 6], [1, 2], [-1, 1]] | [[-1, 1], [1, 2], [-1, 6]] | Failed |
| explicit oracle 6 | [[-1, 10], [1, 2], [-1, 1]] | [[-1, 1], [1, 2], [-1, 10]] | Failed |
| explicit oracle 7 | [[-1, 30], [1, 2], [-1, 1]] | [[-1, 1], [1, 2], [-1, 30]] | Failed |
SHA-256 / fc13f26d7d59aac19ae4cbaec04d732ff160aa25a66dc7f1a728ae41b9ea725d
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):
nodes,values=x
c=list(map(Fraction,values));n=len(c)
for order in range(1,n):
for i in range(n-1,order-1,-1):
den=nodes[i]-nodes[i-order]
if den==0:return None
c[i]=(c[i]-c[i-1])/den
return [[v.numerator,v.denominator] for v in c[1:]+c[:1]]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[-2, 0, 3], [-1, -1, -1]], [[-1, 1], [0, 1], [0, 1]]), ([[0, 2, 3, 7], [2, 2, 2, 2]], [[2, 1], [0, 1], [0, 1], [0, 1]]), ([[-2, 0, 3], [-1, -1, 0]], [[-1, 1], [0, 1], [1, 15]]), ([[-2, 0, 3], [-1, -1, 1]], [[-1, 1], [0, 1], [2, 15]]), ([[-2, 0, 3], [-1, -1, 2]], [[-1, 1], [0, 1], [1, 5]]), ([[-2, 0, 3], [-1, 0, -1]], [[-1, 1], [1, 2], [-1, 6]]), ([[-2, 0, 3], [-1, 0, 0]], [[-1, 1], [1, 2], [-1, 10]]), ([[-2, 0, 3], [-1, 0, 1]], [[-1, 1], [1, 2], [-1, 30]])], [([[-2, 0, 3], [-1, -1, 0]], [[-1, 1], [0, 1], [1, 15]]), ([[-2, 0, 3], [-1, -1, 2]], [[-1, 1], [0, 1], [1, 5]]), ([[-2, 0, 3], [-1, -1, -1]], [[-1, 1], [0, 1], [0, 1]]), ([[0, 2, 3, 7], [2, 2, 2, 2]], [[2, 1], [0, 1], [0, 1], [0, 1]]), ([[-2, 0, 3], [0, -1, 0]], [[0, 1], [-1, 2], [1, 6]]), ([[-2, 0, 3], [0, -1, 1]], [[0, 1], [-1, 2], [7, 30]]), ([[-2, 0, 3], [0, -1, 2]], [[0, 1], [-1, 2], [3, 10]]), ([[-2, 0, 3], [0, 0, -1]], [[0, 1], [0, 1], [-1, 15]])], [([[-2, 0, 3], [-1, -1, 1]], [[-1, 1], [0, 1], [2, 15]]), ([[-2, 0, 3], [-1, 0, 1]], [[-1, 1], [1, 2], [-1, 30]]), ([[-2, 0, 3], [-1, -1, -1]], [[-1, 1], [0, 1], [0, 1]]), ([[0, 2, 3, 7], [2, 2, 2, 2]], [[2, 1], [0, 1], [0, 1], [0, 1]]), ([[-2, 0, 3], [1, -1, 1]], [[1, 1], [-1, 1], [1, 3]]), ([[-2, 0, 3], [1, -1, 2]], [[1, 1], [-1, 1], [2, 5]]), ([[-2, 0, 3], [1, 0, -1]], [[1, 1], [-1, 2], [1, 30]]), ([[-2, 0, 3], [1, 0, 0]], [[1, 1], [-1, 2], [1, 10]])], [([[-2, 0, 3], [-1, -1, 2]], [[-1, 1], [0, 1], [1, 5]]), ([[-2, 0, 3], [-1, 1, 0]], [[-1, 1], [1, 1], [-4, 15]]), ([[-2, 0, 3], [-1, -1, -1]], [[-1, 1], [0, 1], [0, 1]]), ([[0, 2, 3, 7], [2, 2, 2, 2]], [[2, 1], [0, 1], [0, 1], [0, 1]]), ([[-2, 0, 3], [2, -1, 2]], [[2, 1], [-3, 2], [1, 2]]), ([[-2, 0, 3], [2, 0, -1]], [[2, 1], [-1, 1], [2, 15]]), ([[-2, 0, 3], [2, 0, 0]], [[2, 1], [-1, 1], [1, 5]]), ([[-2, 0, 3], [2, 0, 1]], [[2, 1], [-1, 1], [4, 15]])], [([[-2, 0, 3], [-1, 0, -1]], [[-1, 1], [1, 2], [-1, 6]]), ([[-2, 0, 3], [-1, 2, -1]], [[-1, 1], [3, 2], [-1, 2]]), ([[-2, 0, 3], [-1, -1, -1]], [[-1, 1], [0, 1], [0, 1]]), ([[0, 2, 3, 7], [2, 2, 2, 2]], [[2, 1], [0, 1], [0, 1], [0, 1]]), ([[0, 1, 2], [-1, 0, -1]], [[-1, 1], [1, 1], [-1, 1]]), ([[0, 1, 2], [-1, 0, 0]], [[-1, 1], [1, 1], [-1, 2]]), ([[0, 1, 2], [-1, 0, 1]], [[-1, 1], [1, 1], [0, 1]]), ([[0, 1, 2], [-1, 0, 2]], [[-1, 1], [1, 1], [1, 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 | [[0, 1], [0, 1], [-1, 1]] | [[-1, 1], [0, 1], [0, 1]] | Failed |
| explicit oracle 1 | [[0, 1], [0, 1], [0, 1], [2, 1]] | [[2, 1], [0, 1], [0, 1], [0, 1]] | Failed |
| explicit oracle 2 | [[0, 1], [1, 15], [-1, 1]] | [[-1, 1], [0, 1], [1, 15]] | Failed |
| explicit oracle 3 | [[0, 1], [2, 15], [-1, 1]] | [[-1, 1], [0, 1], [2, 15]] | Failed |
| explicit oracle 4 | [[0, 1], [1, 5], [-1, 1]] | [[-1, 1], [0, 1], [1, 5]] | Failed |
| explicit oracle 5 | [[1, 2], [-1, 6], [-1, 1]] | [[-1, 1], [1, 2], [-1, 6]] | Failed |
| explicit oracle 6 | [[1, 2], [-1, 10], [-1, 1]] | [[-1, 1], [1, 2], [-1, 10]] | Failed |
| explicit oracle 7 | [[1, 2], [-1, 30], [-1, 1]] | [[-1, 1], [1, 2], [-1, 30]] | Failed |
SHA-256 / 4791c1033cd94a09b501f0649f5be812cd0cca2251bbec2022dc73e77b586bb6
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):
nodes,values=x
c=list(map(Fraction,values));n=len(c)
for order in range(1,n):
for i in range(n-1,order-1,-1):
den=nodes[i]-nodes[i-order]
if den==0:return None
c[i]=(c[i]-c[i-1])/den
return [[v.numerator,v.denominator] for v in c]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[-2, 0, 3], [-1, -1, -1]], [[-1, 1], [0, 1], [0, 1]]), ([[0, 2, 3, 7], [2, 2, 2, 2]], [[2, 1], [0, 1], [0, 1], [0, 1]]), ([[-2, 0, 3], [-1, -1, 0]], [[-1, 1], [0, 1], [1, 15]]), ([[-2, 0, 3], [-1, -1, 1]], [[-1, 1], [0, 1], [2, 15]]), ([[-2, 0, 3], [-1, -1, 2]], [[-1, 1], [0, 1], [1, 5]]), ([[-2, 0, 3], [-1, 0, -1]], [[-1, 1], [1, 2], [-1, 6]]), ([[-2, 0, 3], [-1, 0, 0]], [[-1, 1], [1, 2], [-1, 10]]), ([[-2, 0, 3], [-1, 0, 1]], [[-1, 1], [1, 2], [-1, 30]])], [([[-2, 0, 3], [-1, -1, 0]], [[-1, 1], [0, 1], [1, 15]]), ([[-2, 0, 3], [-1, -1, 2]], [[-1, 1], [0, 1], [1, 5]]), ([[-2, 0, 3], [-1, -1, -1]], [[-1, 1], [0, 1], [0, 1]]), ([[0, 2, 3, 7], [2, 2, 2, 2]], [[2, 1], [0, 1], [0, 1], [0, 1]]), ([[-2, 0, 3], [0, -1, 0]], [[0, 1], [-1, 2], [1, 6]]), ([[-2, 0, 3], [0, -1, 1]], [[0, 1], [-1, 2], [7, 30]]), ([[-2, 0, 3], [0, -1, 2]], [[0, 1], [-1, 2], [3, 10]]), ([[-2, 0, 3], [0, 0, -1]], [[0, 1], [0, 1], [-1, 15]])], [([[-2, 0, 3], [-1, -1, 1]], [[-1, 1], [0, 1], [2, 15]]), ([[-2, 0, 3], [-1, 0, 1]], [[-1, 1], [1, 2], [-1, 30]]), ([[-2, 0, 3], [-1, -1, -1]], [[-1, 1], [0, 1], [0, 1]]), ([[0, 2, 3, 7], [2, 2, 2, 2]], [[2, 1], [0, 1], [0, 1], [0, 1]]), ([[-2, 0, 3], [1, -1, 1]], [[1, 1], [-1, 1], [1, 3]]), ([[-2, 0, 3], [1, -1, 2]], [[1, 1], [-1, 1], [2, 5]]), ([[-2, 0, 3], [1, 0, -1]], [[1, 1], [-1, 2], [1, 30]]), ([[-2, 0, 3], [1, 0, 0]], [[1, 1], [-1, 2], [1, 10]])], [([[-2, 0, 3], [-1, -1, 2]], [[-1, 1], [0, 1], [1, 5]]), ([[-2, 0, 3], [-1, 1, 0]], [[-1, 1], [1, 1], [-4, 15]]), ([[-2, 0, 3], [-1, -1, -1]], [[-1, 1], [0, 1], [0, 1]]), ([[0, 2, 3, 7], [2, 2, 2, 2]], [[2, 1], [0, 1], [0, 1], [0, 1]]), ([[-2, 0, 3], [2, -1, 2]], [[2, 1], [-3, 2], [1, 2]]), ([[-2, 0, 3], [2, 0, -1]], [[2, 1], [-1, 1], [2, 15]]), ([[-2, 0, 3], [2, 0, 0]], [[2, 1], [-1, 1], [1, 5]]), ([[-2, 0, 3], [2, 0, 1]], [[2, 1], [-1, 1], [4, 15]])], [([[-2, 0, 3], [-1, 0, -1]], [[-1, 1], [1, 2], [-1, 6]]), ([[-2, 0, 3], [-1, 2, -1]], [[-1, 1], [3, 2], [-1, 2]]), ([[-2, 0, 3], [-1, -1, -1]], [[-1, 1], [0, 1], [0, 1]]), ([[0, 2, 3, 7], [2, 2, 2, 2]], [[2, 1], [0, 1], [0, 1], [0, 1]]), ([[0, 1, 2], [-1, 0, -1]], [[-1, 1], [1, 1], [-1, 1]]), ([[0, 1, 2], [-1, 0, 0]], [[-1, 1], [1, 1], [-1, 2]]), ([[0, 1, 2], [-1, 0, 1]], [[-1, 1], [1, 1], [0, 1]]), ([[0, 1, 2], [-1, 0, 2]], [[-1, 1], [1, 1], [1, 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], [0, 1], [0, 1]] | [[-1, 1], [0, 1], [0, 1]] | Passed |
| explicit oracle 1 | [[2, 1], [0, 1], [0, 1], [0, 1]] | [[2, 1], [0, 1], [0, 1], [0, 1]] | Passed |
| explicit oracle 2 | [[-1, 1], [0, 1], [1, 15]] | [[-1, 1], [0, 1], [1, 15]] | Passed |
| explicit oracle 3 | [[-1, 1], [0, 1], [2, 15]] | [[-1, 1], [0, 1], [2, 15]] | Passed |
| explicit oracle 4 | [[-1, 1], [0, 1], [1, 5]] | [[-1, 1], [0, 1], [1, 5]] | Passed |
| explicit oracle 5 | [[-1, 1], [1, 2], [-1, 6]] | [[-1, 1], [1, 2], [-1, 6]] | Passed |
| explicit oracle 6 | [[-1, 1], [1, 2], [-1, 10]] | [[-1, 1], [1, 2], [-1, 10]] | Passed |
| explicit oracle 7 | [[-1, 1], [1, 2], [-1, 30]] | [[-1, 1], [1, 2], [-1, 30]] | Passed |
SHA-256 / 4c44ff36dec76205cf3a336276b7c07728c954056ef3c2f6899b0ce56af84c63
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.741578+00:00.
Case digest / fcc42c2e5d9f6a7e298f081a49f190c80949bb85263510c9876631158ba6c8a3