FAILURE MAP
← Case archive

FA-6166 / Polynomial arithmetic / Open access

Polynomial definite integral rational · case 01

The antiderivative at the lower bound is omitted.

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

ROOT CAUSE

The antiderivative at the lower bound is omitted.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return str(sum((Fraction(c*(b**(i+1)-a**(i+1)),i+1) for i,c in enumerate(coeff)),Fraction()))

Unsuccessful approach: Endpoint antiderivatives are added rather than subtracted.

Case contract

Integer coefficients in ascending power order and integer evaluation bounds; missing high-degree coefficients are zero. Rational outputs are reduced Fraction strings; the zero-polynomial degree is -1. a and b may be in either order; return the exact signed definite integral. Exact operational definition: str(sum((Fraction(c*(b**(i+1)-a**(i+1)),i+1) for i,c in enumerate(coeff)),Fraction()))

Why this case matters

Small exact fixtures expose this error without platform timing, external services, or probabilistic observations. Polynomial arithmetic 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(coeff, a, b):
    return str(sum(Fraction(c*b**(i+1),i+1) for i,c in enumerate(coeff)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2], 1, 3)', solve(*([1, 2], 1, 3)), '10')
check('fixture 2: ([0, 1], -1, 1)', solve(*([0, 1], -1, 1)), '0')
check('fixture 3: ([3], 4, 4)', solve(*([3], 4, 4)), '0')
check('fixture 4: ([2], 3, 1)', solve(*([2], 3, 1)), '-4')
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: ([1, 2], 1, 3)1210Failed
fixture 2: ([0, 1], -1, 1)1/20Failed
fixture 3: ([3], 4, 4)120Failed
fixture 4: ([2], 3, 1)2-4Failed

SHA-256 / 230f48837dcb972d90f0b5ddb60631ca2ef1ec1794f456fd8c980ecc8f0cbbfa

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(coeff, a, b):
    return str(sum(Fraction(c*(b**(i+1)+a**(i+1)),i+1) for i,c in enumerate(coeff)))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2], 1, 3)', solve(*([1, 2], 1, 3)), '10')
check('fixture 2: ([0, 1], -1, 1)', solve(*([0, 1], -1, 1)), '0')
check('fixture 3: ([3], 4, 4)', solve(*([3], 4, 4)), '0')
check('fixture 4: ([2], 3, 1)', solve(*([2], 3, 1)), '-4')
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: ([1, 2], 1, 3)1410Failed
fixture 2: ([0, 1], -1, 1)10Failed
fixture 3: ([3], 4, 4)240Failed
fixture 4: ([2], 3, 1)8-4Failed

SHA-256 / 21923c6870f0e3932d3509ccba4fc3ec6003fd17c668256221572f7cf66b576e

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(coeff, a, b):
    return str(sum((Fraction(c*(b**(i+1)-a**(i+1)),i+1) for i,c in enumerate(coeff)),Fraction()))
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2], 1, 3)', solve(*([1, 2], 1, 3)), '10')
check('fixture 2: ([0, 1], -1, 1)', solve(*([0, 1], -1, 1)), '0')
check('fixture 3: ([3], 4, 4)', solve(*([3], 4, 4)), '0')
check('fixture 4: ([2], 3, 1)', solve(*([2], 3, 1)), '-4')
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: ([1, 2], 1, 3)1010Passed
fixture 2: ([0, 1], -1, 1)00Passed
fixture 3: ([3], 4, 4)00Passed
fixture 4: ([2], 3, 1)-4-4Passed

SHA-256 / 2d7b99bd678a8364cdd1b52e4c3e1accd08ec63c2db9f20315ef473875a1b918

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

Case digest / e2abfb3884a84ede3bf9644f96b22071803cd26504632eb687db60e524d452df