FAILURE MAP
← Case archive

FA-6146 / Polynomial arithmetic / Open access

Polynomial value at minus one · case 01

Coefficient sum evaluates at positive one rather than negative one.

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

ROOT CAUSE

Coefficient sum evaluates at positive one rather than negative one.

VERIFIED REPAIR

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

Unsuccessful approach: Alternating signs begin with negative instead of positive.

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. Polynomial value at minus one. Exact operational definition: sum(c*(-1)**i for i,c in enumerate(coeff))

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):
    return sum(coeff)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: ([1, 2, 3],)', solve(*([1, 2, 3],)), 2)
check('fixture 2: ([5],)', solve(*([5],)), 5)
check('fixture 3: ([0, 1],)', solve(*([0, 1],)), -1)
check('fixture 4: ([],)', solve(*([],)), 0)
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, 3],)62Failed
fixture 2: ([5],)55Passed
fixture 3: ([0, 1],)1-1Failed
fixture 4: ([],)00Passed

SHA-256 / aaeec7f3432cbaeac5418b644c9b2fc793046235af26f041eb3208e7b538c730

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):
    return sum(c*(-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, 3],)', solve(*([1, 2, 3],)), 2)
check('fixture 2: ([5],)', solve(*([5],)), 5)
check('fixture 3: ([0, 1],)', solve(*([0, 1],)), -1)
check('fixture 4: ([],)', solve(*([],)), 0)
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, 3],)-22Failed
fixture 2: ([5],)-55Failed
fixture 3: ([0, 1],)1-1Failed
fixture 4: ([],)00Passed

SHA-256 / 3617c5ee3384e92e09e235566805d21e10b2d6d0cd115b2d69e508120f893251

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):
    return sum(c*(-1)**i 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, 3],)', solve(*([1, 2, 3],)), 2)
check('fixture 2: ([5],)', solve(*([5],)), 5)
check('fixture 3: ([0, 1],)', solve(*([0, 1],)), -1)
check('fixture 4: ([],)', solve(*([],)), 0)
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, 3],)22Passed
fixture 2: ([5],)55Passed
fixture 3: ([0, 1],)-1-1Passed
fixture 4: ([],)00Passed

SHA-256 / ec17339a726e6e92b92d2aa28b2c780b06f9c5edf3e19d81d10f0f1114a34a63

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

Case digest / dad3d996b699200f331cb0fd033fe8b4402689e2a0c456c95ab02b9dde370e97