FAILURE MAP
← Case archive

FA-6456 / Discrete calculus / Open access

Newton divided difference two · case 01

Uniform-grid second differences are applied to nonuniform nodes.

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

ROOT CAUSE

Uniform-grid second differences are applied to nonuniform nodes.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return str((Fraction(y2-y1,x2-x1)-Fraction(y1-y0,x1-x0))/Fraction(x2-x0))

Unsuccessful approach: The difference of first slopes is not divided by the full node span.

Case contract

Integer sample values and compatible sample-array lengths. Rational results are reduced Fraction strings; spacing is positive unless explicitly stated otherwise. x0,x1,x2 are pairwise distinct integer nodes with integer observations; return the second divided difference. Exact operational definition: str((Fraction(y2-y1,x2-x1)-Fraction(y1-y0,x1-x0))/Fraction(x2-x0))

Why this case matters

Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Discrete calculus results depend on the stated convention.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(x0, y0, x1, y1, x2, y2):
    return str(Fraction(y2-2*y1+y0,x2-x0))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0, 0, 1, 1, 3, 9)', solve(*(0, 0, 1, 1, 3, 9)), '1')
check('fixture 2: (0, 1, 2, 5, 4, 17)', solve(*(0, 1, 2, 5, 4, 17)), '1')
check('fixture 3: (0, 3, 1, 5, 2, 7)', solve(*(0, 3, 1, 5, 2, 7)), '0')
check('fixture 4: (1, 1, 2, 4, 4, 16)', solve(*(1, 1, 2, 4, 4, 16)), '1')
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
fixture 1: (0, 0, 1, 1, 3, 9)7/31Failed
fixture 2: (0, 1, 2, 5, 4, 17)21Failed
fixture 3: (0, 3, 1, 5, 2, 7)00Passed
fixture 4: (1, 1, 2, 4, 4, 16)31Failed

SHA-256 / 157714a418001485499e8a52fa975a3c4970d249b8a1ddd4ed9357a13ae081a5

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(x0, y0, x1, y1, x2, y2):
    return str(Fraction(y2-y1,x2-x1)-Fraction(y1-y0,x1-x0))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0, 0, 1, 1, 3, 9)', solve(*(0, 0, 1, 1, 3, 9)), '1')
check('fixture 2: (0, 1, 2, 5, 4, 17)', solve(*(0, 1, 2, 5, 4, 17)), '1')
check('fixture 3: (0, 3, 1, 5, 2, 7)', solve(*(0, 3, 1, 5, 2, 7)), '0')
check('fixture 4: (1, 1, 2, 4, 4, 16)', solve(*(1, 1, 2, 4, 4, 16)), '1')
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
fixture 1: (0, 0, 1, 1, 3, 9)31Failed
fixture 2: (0, 1, 2, 5, 4, 17)41Failed
fixture 3: (0, 3, 1, 5, 2, 7)00Passed
fixture 4: (1, 1, 2, 4, 4, 16)31Failed

SHA-256 / eb60c83f240bd1bc025591de8f76913a063f81806a7cb39f0684985c877ac1cf

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
import calendar
import statistics
import itertools
from fractions import Fraction
from datetime import date, datetime, timedelta, timezone
from decimal import Decimal, ROUND_HALF_UP, ROUND_DOWN, ROUND_CEILING, ROUND_FLOOR

N = 1
observations = []
def solve(x0, y0, x1, y1, x2, y2):
    return str((Fraction(y2-y1,x2-x1)-Fraction(y1-y0,x1-x0))/Fraction(x2-x0))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (0, 0, 1, 1, 3, 9)', solve(*(0, 0, 1, 1, 3, 9)), '1')
check('fixture 2: (0, 1, 2, 5, 4, 17)', solve(*(0, 1, 2, 5, 4, 17)), '1')
check('fixture 3: (0, 3, 1, 5, 2, 7)', solve(*(0, 3, 1, 5, 2, 7)), '0')
check('fixture 4: (1, 1, 2, 4, 4, 16)', solve(*(1, 1, 2, 4, 4, 16)), '1')
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
fixture 1: (0, 0, 1, 1, 3, 9)11Passed
fixture 2: (0, 1, 2, 5, 4, 17)11Passed
fixture 3: (0, 3, 1, 5, 2, 7)00Passed
fixture 4: (1, 1, 2, 4, 4, 16)11Passed

SHA-256 / 8629132a3ab9cadca6d3b1d08cbb583fbd061cb10f15c29ad40724469c87b65c

Verification & scope

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

Case digest / 35c138b2bcb97b2e91ca9f43227a451e1f472165ce9ccbe3dcbcc039d4e7e53d