FAILURE MAP
← Case archive

FA-6171 / Polynomial arithmetic / Open access

Polynomial compose negative argument · case 01

Negating the output is confused with negating the argument.

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

ROOT CAUSE

Negating the output is confused with negating the argument.

THE FAILURE

Negating the output is confused with negating the argument.

Unsuccessful approach: Reversing coefficients changes degree placement rather than argument sign.

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 compose negative argument. Exact operational definition: [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 [-c for c in 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],)), [1, -2, 3])
check('fixture 2: ([5],)', solve(*([5],)), [5])
check('fixture 3: ([0, 1, 0, -2],)', solve(*([0, 1, 0, -2],)), [0, -1, 0, 2])
check('fixture 4: ([],)', solve(*([],)), [])
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],)[-1, -2, -3][1, -2, 3]Failed
fixture 2: ([5],)[-5][5]Failed
fixture 3: ([0, 1, 0, -2],)[0, -1, 0, 2][0, -1, 0, 2]Passed
fixture 4: ([],)[][]Passed

SHA-256 / df16d4b705e2d9764c2e2cb01f2d73c78e93c402fd8bef8fd719597c2fedd15a

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 list(reversed(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],)), [1, -2, 3])
check('fixture 2: ([5],)', solve(*([5],)), [5])
check('fixture 3: ([0, 1, 0, -2],)', solve(*([0, 1, 0, -2],)), [0, -1, 0, 2])
check('fixture 4: ([],)', solve(*([],)), [])
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],)[3, 2, 1][1, -2, 3]Failed
fixture 2: ([5],)[5][5]Passed
fixture 3: ([0, 1, 0, -2],)[-2, 0, 1, 0][0, -1, 0, 2]Failed
fixture 4: ([],)[][]Passed

SHA-256 / d50f06fc9c27eff598c75620abb139eafffeca40ab07ca94cdac227fd54c94c0

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 4 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

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

Case digest / 8c64b4a40fa42fc968a36fe190e9d2371f8b23c34d070b86ff9bf9575f73f574