{"abstract":"Repeated quadratic root loses the factor of two.","category":"Floating-point arithmetic","checks":9,"contract":"Real roots of a*x*x+b*x+c=0 for finite coefficients with bounded discriminant products. Use sign-aware q to avoid subtractive cancellation and c/q for the complementary root. Return sorted rendered roots, repeated root once, or explicit degenerate/no-real markers. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.","evaluation_group":"s3-float-quadratic-roots","failed_approach":"The attempted local correction if d==0: return [render(b/(2*a))] still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-quadratic-roots-repeated-root","id":"FA-16736","implementations":{"attempt":{"sha256":"080b4cf5a331bc28bb2f224d00adc44dca64d6001c6bbc00b7ecfb166a6bbb2c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\ndef render(x):\n    if math.isnan(x): return 'nan'\n    if math.isinf(x): return '-infinity' if x<0 else '+infinity'\n    return format(x,'.11g')\n\nN = 1\nobservations = []\ndef solve(a,b,c):\n    try:\n        if a==0:\n            return [render(-c/b)] if b!=0 else ('all' if c==0 else 'none')\n        d=b*b-4*a*c\n        if d<0: return 'no-real'\n        if d==0: return [render(b/(2*a))]\n        s=math.sqrt(d)\n        q=-0.5*(b+math.copysign(s,b))\n        r1=q/a\n        r2=c/q\n        return [render(v) for v in sorted([r1,r2])]\n    except (ValueError, OverflowError, ZeroDivisionError, TypeError):\n        return \"arithmetic-error\"\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('large positive b', solve(1.0,1e16*N,1.0), [render(-1e16*N),render(-1/(1e16*N))])\ncheck('large negative b', solve(1.0,-1e16*N,1.0), [render(1/(1e16*N)),render(1e16*N)])\ncheck('normal roots', solve(1.0,-3.0,2.0), [\"1\",\"2\"])\ncheck('repeated', solve(1.0,-2.0*N,float(N*N)), [render(float(N))])\ncheck('linear', solve(0.0,2.0,-2.0*N), [render(float(N))])\ncheck('no real', solve(1.0,0.0,float(N)), \"no-real\")\ncheck('all', solve(0.0,0.0,0.0), \"all\")\ncheck('inconsistent', solve(0.0,0.0,float(N)), \"none\")\ncheck('zero constant', solve(1.0,-float(N),0.0), [\"0\",render(float(N))])\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":"cb9c2c6217138a3c1b4e69b81966fbea240678047bc877204434647342c0ef3c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\ndef render(x):\n    if math.isnan(x): return 'nan'\n    if math.isinf(x): return '-infinity' if x<0 else '+infinity'\n    return format(x,'.11g')\n\nN = 1\nobservations = []\ndef solve(a,b,c):\n    try:\n        if a==0:\n            return [render(-c/b)] if b!=0 else ('all' if c==0 else 'none')\n        d=b*b-4*a*c\n        if d<0: return 'no-real'\n        if d==0: return [render(-b/a)]\n        s=math.sqrt(d)\n        q=-0.5*(b+math.copysign(s,b))\n        r1=q/a\n        r2=c/q\n        return [render(v) for v in sorted([r1,r2])]\n    except (ValueError, OverflowError, ZeroDivisionError, TypeError):\n        return \"arithmetic-error\"\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('large positive b', solve(1.0,1e16*N,1.0), [render(-1e16*N),render(-1/(1e16*N))])\ncheck('large negative b', solve(1.0,-1e16*N,1.0), [render(1/(1e16*N)),render(1e16*N)])\ncheck('normal roots', solve(1.0,-3.0,2.0), [\"1\",\"2\"])\ncheck('repeated', solve(1.0,-2.0*N,float(N*N)), [render(float(N))])\ncheck('linear', solve(0.0,2.0,-2.0*N), [render(float(N))])\ncheck('no real', solve(1.0,0.0,float(N)), \"no-real\")\ncheck('all', solve(0.0,0.0,0.0), \"all\")\ncheck('inconsistent', solve(0.0,0.0,float(N)), \"none\")\ncheck('zero constant', solve(1.0,-float(N),0.0), [\"0\",render(float(N))])\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"},"fixed":{"sha256":"c821538eaac37cd1b9ec3c4973814f85efffa66e5c2360a75d333aa28d2ff975","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\ndef render(x):\n    if math.isnan(x): return 'nan'\n    if math.isinf(x): return '-infinity' if x<0 else '+infinity'\n    return format(x,'.11g')\n\nN = 1\nobservations = []\ndef solve(a,b,c):\n    try:\n        if a==0:\n            return [render(-c/b)] if b!=0 else ('all' if c==0 else 'none')\n        d=b*b-4*a*c\n        if d<0: return 'no-real'\n        if d==0: return [render(-b/(2*a))]\n        s=math.sqrt(d)\n        q=-0.5*(b+math.copysign(s,b))\n        r1=q/a\n        r2=c/q\n        return [render(v) for v in sorted([r1,r2])]\n    except (ValueError, OverflowError, ZeroDivisionError, TypeError):\n        return \"arithmetic-error\"\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('large positive b', solve(1.0,1e16*N,1.0), [render(-1e16*N),render(-1/(1e16*N))])\ncheck('large negative b', solve(1.0,-1e16*N,1.0), [render(1/(1e16*N)),render(1e16*N)])\ncheck('normal roots', solve(1.0,-3.0,2.0), [\"1\",\"2\"])\ncheck('repeated', solve(1.0,-2.0*N,float(N*N)), [render(float(N))])\ncheck('linear', solve(0.0,2.0,-2.0*N), [render(float(N))])\ncheck('no real', solve(1.0,0.0,float(N)), \"no-real\")\ncheck('all', solve(0.0,0.0,0.0), \"all\")\ncheck('inconsistent', solve(0.0,0.0,float(N)), \"none\")\ncheck('zero constant', solve(1.0,-float(N),0.0), [\"0\",render(float(N))])\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-quadratic-roots-repeated-root","generated_at":"2026-09-29T14:39:39.388556+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.","repair":"Apply the contract at this fault site using if d==0: return [render(-b/(2*a))].","root_cause":"Repeated quadratic root loses the factor of two. The faulty expression is if d==0: return [render(-b/a)].","sha256":"ef8f8188d15bbee7a8b7e53e8dfafc2a8f1db00e7e96b26b41d7e3a4daae9532","title":"Repeated quadratic root loses the factor of two · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":53.527,"exit_code":1,"observations":[{"actual":["-1e+16","-1e-16"],"check":"large positive b","expected":["-1e+16","-1e-16"],"passed":true},{"actual":["1e-16","1e+16"],"check":"large negative b","expected":["1e-16","1e+16"],"passed":true},{"actual":["1","2"],"check":"normal roots","expected":["1","2"],"passed":true},{"actual":["-1"],"check":"repeated","expected":["1"],"passed":false},{"actual":["1"],"check":"linear","expected":["1"],"passed":true},{"actual":"no-real","check":"no real","expected":"no-real","passed":true},{"actual":"all","check":"all","expected":"all","passed":true},{"actual":"none","check":"inconsistent","expected":"none","passed":true},{"actual":["0","1"],"check":"zero constant","expected":["0","1"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"large positive b\", \"actual\": [\"-1e+16\", \"-1e-16\"], \"expected\": [\"-1e+16\", \"-1e-16\"], \"passed\": true}, {\"check\": \"large negative b\", \"actual\": [\"1e-16\", \"1e+16\"], \"expected\": [\"1e-16\", \"1e+16\"], \"passed\": true}, {\"check\": \"normal roots\", \"actual\": [\"1\", \"2\"], \"expected\": [\"1\", \"2\"], \"passed\": true}, {\"check\": \"repeated\", \"actual\": [\"-1\"], \"expected\": [\"1\"], \"passed\": false}, {\"check\": \"linear\", \"actual\": [\"1\"], \"expected\": [\"1\"], \"passed\": true}, {\"check\": \"no real\", \"actual\": \"no-real\", \"expected\": \"no-real\", \"passed\": true}, {\"check\": \"all\", \"actual\": \"all\", \"expected\": \"all\", \"passed\": true}, {\"check\": \"inconsistent\", \"actual\": \"none\", \"expected\": \"none\", \"passed\": true}, {\"check\": \"zero constant\", \"actual\": [\"0\", \"1\"], \"expected\": [\"0\", \"1\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":44.868,"exit_code":1,"observations":[{"actual":["-1e+16","-1e-16"],"check":"large positive b","expected":["-1e+16","-1e-16"],"passed":true},{"actual":["1e-16","1e+16"],"check":"large negative b","expected":["1e-16","1e+16"],"passed":true},{"actual":["1","2"],"check":"normal roots","expected":["1","2"],"passed":true},{"actual":["2"],"check":"repeated","expected":["1"],"passed":false},{"actual":["1"],"check":"linear","expected":["1"],"passed":true},{"actual":"no-real","check":"no real","expected":"no-real","passed":true},{"actual":"all","check":"all","expected":"all","passed":true},{"actual":"none","check":"inconsistent","expected":"none","passed":true},{"actual":["0","1"],"check":"zero constant","expected":["0","1"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"large positive b\", \"actual\": [\"-1e+16\", \"-1e-16\"], \"expected\": [\"-1e+16\", \"-1e-16\"], \"passed\": true}, {\"check\": \"large negative b\", \"actual\": [\"1e-16\", \"1e+16\"], \"expected\": [\"1e-16\", \"1e+16\"], \"passed\": true}, {\"check\": \"normal roots\", \"actual\": [\"1\", \"2\"], \"expected\": [\"1\", \"2\"], \"passed\": true}, {\"check\": \"repeated\", \"actual\": [\"2\"], \"expected\": [\"1\"], \"passed\": false}, {\"check\": \"linear\", \"actual\": [\"1\"], \"expected\": [\"1\"], \"passed\": true}, {\"check\": \"no real\", \"actual\": \"no-real\", \"expected\": \"no-real\", \"passed\": true}, {\"check\": \"all\", \"actual\": \"all\", \"expected\": \"all\", \"passed\": true}, {\"check\": \"inconsistent\", \"actual\": \"none\", \"expected\": \"none\", \"passed\": true}, {\"check\": \"zero constant\", \"actual\": [\"0\", \"1\"], \"expected\": [\"0\", \"1\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":71.357,"exit_code":0,"observations":[{"actual":["-1e+16","-1e-16"],"check":"large positive b","expected":["-1e+16","-1e-16"],"passed":true},{"actual":["1e-16","1e+16"],"check":"large negative b","expected":["1e-16","1e+16"],"passed":true},{"actual":["1","2"],"check":"normal roots","expected":["1","2"],"passed":true},{"actual":["1"],"check":"repeated","expected":["1"],"passed":true},{"actual":["1"],"check":"linear","expected":["1"],"passed":true},{"actual":"no-real","check":"no real","expected":"no-real","passed":true},{"actual":"all","check":"all","expected":"all","passed":true},{"actual":"none","check":"inconsistent","expected":"none","passed":true},{"actual":["0","1"],"check":"zero constant","expected":["0","1"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"large positive b\", \"actual\": [\"-1e+16\", \"-1e-16\"], \"expected\": [\"-1e+16\", \"-1e-16\"], \"passed\": true}, {\"check\": \"large negative b\", \"actual\": [\"1e-16\", \"1e+16\"], \"expected\": [\"1e-16\", \"1e+16\"], \"passed\": true}, {\"check\": \"normal roots\", \"actual\": [\"1\", \"2\"], \"expected\": [\"1\", \"2\"], \"passed\": true}, {\"check\": \"repeated\", \"actual\": [\"1\"], \"expected\": [\"1\"], \"passed\": true}, {\"check\": \"linear\", \"actual\": [\"1\"], \"expected\": [\"1\"], \"passed\": true}, {\"check\": \"no real\", \"actual\": \"no-real\", \"expected\": \"no-real\", \"passed\": true}, {\"check\": \"all\", \"actual\": \"all\", \"expected\": \"all\", \"passed\": true}, {\"check\": \"inconsistent\", \"actual\": \"none\", \"expected\": \"none\", \"passed\": true}, {\"check\": \"zero constant\", \"actual\": [\"0\", \"1\"], \"expected\": [\"0\", \"1\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}