FAILURE MAP
← Case archive

FA-14781 / Numerics / Open access

Rational generating recurrence: recurrence subtraction · case 01

The exact rational generating recurrence result violates the stated contract at recurrence subtraction.

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

ROOT CAUSE

The recurrence subtraction step uses v+Q[j]*r[n-j] instead of v-Q[j]*r[n-j].

VERIFIED REPAIR

Use v-Q[j]*r[n-j] at the recurrence subtraction step.

Unsuccessful approach: The partial repair v-Q[j] still violates the recurrence subtraction invariant.

Case contract

Input [P,Q,k] integer ascending arrays with Q[0]=1 and k>=0; return first k coefficients of formal series 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):
    P,Q,k=x
    r=[]
    for n in range(k):
     v=P[n] if n<len(P) else 0
     for j in range(1,min(n,len(Q)-1)+1):
      v=v+Q[j]*r[n-j]
     r.append(v)
    return r
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[-1, -1], [1, -2, -2], 2], [-1, -3]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -2, -2], 3], [-1, -3, -8]), ([[-1, -1], [1, -2, -2], 4], [-1, -3, -8, -22]), ([[-1, -1], [1, -2, -2], 5], [-1, -3, -8, -22, -60]), ([[-1, -1], [1, -2, -2], 6], [-1, -3, -8, -22, -60, -164]), ([[-1, -1], [1, -2, -2], 7], [-1, -3, -8, -22, -60, -164, -448])], [([[-1, -1], [1, -2, -2], 3], [-1, -3, -8]), ([[-1, -1], [1, -2, -2], 5], [-1, -3, -8, -22, -60]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -2, 0], 2], [-1, -3]), ([[-1, -1], [1, -2, 0], 3], [-1, -3, -6]), ([[-1, -1], [1, -2, 0], 4], [-1, -3, -6, -12]), ([[-1, -1], [1, -2, 0], 5], [-1, -3, -6, -12, -24])], [([[-1, -1], [1, -2, -2], 4], [-1, -3, -8, -22]), ([[-1, -1], [1, -2, -2], 8], [-1, -3, -8, -22, -60, -164, -448, -1224]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -2, 2], 3], [-1, -3, -4]), ([[-1, -1], [1, -2, 2], 4], [-1, -3, -4, -2]), ([[-1, -1], [1, -2, 2], 5], [-1, -3, -4, -2, 4]), ([[-1, -1], [1, -2, 2], 6], [-1, -3, -4, -2, 4, 12])], [([[-1, -1], [1, -2, -2], 5], [-1, -3, -8, -22, -60]), ([[-1, -1], [1, -2, -1], 4], [-1, -3, -7, -17]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -1, -1], 4], [-1, -2, -3, -5]), ([[-1, -1], [1, -1, -1], 5], [-1, -2, -3, -5, -8]), ([[-1, -1], [1, -1, -1], 6], [-1, -2, -3, -5, -8, -13]), ([[-1, -1], [1, -1, -1], 7], [-1, -2, -3, -5, -8, -13, -21])], [([[-1, -1], [1, -2, -2], 6], [-1, -3, -8, -22, -60, -164]), ([[-1, -1], [1, -2, -1], 7], [-1, -3, -7, -17, -41, -99, -239]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -1, 1], 5], [-1, -2, -1, 1, 2]), ([[-1, -1], [1, -1, 1], 6], [-1, -2, -1, 1, 2, 1]), ([[-1, -1], [1, -1, 1], 7], [-1, -2, -1, 1, 2, 1, -1]), ([[-1, -1], [1, -1, 1], 8], [-1, -2, -1, 1, 2, 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 fixtureActualExpectedOutcome
explicit oracle 0[-1, 1][-1, -3]Failed
explicit oracle 1[-1][-1]Passed
explicit oracle 2[1, 3, 8, 22, 60, 164, 448, 1224][1, -1, 0, 2, -4, 4, 0, -8]Failed
explicit oracle 3[-1, 1, 0][-1, -3, -8]Failed
explicit oracle 4[-1, 1, 0, -2][-1, -3, -8, -22]Failed
explicit oracle 5[-1, 1, 0, -2, 4][-1, -3, -8, -22, -60]Failed
explicit oracle 6[-1, 1, 0, -2, 4, -4][-1, -3, -8, -22, -60, -164]Failed
explicit oracle 7[-1, 1, 0, -2, 4, -4, 0][-1, -3, -8, -22, -60, -164, -448]Failed

SHA-256 / 9ed848d07cfd1d3c7d92bc807df21b9028950a3496a2d2abca03aa0600255a9d

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):
    P,Q,k=x
    r=[]
    for n in range(k):
     v=P[n] if n<len(P) else 0
     for j in range(1,min(n,len(Q)-1)+1):
      v=v-Q[j]
     r.append(v)
    return r
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[-1, -1], [1, -2, -2], 2], [-1, -3]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -2, -2], 3], [-1, -3, -8]), ([[-1, -1], [1, -2, -2], 4], [-1, -3, -8, -22]), ([[-1, -1], [1, -2, -2], 5], [-1, -3, -8, -22, -60]), ([[-1, -1], [1, -2, -2], 6], [-1, -3, -8, -22, -60, -164]), ([[-1, -1], [1, -2, -2], 7], [-1, -3, -8, -22, -60, -164, -448])], [([[-1, -1], [1, -2, -2], 3], [-1, -3, -8]), ([[-1, -1], [1, -2, -2], 5], [-1, -3, -8, -22, -60]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -2, 0], 2], [-1, -3]), ([[-1, -1], [1, -2, 0], 3], [-1, -3, -6]), ([[-1, -1], [1, -2, 0], 4], [-1, -3, -6, -12]), ([[-1, -1], [1, -2, 0], 5], [-1, -3, -6, -12, -24])], [([[-1, -1], [1, -2, -2], 4], [-1, -3, -8, -22]), ([[-1, -1], [1, -2, -2], 8], [-1, -3, -8, -22, -60, -164, -448, -1224]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -2, 2], 3], [-1, -3, -4]), ([[-1, -1], [1, -2, 2], 4], [-1, -3, -4, -2]), ([[-1, -1], [1, -2, 2], 5], [-1, -3, -4, -2, 4]), ([[-1, -1], [1, -2, 2], 6], [-1, -3, -4, -2, 4, 12])], [([[-1, -1], [1, -2, -2], 5], [-1, -3, -8, -22, -60]), ([[-1, -1], [1, -2, -1], 4], [-1, -3, -7, -17]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -1, -1], 4], [-1, -2, -3, -5]), ([[-1, -1], [1, -1, -1], 5], [-1, -2, -3, -5, -8]), ([[-1, -1], [1, -1, -1], 6], [-1, -2, -3, -5, -8, -13]), ([[-1, -1], [1, -1, -1], 7], [-1, -2, -3, -5, -8, -13, -21])], [([[-1, -1], [1, -2, -2], 6], [-1, -3, -8, -22, -60, -164]), ([[-1, -1], [1, -2, -1], 7], [-1, -3, -7, -17, -41, -99, -239]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -1, 1], 5], [-1, -2, -1, 1, 2]), ([[-1, -1], [1, -1, 1], 6], [-1, -2, -1, 1, 2, 1]), ([[-1, -1], [1, -1, 1], 7], [-1, -2, -1, 1, 2, 1, -1]), ([[-1, -1], [1, -1, 1], 8], [-1, -2, -1, 1, 2, 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 fixtureActualExpectedOutcome
explicit oracle 0[-1, 1][-1, -3]Failed
explicit oracle 1[-1][-1]Passed
explicit oracle 2[1, -1, -4, -4, -4, -4, -4, -4][1, -1, 0, 2, -4, 4, 0, -8]Failed
explicit oracle 3[-1, 1, 4][-1, -3, -8]Failed
explicit oracle 4[-1, 1, 4, 4][-1, -3, -8, -22]Failed
explicit oracle 5[-1, 1, 4, 4, 4][-1, -3, -8, -22, -60]Failed
explicit oracle 6[-1, 1, 4, 4, 4, 4][-1, -3, -8, -22, -60, -164]Failed
explicit oracle 7[-1, 1, 4, 4, 4, 4, 4][-1, -3, -8, -22, -60, -164, -448]Failed

SHA-256 / 58144608f37d02183ec00f28b6453327dba9544891165a95fb43b0877af4dcec

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):
    P,Q,k=x
    r=[]
    for n in range(k):
     v=P[n] if n<len(P) else 0
     for j in range(1,min(n,len(Q)-1)+1):
      v=v-Q[j]*r[n-j]
     r.append(v)
    return r
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[([[-1, -1], [1, -2, -2], 2], [-1, -3]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -2, -2], 3], [-1, -3, -8]), ([[-1, -1], [1, -2, -2], 4], [-1, -3, -8, -22]), ([[-1, -1], [1, -2, -2], 5], [-1, -3, -8, -22, -60]), ([[-1, -1], [1, -2, -2], 6], [-1, -3, -8, -22, -60, -164]), ([[-1, -1], [1, -2, -2], 7], [-1, -3, -8, -22, -60, -164, -448])], [([[-1, -1], [1, -2, -2], 3], [-1, -3, -8]), ([[-1, -1], [1, -2, -2], 5], [-1, -3, -8, -22, -60]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -2, 0], 2], [-1, -3]), ([[-1, -1], [1, -2, 0], 3], [-1, -3, -6]), ([[-1, -1], [1, -2, 0], 4], [-1, -3, -6, -12]), ([[-1, -1], [1, -2, 0], 5], [-1, -3, -6, -12, -24])], [([[-1, -1], [1, -2, -2], 4], [-1, -3, -8, -22]), ([[-1, -1], [1, -2, -2], 8], [-1, -3, -8, -22, -60, -164, -448, -1224]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -2, 2], 3], [-1, -3, -4]), ([[-1, -1], [1, -2, 2], 4], [-1, -3, -4, -2]), ([[-1, -1], [1, -2, 2], 5], [-1, -3, -4, -2, 4]), ([[-1, -1], [1, -2, 2], 6], [-1, -3, -4, -2, 4, 12])], [([[-1, -1], [1, -2, -2], 5], [-1, -3, -8, -22, -60]), ([[-1, -1], [1, -2, -1], 4], [-1, -3, -7, -17]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -1, -1], 4], [-1, -2, -3, -5]), ([[-1, -1], [1, -1, -1], 5], [-1, -2, -3, -5, -8]), ([[-1, -1], [1, -1, -1], 6], [-1, -2, -3, -5, -8, -13]), ([[-1, -1], [1, -1, -1], 7], [-1, -2, -3, -5, -8, -13, -21])], [([[-1, -1], [1, -2, -2], 6], [-1, -3, -8, -22, -60, -164]), ([[-1, -1], [1, -2, -1], 7], [-1, -3, -7, -17, -41, -99, -239]), ([[-1, -1], [1, -2, -2], 1], [-1]), ([[1, 1], [1, 2, 2], 8], [1, -1, 0, 2, -4, 4, 0, -8]), ([[-1, -1], [1, -1, 1], 5], [-1, -2, -1, 1, 2]), ([[-1, -1], [1, -1, 1], 6], [-1, -2, -1, 1, 2, 1]), ([[-1, -1], [1, -1, 1], 7], [-1, -2, -1, 1, 2, 1, -1]), ([[-1, -1], [1, -1, 1], 8], [-1, -2, -1, 1, 2, 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 fixtureActualExpectedOutcome
explicit oracle 0[-1, -3][-1, -3]Passed
explicit oracle 1[-1][-1]Passed
explicit oracle 2[1, -1, 0, 2, -4, 4, 0, -8][1, -1, 0, 2, -4, 4, 0, -8]Passed
explicit oracle 3[-1, -3, -8][-1, -3, -8]Passed
explicit oracle 4[-1, -3, -8, -22][-1, -3, -8, -22]Passed
explicit oracle 5[-1, -3, -8, -22, -60][-1, -3, -8, -22, -60]Passed
explicit oracle 6[-1, -3, -8, -22, -60, -164][-1, -3, -8, -22, -60, -164]Passed
explicit oracle 7[-1, -3, -8, -22, -60, -164, -448][-1, -3, -8, -22, -60, -164, -448]Passed

SHA-256 / 34d41f77b43960ba7259af186937645d5ba430c201bad64308480b1e73920ab1

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

Case digest / aa7ff8d7d0af5b15bab60fa274b1db902cfcd160f94a0b790634fe994dbdb06d