{"abstract":"Scaled square root applies the full exponent to its root.","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 return render(math.ldexp(root,-q)) still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-sqrt-scaled-root-rescale","id":"FA-17216","implementations":{"attempt":{"sha256":"c42faf4c793b79cfc83c53033be2c769abd1cf7272f174195321381044887d49","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=divmod(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":"f506676e46b4c060f7aa61e44dff3f008e3f7e352d206723a440c4e222bfa8e5","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=divmod(e,2)\n        root=math.sqrt(math.ldexp(m,r))\n        return render(math.ldexp(root,e))\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-root-rescale","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 applies the full exponent to its root. The faulty expression is return render(math.ldexp(root,e)).","sha256":"f33ea239f7dc6168260f239fdadfab662c08bf2c13bccd2147374d2ce7e4873d","title":"Scaled square root applies the full exponent to its root · 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":41.974,"exit_code":1,"observations":[{"actual":"1","check":"square","expected":"1","passed":true},{"actual":"1","check":"normal","expected":"1","passed":true},{"actual":"1.4932217896e-150","check":"huge","expected":"1e+150","passed":false},{"actual":"6.6969287949e+149","check":"tiny","expected":"1e-150","passed":false},{"actual":"0.35355339059","check":"odd exponent","expected":"1.4142135624","passed":false},{"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.4989137945e+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\": \"1.4932217896e-150\", \"expected\": \"1e+150\", \"passed\": false}, {\"check\": \"tiny\", \"actual\": \"6.6969287949e+149\", \"expected\": \"1e-150\", \"passed\": false}, {\"check\": \"odd exponent\", \"actual\": \"0.35355339059\", \"expected\": \"1.4142135624\", \"passed\": false}, {\"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.4989137945e+161\", \"expected\": \"2.2227587495e-162\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.721,"exit_code":1,"observations":[{"actual":"2","check":"square","expected":"1","passed":false},{"actual":"2","check":"normal","expected":"1","passed":false},{"actual":"1.6366953039e+300","check":"huge","expected":"1e+150","passed":false},{"actual":"1.2219745454e-300","check":"tiny","expected":"1e-150","passed":false},{"actual":"2.8284271247","check":"odd exponent","expected":"1.4142135624","passed":false},{"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":"9.8813129168e-324","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\": \"1.6366953039e+300\", \"expected\": \"1e+150\", \"passed\": false}, {\"check\": \"tiny\", \"actual\": \"1.2219745454e-300\", \"expected\": \"1e-150\", \"passed\": false}, {\"check\": \"odd exponent\", \"actual\": \"2.8284271247\", \"expected\": \"1.4142135624\", \"passed\": false}, {\"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\": \"9.8813129168e-324\", \"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."}}