{"abstract":"Decimal fused multiply-add rounds inputs to working precision.","category":"Floating-point arithmetic","checks":7,"contract":"Decimal fused multiply-add rounds a*b+c once in a fresh precision-limited half-even context. Inputs are decimal strings; return final decimal string and Inexact flag.","contract_signature":"a,b,c,precision","evaluation_group":"s3-float-decimal-fma","failed_approach":"The attempted local correction av=Decimal(a); bv=Decimal(b); cv=ctx.create_decimal(c) still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-decimal-fma-input-rounding","id":"FA-16931","implementations":{"attempt":{"sha256":"b9e70590f9481e2a03b8751880e896101fccd0d46a63776f2036bf106e77135c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport decimal\nfrom decimal import Decimal, Context, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_DOWN\n\nN = 1\nobservations = []\ndef solve(a,b,c,precision):\n    ctx=Context(prec=precision,rounding=ROUND_HALF_EVEN)\n    for signal in ctx.traps: ctx.traps[signal]=False\n    av=Decimal(a); bv=Decimal(b); cv=ctx.create_decimal(c)\n    result=ctx.fma(av,bv,cv)\n    return [str(result),ctx.flags[decimal.Inexact]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('cancellation', solve(\"1.23\",\"4.56\",\"-5.61\",3), [\"-0.0012\",False])\ncheck('opposite cancellation', solve(\"-1.23\",\"4.56\",\"5.61\",3), [\"0.0012\",False])\ncheck('tiny addend', solve(\"1\",\"1\",\"0.005\",3), [\"1.00\",True])\ncheck('odd tie', solve(\"1\",\"1\",\"0.015\",3), [\"1.02\",True])\ncheck('variable exact', solve(str(N),\"2\",\"3\",3), [str(2*N+3),False])\ncheck('addend precision', solve(\"1.23456\",\"1\",\"-1.23455\",3), [\"0.00001\",False])\ncheck('operand precision', solve(\"1.23456\",\"1\",\"0\",3), [\"1.23\",True])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"a54a4ec73c9535e8fc708a0594e910966b66e738219c35c790f2cb1e1fa2b220","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport decimal\nfrom decimal import Decimal, Context, ROUND_HALF_EVEN, ROUND_HALF_UP, ROUND_DOWN\n\nN = 1\nobservations = []\ndef solve(a,b,c,precision):\n    ctx=Context(prec=precision,rounding=ROUND_HALF_EVEN)\n    for signal in ctx.traps: ctx.traps[signal]=False\n    av=ctx.create_decimal(a); bv=ctx.create_decimal(b); cv=ctx.create_decimal(c)\n    result=ctx.fma(av,bv,cv)\n    return [str(result),ctx.flags[decimal.Inexact]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('cancellation', solve(\"1.23\",\"4.56\",\"-5.61\",3), [\"-0.0012\",False])\ncheck('opposite cancellation', solve(\"-1.23\",\"4.56\",\"5.61\",3), [\"0.0012\",False])\ncheck('tiny addend', solve(\"1\",\"1\",\"0.005\",3), [\"1.00\",True])\ncheck('odd tie', solve(\"1\",\"1\",\"0.015\",3), [\"1.02\",True])\ncheck('variable exact', solve(str(N),\"2\",\"3\",3), [str(2*N+3),False])\ncheck('addend precision', solve(\"1.23456\",\"1\",\"-1.23455\",3), [\"0.00001\",False])\ncheck('operand precision', solve(\"1.23456\",\"1\",\"0\",3), [\"1.23\",True])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"Controlled binary64 or explicitly stipulated miniature format; no hardware exception flags or platform floating environment are modeled. 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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"s3-floating_point_arithmetic-decimal-fma-input-rounding","generated_at":"2026-09-29T14:39:41.621633+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"An offline floating representation model isolates a reproducible arithmetic fault.","root_cause":"Decimal fused multiply-add rounds inputs to working precision. The faulty expression is av=ctx.create_decimal(a); bv=ctx.create_decimal(b); cv=ctx.create_decimal(c).","sha256":"ae7c09f0c7a589033d6af55712fd047edcf2aad1f2e4388eaf3cad7d3d297dab","title":"Decimal fused multiply-add rounds inputs to working precision · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":43.234,"exit_code":1,"observations":[{"actual":["-0.0012",false],"check":"cancellation","expected":["-0.0012",false],"passed":true},{"actual":["0.0012",false],"check":"opposite cancellation","expected":["0.0012",false],"passed":true},{"actual":["1.00",true],"check":"tiny addend","expected":["1.00",true],"passed":true},{"actual":["1.02",true],"check":"odd tie","expected":["1.02",true],"passed":true},{"actual":["5",false],"check":"variable exact","expected":["5",false],"passed":true},{"actual":["0.00456",true],"check":"addend precision","expected":["0.00001",false],"passed":false},{"actual":["1.23",true],"check":"operand precision","expected":["1.23",true],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"cancellation\", \"actual\": [\"-0.0012\", false], \"expected\": [\"-0.0012\", false], \"passed\": true}, {\"check\": \"opposite cancellation\", \"actual\": [\"0.0012\", false], \"expected\": [\"0.0012\", false], \"passed\": true}, {\"check\": \"tiny addend\", \"actual\": [\"1.00\", true], \"expected\": [\"1.00\", true], \"passed\": true}, {\"check\": \"odd tie\", \"actual\": [\"1.02\", true], \"expected\": [\"1.02\", true], \"passed\": true}, {\"check\": \"variable exact\", \"actual\": [\"5\", false], \"expected\": [\"5\", false], \"passed\": true}, {\"check\": \"addend precision\", \"actual\": [\"0.00456\", true], \"expected\": [\"0.00001\", false], \"passed\": false}, {\"check\": \"operand precision\", \"actual\": [\"1.23\", true], \"expected\": [\"1.23\", true], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.393,"exit_code":1,"observations":[{"actual":["-0.0012",false],"check":"cancellation","expected":["-0.0012",false],"passed":true},{"actual":["0.0012",false],"check":"opposite cancellation","expected":["0.0012",false],"passed":true},{"actual":["1.00",true],"check":"tiny addend","expected":["1.00",true],"passed":true},{"actual":["1.02",true],"check":"odd tie","expected":["1.02",true],"passed":true},{"actual":["5",false],"check":"variable exact","expected":["5",false],"passed":true},{"actual":["0.00",true],"check":"addend precision","expected":["0.00001",false],"passed":false},{"actual":["1.23",true],"check":"operand precision","expected":["1.23",true],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"cancellation\", \"actual\": [\"-0.0012\", false], \"expected\": [\"-0.0012\", false], \"passed\": true}, {\"check\": \"opposite cancellation\", \"actual\": [\"0.0012\", false], \"expected\": [\"0.0012\", false], \"passed\": true}, {\"check\": \"tiny addend\", \"actual\": [\"1.00\", true], \"expected\": [\"1.00\", true], \"passed\": true}, {\"check\": \"odd tie\", \"actual\": [\"1.02\", true], \"expected\": [\"1.02\", true], \"passed\": true}, {\"check\": \"variable exact\", \"actual\": [\"5\", false], \"expected\": [\"5\", false], \"passed\": true}, {\"check\": \"addend precision\", \"actual\": [\"0.00\", true], \"expected\": [\"0.00001\", false], \"passed\": false}, {\"check\": \"operand precision\", \"actual\": [\"1.23\", true], \"expected\": [\"1.23\", true], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}