{"abstract":"Complex square root overflows before halving its radius sum.","category":"Floating-point arithmetic","checks":10,"contract":"Principal complex square root for finite components, using stable branch reconstruction and preserving the imaginary signed-zero side of the negative real branch cut. Fixtures keep hypot finite. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.","contract_signature":"x,y","evaluation_group":"s3-float-complex-sqrt","failed_approach":"The attempted local correction t=math.sqrt(min(r+abs(x),1e308)/2) still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-complex-sqrt-half-before-add","id":"FA-16436","implementations":{"attempt":{"sha256":"11543851a74f0ca0540d9fc20d7d8ee09f67a6cf0ac72929e6964a6b6bf048cd","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(x,y):\n    try:\n        if x==0 and y==0: return ['0',render(y)]\n        r=math.hypot(x,y)\n        t=math.sqrt(min(r+abs(x),1e308)/2)\n        if x>=0:\n            real=t\n            imag=y/(2*t)\n        else:\n            imag=math.copysign(t,y)\n            real=abs(y)/(2*t)\n        return [render(real),render(imag)]\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('positive axis', solve(float(N*N),0.0), [render(float(N)),\"0\"])\ncheck('negative axis above', solve(-float(N*N),0.0), [\"0\",render(float(N))])\ncheck('negative axis below', solve(-float(N*N),-0.0), [\"0\",render(-float(N))])\ncheck('upper quadrant', solve(3.0,4.0), [\"2\",\"1\"])\ncheck('lower quadrant', solve(3.0,-4.0), [\"2\",\"-1\"])\ncheck('negative real quadrant', solve(-3.0,4.0), [\"1\",\"2\"])\ncheck('huge axis', solve(1e308,0.0), [\"1e+154\",\"0\"])\ncheck('tiny imaginary', solve(4.0,N*1e-200), [\"2\",render(N*1e-200/4)])\ncheck('origin above', solve(0.0,0.0), [\"0\",\"0\"])\ncheck('origin below', solve(0.0,-0.0), [\"0\",\"-0\"])\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":"f4627db1bf8f8fc095faa6a9b09bb58d6136301060903da0063bdbd9d92f4fc8","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(x,y):\n    try:\n        if x==0 and y==0: return ['0',render(y)]\n        r=math.hypot(x,y)\n        t=math.sqrt((r+abs(x))/2)\n        if x>=0:\n            real=t\n            imag=y/(2*t)\n        else:\n            imag=math.copysign(t,y)\n            real=abs(y)/(2*t)\n        return [render(real),render(imag)]\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('positive axis', solve(float(N*N),0.0), [render(float(N)),\"0\"])\ncheck('negative axis above', solve(-float(N*N),0.0), [\"0\",render(float(N))])\ncheck('negative axis below', solve(-float(N*N),-0.0), [\"0\",render(-float(N))])\ncheck('upper quadrant', solve(3.0,4.0), [\"2\",\"1\"])\ncheck('lower quadrant', solve(3.0,-4.0), [\"2\",\"-1\"])\ncheck('negative real quadrant', solve(-3.0,4.0), [\"1\",\"2\"])\ncheck('huge axis', solve(1e308,0.0), [\"1e+154\",\"0\"])\ncheck('tiny imaginary', solve(4.0,N*1e-200), [\"2\",render(N*1e-200/4)])\ncheck('origin above', solve(0.0,0.0), [\"0\",\"0\"])\ncheck('origin below', solve(0.0,-0.0), [\"0\",\"-0\"])\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-complex-sqrt-half-before-add","generated_at":"2026-09-29T14:39:36.686385+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":"Complex square root overflows before halving its radius sum. The faulty expression is t=math.sqrt((r+abs(x))/2).","sha256":"039e73e2e171b79eecb0ca0527e31b6fb460a8f0f692f0e00bc88118ef860e23","title":"Complex square root overflows before halving its radius sum · 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":40.828,"exit_code":1,"observations":[{"actual":["1","0"],"check":"positive axis","expected":["1","0"],"passed":true},{"actual":["0","1"],"check":"negative axis above","expected":["0","1"],"passed":true},{"actual":["0","-1"],"check":"negative axis below","expected":["0","-1"],"passed":true},{"actual":["2","1"],"check":"upper quadrant","expected":["2","1"],"passed":true},{"actual":["2","-1"],"check":"lower quadrant","expected":["2","-1"],"passed":true},{"actual":["1","2"],"check":"negative real quadrant","expected":["1","2"],"passed":true},{"actual":["7.0710678119e+153","0"],"check":"huge axis","expected":["1e+154","0"],"passed":false},{"actual":["2","2.5e-201"],"check":"tiny imaginary","expected":["2","2.5e-201"],"passed":true},{"actual":["0","0"],"check":"origin above","expected":["0","0"],"passed":true},{"actual":["0","-0"],"check":"origin below","expected":["0","-0"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"positive axis\", \"actual\": [\"1\", \"0\"], \"expected\": [\"1\", \"0\"], \"passed\": true}, {\"check\": \"negative axis above\", \"actual\": [\"0\", \"1\"], \"expected\": [\"0\", \"1\"], \"passed\": true}, {\"check\": \"negative axis below\", \"actual\": [\"0\", \"-1\"], \"expected\": [\"0\", \"-1\"], \"passed\": true}, {\"check\": \"upper quadrant\", \"actual\": [\"2\", \"1\"], \"expected\": [\"2\", \"1\"], \"passed\": true}, {\"check\": \"lower quadrant\", \"actual\": [\"2\", \"-1\"], \"expected\": [\"2\", \"-1\"], \"passed\": true}, {\"check\": \"negative real quadrant\", \"actual\": [\"1\", \"2\"], \"expected\": [\"1\", \"2\"], \"passed\": true}, {\"check\": \"huge axis\", \"actual\": [\"7.0710678119e+153\", \"0\"], \"expected\": [\"1e+154\", \"0\"], \"passed\": false}, {\"check\": \"tiny imaginary\", \"actual\": [\"2\", \"2.5e-201\"], \"expected\": [\"2\", \"2.5e-201\"], \"passed\": true}, {\"check\": \"origin above\", \"actual\": [\"0\", \"0\"], \"expected\": [\"0\", \"0\"], \"passed\": true}, {\"check\": \"origin below\", \"actual\": [\"0\", \"-0\"], \"expected\": [\"0\", \"-0\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.929,"exit_code":1,"observations":[{"actual":["1","0"],"check":"positive axis","expected":["1","0"],"passed":true},{"actual":["0","1"],"check":"negative axis above","expected":["0","1"],"passed":true},{"actual":["0","-1"],"check":"negative axis below","expected":["0","-1"],"passed":true},{"actual":["2","1"],"check":"upper quadrant","expected":["2","1"],"passed":true},{"actual":["2","-1"],"check":"lower quadrant","expected":["2","-1"],"passed":true},{"actual":["1","2"],"check":"negative real quadrant","expected":["1","2"],"passed":true},{"actual":["+infinity","0"],"check":"huge axis","expected":["1e+154","0"],"passed":false},{"actual":["2","2.5e-201"],"check":"tiny imaginary","expected":["2","2.5e-201"],"passed":true},{"actual":["0","0"],"check":"origin above","expected":["0","0"],"passed":true},{"actual":["0","-0"],"check":"origin below","expected":["0","-0"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"positive axis\", \"actual\": [\"1\", \"0\"], \"expected\": [\"1\", \"0\"], \"passed\": true}, {\"check\": \"negative axis above\", \"actual\": [\"0\", \"1\"], \"expected\": [\"0\", \"1\"], \"passed\": true}, {\"check\": \"negative axis below\", \"actual\": [\"0\", \"-1\"], \"expected\": [\"0\", \"-1\"], \"passed\": true}, {\"check\": \"upper quadrant\", \"actual\": [\"2\", \"1\"], \"expected\": [\"2\", \"1\"], \"passed\": true}, {\"check\": \"lower quadrant\", \"actual\": [\"2\", \"-1\"], \"expected\": [\"2\", \"-1\"], \"passed\": true}, {\"check\": \"negative real quadrant\", \"actual\": [\"1\", \"2\"], \"expected\": [\"1\", \"2\"], \"passed\": true}, {\"check\": \"huge axis\", \"actual\": [\"+infinity\", \"0\"], \"expected\": [\"1e+154\", \"0\"], \"passed\": false}, {\"check\": \"tiny imaginary\", \"actual\": [\"2\", \"2.5e-201\"], \"expected\": [\"2\", \"2.5e-201\"], \"passed\": true}, {\"check\": \"origin above\", \"actual\": [\"0\", \"0\"], \"expected\": [\"0\", \"0\"], \"passed\": true}, {\"check\": \"origin below\", \"actual\": [\"0\", \"-0\"], \"expected\": [\"0\", \"-0\"], \"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."}}