FAILURE MAP
← Case archive

FA-6131 / Polynomial arithmetic / Open access

Quadratic discriminant · case 01

The product term uses addition instead of subtraction.

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

ROOT CAUSE

The product term uses addition instead of subtraction.

VERIFIED REPAIR

Apply the specified mathematical contract directly, preserving all terms and boundary cases: return b*b-4*a*c

Unsuccessful approach: The discriminant coefficient loses a factor of two.

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. Quadratic discriminant. Exact operational definition: b*b-4*a*c

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(a, b, c):
    return b*b+4*a*c
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (1, 0, -1)', solve(*(1, 0, -1)), 4)
check('fixture 2: (1, 2, 1)', solve(*(1, 2, 1)), 0)
check('fixture 3: (1, 0, 1)', solve(*(1, 0, 1)), -4)
check('fixture 4: (2, 3, 1)', solve(*(2, 3, 1)), 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: (1, 0, -1)-44Failed
fixture 2: (1, 2, 1)80Failed
fixture 3: (1, 0, 1)4-4Failed
fixture 4: (2, 3, 1)171Failed

SHA-256 / fa0b46ec5a9ad30762a1432867142e8ffc87d27d23ae1b2747e76962976b20fd

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(a, b, c):
    return b*b-2*a*c
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (1, 0, -1)', solve(*(1, 0, -1)), 4)
check('fixture 2: (1, 2, 1)', solve(*(1, 2, 1)), 0)
check('fixture 3: (1, 0, 1)', solve(*(1, 0, 1)), -4)
check('fixture 4: (2, 3, 1)', solve(*(2, 3, 1)), 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: (1, 0, -1)24Failed
fixture 2: (1, 2, 1)20Failed
fixture 3: (1, 0, 1)-2-4Failed
fixture 4: (2, 3, 1)51Failed

SHA-256 / 5f3f5086a1bf776c66b877789040d7da1271e5119385e8dc8897716edd2ed652

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(a, b, c):
    return b*b-4*a*c
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1: (1, 0, -1)', solve(*(1, 0, -1)), 4)
check('fixture 2: (1, 2, 1)', solve(*(1, 2, 1)), 0)
check('fixture 3: (1, 0, 1)', solve(*(1, 0, 1)), -4)
check('fixture 4: (2, 3, 1)', solve(*(2, 3, 1)), 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: (1, 0, -1)44Passed
fixture 2: (1, 2, 1)00Passed
fixture 3: (1, 0, 1)-4-4Passed
fixture 4: (2, 3, 1)11Passed

SHA-256 / b82c92d8abde7c06560e5b5f01a342359cc790ff6fa249223a66e1f4678b06da

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

Case digest / 5a879ce37448883f9830dd3fda058af45507fd5c1b4d6970712a1899881667c0