{"abstract":"Scaled square root rounds the exponent quotient upward.","category":"Floating-point arithmetic","checks":9,"contract":"Nonnegative square root of finite binary64 x via exponent normalization. Negative input returns domain; negative zero is preserved. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.","contract_signature":"x","evaluation_group":"s3-float-sqrt-scaled","failed_approach":"The attempted local correction q,r=abs(e)//2,e%2 still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-sqrt-scaled-exponent-ceiling","id":"FA-17231","implementations":{"attempt":{"sha256":"597c822b568b0678cc44d4f74875b003ed9ff63b7fe5c72bfbe16595ce428709","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):\n    try:\n        if x<0: return 'domain'\n        if x==0: return render(x)\n        m,e=math.frexp(x)\n        q,r=abs(e)//2,e%2\n        root=math.sqrt(math.ldexp(m,r))\n        return render(math.ldexp(root,q))\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('square', solve(float(N*N)), render(float(N)))\ncheck('normal', solve(float(N)), render(math.sqrt(N)))\ncheck('huge', solve(1e300), \"1e+150\")\ncheck('tiny', solve(1e-300), \"1e-150\")\ncheck('odd exponent', solve(2.0), render(math.sqrt(2)))\ncheck('positive root zero', solve(0.0), \"0\")\ncheck('negative domain', solve(-float(N)), \"domain\")\ncheck('negative zero', solve(-0.0), \"-0\")\ncheck('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-537)))\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":"f4f16258cd54f05dc6ca40c5fb625bcef67af19a573c192531cc5dff53b88423","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):\n    try:\n        if x<0: return 'domain'\n        if x==0: return render(x)\n        m,e=math.frexp(x)\n        q,r=(e+1)//2,e%2\n        root=math.sqrt(math.ldexp(m,r))\n        return render(math.ldexp(root,q))\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('square', solve(float(N*N)), render(float(N)))\ncheck('normal', solve(float(N)), render(math.sqrt(N)))\ncheck('huge', solve(1e300), \"1e+150\")\ncheck('tiny', solve(1e-300), \"1e-150\")\ncheck('odd exponent', solve(2.0), render(math.sqrt(2)))\ncheck('positive root zero', solve(0.0), \"0\")\ncheck('negative domain', solve(-float(N)), \"domain\")\ncheck('negative zero', solve(-0.0), \"-0\")\ncheck('subnormal', solve(math.ldexp(1.0,-1074)), render(math.ldexp(1.0,-537)))\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-sqrt-scaled-exponent-ceiling","generated_at":"2026-09-29T14:39:44.363901+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":"Scaled square root rounds the exponent quotient upward. The faulty expression is q,r=(e+1)//2,e%2.","sha256":"93bea3b33298690d26ba8254e3dc5047c9a7507c2f213b6f69ea88f1646ade73","title":"Scaled square root rounds the exponent quotient upward · 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.218,"exit_code":1,"observations":[{"actual":"1","check":"square","expected":"1","passed":true},{"actual":"1","check":"normal","expected":"1","passed":true},{"actual":"1e+150","check":"huge","expected":"1e+150","passed":true},{"actual":"6.6969287949e+149","check":"tiny","expected":"1e-150","passed":false},{"actual":"1.4142135624","check":"odd exponent","expected":"1.4142135624","passed":true},{"actual":"0","check":"positive root zero","expected":"0","passed":true},{"actual":"domain","check":"negative domain","expected":"domain","passed":true},{"actual":"-0","check":"negative zero","expected":"-0","passed":true},{"actual":"2.2494568973e+161","check":"subnormal","expected":"2.2227587495e-162","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"square\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"normal\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"huge\", \"actual\": \"1e+150\", \"expected\": \"1e+150\", \"passed\": true}, {\"check\": \"tiny\", \"actual\": \"6.6969287949e+149\", \"expected\": \"1e-150\", \"passed\": false}, {\"check\": \"odd exponent\", \"actual\": \"1.4142135624\", \"expected\": \"1.4142135624\", \"passed\": true}, {\"check\": \"positive root zero\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"negative domain\", \"actual\": \"domain\", \"expected\": \"domain\", \"passed\": true}, {\"check\": \"negative zero\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"subnormal\", \"actual\": \"2.2494568973e+161\", \"expected\": \"2.2227587495e-162\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.021,"exit_code":1,"observations":[{"actual":"2","check":"square","expected":"1","passed":false},{"actual":"2","check":"normal","expected":"1","passed":false},{"actual":"2e+150","check":"huge","expected":"1e+150","passed":false},{"actual":"1e-150","check":"tiny","expected":"1e-150","passed":true},{"actual":"1.4142135624","check":"odd exponent","expected":"1.4142135624","passed":true},{"actual":"0","check":"positive root zero","expected":"0","passed":true},{"actual":"domain","check":"negative domain","expected":"domain","passed":true},{"actual":"-0","check":"negative zero","expected":"-0","passed":true},{"actual":"4.445517499e-162","check":"subnormal","expected":"2.2227587495e-162","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"square\", \"actual\": \"2\", \"expected\": \"1\", \"passed\": false}, {\"check\": \"normal\", \"actual\": \"2\", \"expected\": \"1\", \"passed\": false}, {\"check\": \"huge\", \"actual\": \"2e+150\", \"expected\": \"1e+150\", \"passed\": false}, {\"check\": \"tiny\", \"actual\": \"1e-150\", \"expected\": \"1e-150\", \"passed\": true}, {\"check\": \"odd exponent\", \"actual\": \"1.4142135624\", \"expected\": \"1.4142135624\", \"passed\": true}, {\"check\": \"positive root zero\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"negative domain\", \"actual\": \"domain\", \"expected\": \"domain\", \"passed\": true}, {\"check\": \"negative zero\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"subnormal\", \"actual\": \"4.445517499e-162\", \"expected\": \"2.2227587495e-162\", \"passed\": false}], \"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."}}