FA-14681 / Numerics / Open access
Lagrange interpolation value: evaluation numerator · case 01
The exact lagrange interpolation value result violates the stated contract at evaluation numerator.
ROOT CAUSE
The evaluation numerator step uses t-xi instead of t-xj.
VERIFIED REPAIR
Use t-xj at the evaluation numerator step.
Unsuccessful approach: The partial repair t+xj still violates the evaluation numerator invariant.
Case contract
Input [points,t] distinct integer abscissae and integer ordinates; exact rational interpolation value [p,q].
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):
points,t=x
ans=Fraction(0)
for i,(xi,yi) in enumerate(points):
term=Fraction(yi)
for j,(xj,yj) in enumerate(points):
if i==j:continue
den=xi-xj
if den==0:return None
term*=Fraction(t-xi,den)
ans=ans+term
return [ans.numerator,ans.denominator]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[[-2, -2], [-1, -2], [0, -1]], -3], [-1, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -3], [-2, 1]), ([[[0, 2], [2, 2]], 3], [2, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -2], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -1], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -2]], 0], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -2]], 1], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -2]], 2], [-2, 1])], [([[[-2, -2], [-1, -2], [0, -1]], -2], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -1]], 1], [1, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -3], [-2, 1]), ([[[0, 2], [2, 2]], 3], [2, 1]), ([[[-2, -2], [-1, -2], [0, 0]], 0], [0, 1]), ([[[-2, -2], [-1, -2], [0, 0]], 1], [4, 1]), ([[[-2, -2], [-1, -2], [0, 0]], 2], [10, 1]), ([[[-2, -2], [-1, -2], [0, 0]], 3], [18, 1])], [([[[-2, -2], [-1, -2], [0, -1]], -1], [-2, 1]), ([[[-2, -2], [-1, -2], [0, 0]], -3], [0, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -3], [-2, 1]), ([[[0, 2], [2, 2]], 3], [2, 1]), ([[[-2, -2], [-1, -2], [0, 2]], 3], [38, 1]), ([[[-2, -2], [-1, -1], [0, -2]], -3], [-5, 1]), ([[[-2, -2], [-1, -1], [0, -2]], -2], [-2, 1]), ([[[-2, -2], [-1, -1], [0, -2]], -1], [-1, 1])], [([[[-2, -2], [-1, -2], [0, -1]], 0], [-1, 1]), ([[[-2, -2], [-1, -2], [0, 0]], 1], [4, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -3], [-2, 1]), ([[[0, 2], [2, 2]], 3], [2, 1]), ([[[-2, -2], [-1, -1], [0, 0]], -1], [-1, 1]), ([[[-2, -2], [-1, -1], [0, 0]], 0], [0, 1]), ([[[-2, -2], [-1, -1], [0, 0]], 1], [1, 1]), ([[[-2, -2], [-1, -1], [0, 0]], 2], [2, 1])], [([[[-2, -2], [-1, -2], [0, -1]], 1], [1, 1]), ([[[-2, -2], [-1, -2], [0, 1]], -3], [1, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -3], [-2, 1]), ([[[0, 2], [2, 2]], 3], [2, 1]), ([[[-2, -2], [-1, -1], [0, 2]], 2], [14, 1]), ([[[-2, -2], [-1, -1], [0, 2]], 3], [23, 1]), ([[[-2, -2], [-1, 0], [0, -2]], -3], [-8, 1]), ([[[-2, -2], [-1, 0], [0, -2]], -2], [-2, 1])]]
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 | [5, 2] | [-1, 1] | Failed |
| explicit oracle 1 | [-2, 1] | [-2, 1] | Passed |
| explicit oracle 2 | [-2, 1] | [2, 1] | Failed |
| explicit oracle 3 | [-2, 1] | [-2, 1] | Passed |
| explicit oracle 4 | [-2, 1] | [-2, 1] | Passed |
| explicit oracle 5 | [-2, 1] | [-2, 1] | Passed |
| explicit oracle 6 | [-2, 1] | [-2, 1] | Passed |
| explicit oracle 7 | [-2, 1] | [-2, 1] | Passed |
SHA-256 / 1e42509e6ef6746de3feef907802f7b2ff90915d79bcbf8c656b5aad7d5ae429
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):
points,t=x
ans=Fraction(0)
for i,(xi,yi) in enumerate(points):
term=Fraction(yi)
for j,(xj,yj) in enumerate(points):
if i==j:continue
den=xi-xj
if den==0:return None
term*=Fraction(t+xj,den)
ans=ans+term
return [ans.numerator,ans.denominator]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[[-2, -2], [-1, -2], [0, -1]], -3], [-1, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -3], [-2, 1]), ([[[0, 2], [2, 2]], 3], [2, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -2], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -1], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -2]], 0], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -2]], 1], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -2]], 2], [-2, 1])], [([[[-2, -2], [-1, -2], [0, -1]], -2], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -1]], 1], [1, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -3], [-2, 1]), ([[[0, 2], [2, 2]], 3], [2, 1]), ([[[-2, -2], [-1, -2], [0, 0]], 0], [0, 1]), ([[[-2, -2], [-1, -2], [0, 0]], 1], [4, 1]), ([[[-2, -2], [-1, -2], [0, 0]], 2], [10, 1]), ([[[-2, -2], [-1, -2], [0, 0]], 3], [18, 1])], [([[[-2, -2], [-1, -2], [0, -1]], -1], [-2, 1]), ([[[-2, -2], [-1, -2], [0, 0]], -3], [0, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -3], [-2, 1]), ([[[0, 2], [2, 2]], 3], [2, 1]), ([[[-2, -2], [-1, -2], [0, 2]], 3], [38, 1]), ([[[-2, -2], [-1, -1], [0, -2]], -3], [-5, 1]), ([[[-2, -2], [-1, -1], [0, -2]], -2], [-2, 1]), ([[[-2, -2], [-1, -1], [0, -2]], -1], [-1, 1])], [([[[-2, -2], [-1, -2], [0, -1]], 0], [-1, 1]), ([[[-2, -2], [-1, -2], [0, 0]], 1], [4, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -3], [-2, 1]), ([[[0, 2], [2, 2]], 3], [2, 1]), ([[[-2, -2], [-1, -1], [0, 0]], -1], [-1, 1]), ([[[-2, -2], [-1, -1], [0, 0]], 0], [0, 1]), ([[[-2, -2], [-1, -1], [0, 0]], 1], [1, 1]), ([[[-2, -2], [-1, -1], [0, 0]], 2], [2, 1])], [([[[-2, -2], [-1, -2], [0, -1]], 1], [1, 1]), ([[[-2, -2], [-1, -2], [0, 1]], -3], [1, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -3], [-2, 1]), ([[[0, 2], [2, 2]], 3], [2, 1]), ([[[-2, -2], [-1, -1], [0, 2]], 2], [14, 1]), ([[[-2, -2], [-1, -1], [0, 2]], 3], [23, 1]), ([[[-2, -2], [-1, 0], [0, -2]], -3], [-8, 1]), ([[[-2, -2], [-1, 0], [0, -2]], -2], [-2, 1])]]
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 | [8, 1] | [-1, 1] | Failed |
| explicit oracle 1 | [-2, 1] | [-2, 1] | Passed |
| explicit oracle 2 | [-2, 1] | [2, 1] | Failed |
| explicit oracle 3 | [-2, 1] | [-2, 1] | Passed |
| explicit oracle 4 | [-2, 1] | [-2, 1] | Passed |
| explicit oracle 5 | [-2, 1] | [-2, 1] | Passed |
| explicit oracle 6 | [-2, 1] | [-2, 1] | Passed |
| explicit oracle 7 | [-2, 1] | [-2, 1] | Passed |
SHA-256 / 0698419fcdd7627456b74bc5546b3a971b07f342f8a2175a4da5130b2af553f5
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):
points,t=x
ans=Fraction(0)
for i,(xi,yi) in enumerate(points):
term=Fraction(yi)
for j,(xj,yj) in enumerate(points):
if i==j:continue
den=xi-xj
if den==0:return None
term*=Fraction(t-xj,den)
ans=ans+term
return [ans.numerator,ans.denominator]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[[-2, -2], [-1, -2], [0, -1]], -3], [-1, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -3], [-2, 1]), ([[[0, 2], [2, 2]], 3], [2, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -2], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -1], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -2]], 0], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -2]], 1], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -2]], 2], [-2, 1])], [([[[-2, -2], [-1, -2], [0, -1]], -2], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -1]], 1], [1, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -3], [-2, 1]), ([[[0, 2], [2, 2]], 3], [2, 1]), ([[[-2, -2], [-1, -2], [0, 0]], 0], [0, 1]), ([[[-2, -2], [-1, -2], [0, 0]], 1], [4, 1]), ([[[-2, -2], [-1, -2], [0, 0]], 2], [10, 1]), ([[[-2, -2], [-1, -2], [0, 0]], 3], [18, 1])], [([[[-2, -2], [-1, -2], [0, -1]], -1], [-2, 1]), ([[[-2, -2], [-1, -2], [0, 0]], -3], [0, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -3], [-2, 1]), ([[[0, 2], [2, 2]], 3], [2, 1]), ([[[-2, -2], [-1, -2], [0, 2]], 3], [38, 1]), ([[[-2, -2], [-1, -1], [0, -2]], -3], [-5, 1]), ([[[-2, -2], [-1, -1], [0, -2]], -2], [-2, 1]), ([[[-2, -2], [-1, -1], [0, -2]], -1], [-1, 1])], [([[[-2, -2], [-1, -2], [0, -1]], 0], [-1, 1]), ([[[-2, -2], [-1, -2], [0, 0]], 1], [4, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -3], [-2, 1]), ([[[0, 2], [2, 2]], 3], [2, 1]), ([[[-2, -2], [-1, -1], [0, 0]], -1], [-1, 1]), ([[[-2, -2], [-1, -1], [0, 0]], 0], [0, 1]), ([[[-2, -2], [-1, -1], [0, 0]], 1], [1, 1]), ([[[-2, -2], [-1, -1], [0, 0]], 2], [2, 1])], [([[[-2, -2], [-1, -2], [0, -1]], 1], [1, 1]), ([[[-2, -2], [-1, -2], [0, 1]], -3], [1, 1]), ([[[-2, -2], [-1, -2], [0, -2]], -3], [-2, 1]), ([[[0, 2], [2, 2]], 3], [2, 1]), ([[[-2, -2], [-1, -1], [0, 2]], 2], [14, 1]), ([[[-2, -2], [-1, -1], [0, 2]], 3], [23, 1]), ([[[-2, -2], [-1, 0], [0, -2]], -3], [-8, 1]), ([[[-2, -2], [-1, 0], [0, -2]], -2], [-2, 1])]]
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 | [-2, 1] | [-2, 1] | Passed |
| explicit oracle 2 | [2, 1] | [2, 1] | Passed |
| explicit oracle 3 | [-2, 1] | [-2, 1] | Passed |
| explicit oracle 4 | [-2, 1] | [-2, 1] | Passed |
| explicit oracle 5 | [-2, 1] | [-2, 1] | Passed |
| explicit oracle 6 | [-2, 1] | [-2, 1] | Passed |
| explicit oracle 7 | [-2, 1] | [-2, 1] | Passed |
SHA-256 / 5bf1cb8b5af9267ec694e35b363ff884b53d985ec58628a170e02084463b1069
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.286162+00:00.
Case digest / eaaee070832944019b0915a8ef6f431663840cf7a272678e97ce1ffb3c8919a3