FAILURE MAP
← Case archive

FA-14666 / Numerics / Open access

Lagrange interpolation value: basis ordinate scale · case 01

The exact lagrange interpolation value result violates the stated contract at basis ordinate scale.

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

ROOT CAUSE

The basis ordinate scale step uses Fraction(xi) instead of Fraction(yi).

VERIFIED REPAIR

Use Fraction(yi) at the basis ordinate scale step.

Unsuccessful approach: The partial repair Fraction(1) still violates the basis ordinate scale 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(xi)
     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, -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, -2]], 3], [-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]], -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, -2]], 0], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -2]], 3], [-2, 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, -2]], 1], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -1]], -1], [-2, 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, -2]], 2], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -1]], 3], [8, 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 fixtureActualExpectedOutcome
explicit oracle 0[-3, 1][-2, 1]Failed
explicit oracle 1[3, 1][2, 1]Failed
explicit oracle 2[-2, 1][-2, 1]Passed
explicit oracle 3[-1, 1][-2, 1]Failed
explicit oracle 4[0, 1][-2, 1]Failed
explicit oracle 5[1, 1][-2, 1]Failed
explicit oracle 6[2, 1][-2, 1]Failed
explicit oracle 7[3, 1][-2, 1]Failed

SHA-256 / 9c2bbaf6c2a1c16154aacf155d3e60a246b31d8000c4debeb7b315105d7ca53c

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(1)
     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, -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, -2]], 3], [-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]], -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, -2]], 0], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -2]], 3], [-2, 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, -2]], 1], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -1]], -1], [-2, 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, -2]], 2], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -1]], 3], [8, 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 fixtureActualExpectedOutcome
explicit oracle 0[1, 1][-2, 1]Failed
explicit oracle 1[1, 1][2, 1]Failed
explicit oracle 2[1, 1][-2, 1]Failed
explicit oracle 3[1, 1][-2, 1]Failed
explicit oracle 4[1, 1][-2, 1]Failed
explicit oracle 5[1, 1][-2, 1]Failed
explicit oracle 6[1, 1][-2, 1]Failed
explicit oracle 7[1, 1][-2, 1]Failed

SHA-256 / 878870f74c48a53f4d733c9092029dcf871bea798635f9e52667d7f900d3e2bd

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, -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, -2]], 3], [-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]], -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, -2]], 0], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -2]], 3], [-2, 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, -2]], 1], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -1]], -1], [-2, 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, -2]], 2], [-2, 1]), ([[[-2, -2], [-1, -2], [0, -1]], 3], [8, 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 fixtureActualExpectedOutcome
explicit oracle 0[-2, 1][-2, 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 / 0b3a951971ae5fd2971a6f1f4f130f7333ca8995d41144bae10df9842d591d3b

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

Case digest / 9bce185b34000b17eb789d8a22ee0aeef3fc153063a346a4cdf07a5aa0ca758f