{"abstract":"Exponent adjustment reverses the requested shift.","category":"Floating-point arithmetic","checks":10,"contract":"Recompose finite binary64 x after changing its exponent by integer shift. Return hex value, or signed overflow marker. Scaling preserves negative zero and gradual underflow. Inputs exclude NaN and infinity.","evaluation_group":"s3-float-frexp-recompose","failed_approach":"The attempted local correction target=shift still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-frexp-recompose-scale-direction","id":"FA-16051","implementations":{"attempt":{"sha256":"a7db3b74a350143f74bcf3ca7bd271a3b33a3489582394d7337762afccfe197d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\nN = 1\nobservations = []\ndef solve(x, shift):\n    if x == 0.0: return x.hex()\n    m,e=math.frexp(x)\n    target=shift\n    if target>1024: return '-overflow' if x<0 else '+overflow'\n    try:\n        result=math.ldexp(m,target)\n    except OverflowError:\n        return '-overflow' if x<0 else '+overflow'\n    return result.hex()\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('scale up', solve(1.5,N), math.ldexp(1.5,N).hex())\ncheck('scale down', solve(-1.5,-N), math.ldexp(-1.5,-N).hex())\ncheck('negative zero', solve(-0.0,N), '-0x0.0p+0')\ncheck('positive zero', solve(0.0,-N), '0x0.0p+0')\ncheck('subnormal input', solve(float.fromhex(\"0x0.0000000000001p-1022\"),N), math.ldexp(1.0,N-1074).hex())\ncheck('subnormal output', solve(float.fromhex(\"0x1p-1022\"),-N), math.ldexp(1.0,-1022-N).hex())\ncheck('max finite shift zero', solve(float.fromhex(\"0x1.fffffffffffffp+1023\"),0), '0x1.fffffffffffffp+1023')\ncheck('positive overflow', solve(float.fromhex(\"0x1p+1023\"),N), '+overflow')\ncheck('negative overflow', solve(-float.fromhex(\"0x1p+1023\"),N), '-overflow')\ncheck('negative underflow', solve(-float.fromhex(\"0x0.0000000000001p-1022\"),-N), '-0x0.0p+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":"3a97a0f662e6f1ef70cb25a396bc170927543872e2a17d2403624f2aa833bd2c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\nN = 1\nobservations = []\ndef solve(x, shift):\n    if x == 0.0: return x.hex()\n    m,e=math.frexp(x)\n    target=e-shift\n    if target>1024: return '-overflow' if x<0 else '+overflow'\n    try:\n        result=math.ldexp(m,target)\n    except OverflowError:\n        return '-overflow' if x<0 else '+overflow'\n    return result.hex()\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('scale up', solve(1.5,N), math.ldexp(1.5,N).hex())\ncheck('scale down', solve(-1.5,-N), math.ldexp(-1.5,-N).hex())\ncheck('negative zero', solve(-0.0,N), '-0x0.0p+0')\ncheck('positive zero', solve(0.0,-N), '0x0.0p+0')\ncheck('subnormal input', solve(float.fromhex(\"0x0.0000000000001p-1022\"),N), math.ldexp(1.0,N-1074).hex())\ncheck('subnormal output', solve(float.fromhex(\"0x1p-1022\"),-N), math.ldexp(1.0,-1022-N).hex())\ncheck('max finite shift zero', solve(float.fromhex(\"0x1.fffffffffffffp+1023\"),0), '0x1.fffffffffffffp+1023')\ncheck('positive overflow', solve(float.fromhex(\"0x1p+1023\"),N), '+overflow')\ncheck('negative overflow', solve(-float.fromhex(\"0x1p+1023\"),N), '-overflow')\ncheck('negative underflow', solve(-float.fromhex(\"0x0.0000000000001p-1022\"),-N), '-0x0.0p+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"},"fixed":{"sha256":"7e4c33c61df5712b8d12f73a8dd7e65f00dde45b83052690218cd8290e26865d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\nN = 1\nobservations = []\ndef solve(x, shift):\n    if x == 0.0: return x.hex()\n    m,e=math.frexp(x)\n    target=e+shift\n    if target>1024: return '-overflow' if x<0 else '+overflow'\n    try:\n        result=math.ldexp(m,target)\n    except OverflowError:\n        return '-overflow' if x<0 else '+overflow'\n    return result.hex()\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('scale up', solve(1.5,N), math.ldexp(1.5,N).hex())\ncheck('scale down', solve(-1.5,-N), math.ldexp(-1.5,-N).hex())\ncheck('negative zero', solve(-0.0,N), '-0x0.0p+0')\ncheck('positive zero', solve(0.0,-N), '0x0.0p+0')\ncheck('subnormal input', solve(float.fromhex(\"0x0.0000000000001p-1022\"),N), math.ldexp(1.0,N-1074).hex())\ncheck('subnormal output', solve(float.fromhex(\"0x1p-1022\"),-N), math.ldexp(1.0,-1022-N).hex())\ncheck('max finite shift zero', solve(float.fromhex(\"0x1.fffffffffffffp+1023\"),0), '0x1.fffffffffffffp+1023')\ncheck('positive overflow', solve(float.fromhex(\"0x1p+1023\"),N), '+overflow')\ncheck('negative overflow', solve(-float.fromhex(\"0x1p+1023\"),N), '-overflow')\ncheck('negative underflow', solve(-float.fromhex(\"0x0.0000000000001p-1022\"),-N), '-0x0.0p+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-frexp-recompose-scale-direction","generated_at":"2026-09-29T14:39:32.733972+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 target=e+shift.","root_cause":"Exponent adjustment reverses the requested shift. The faulty expression is target=e-shift.","sha256":"f925c4c91e9b87152de3d6f66c1e37f22787b428fa3ec400000608b925e30438","title":"Exponent adjustment reverses the requested shift · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":38.182,"exit_code":1,"observations":[{"actual":"0x1.8000000000000p+0","check":"scale up","expected":"0x1.8000000000000p+1","passed":false},{"actual":"-0x1.8000000000000p-2","check":"scale down","expected":"-0x1.8000000000000p-1","passed":false},{"actual":"-0x0.0p+0","check":"negative zero","expected":"-0x0.0p+0","passed":true},{"actual":"0x0.0p+0","check":"positive zero","expected":"0x0.0p+0","passed":true},{"actual":"0x1.0000000000000p+0","check":"subnormal input","expected":"0x0.0000000000002p-1022","passed":false},{"actual":"0x1.0000000000000p-2","check":"subnormal output","expected":"0x0.8000000000000p-1022","passed":false},{"actual":"0x1.fffffffffffffp-1","check":"max finite shift zero","expected":"0x1.fffffffffffffp+1023","passed":false},{"actual":"0x1.0000000000000p+0","check":"positive overflow","expected":"+overflow","passed":false},{"actual":"-0x1.0000000000000p+0","check":"negative overflow","expected":"-overflow","passed":false},{"actual":"-0x1.0000000000000p-2","check":"negative underflow","expected":"-0x0.0p+0","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"scale up\", \"actual\": \"0x1.8000000000000p+0\", \"expected\": \"0x1.8000000000000p+1\", \"passed\": false}, {\"check\": \"scale down\", \"actual\": \"-0x1.8000000000000p-2\", \"expected\": \"-0x1.8000000000000p-1\", \"passed\": false}, {\"check\": \"negative zero\", \"actual\": \"-0x0.0p+0\", \"expected\": \"-0x0.0p+0\", \"passed\": true}, {\"check\": \"positive zero\", \"actual\": \"0x0.0p+0\", \"expected\": \"0x0.0p+0\", \"passed\": true}, {\"check\": \"subnormal input\", \"actual\": \"0x1.0000000000000p+0\", \"expected\": \"0x0.0000000000002p-1022\", \"passed\": false}, {\"check\": \"subnormal output\", \"actual\": \"0x1.0000000000000p-2\", \"expected\": \"0x0.8000000000000p-1022\", \"passed\": false}, {\"check\": \"max finite shift zero\", \"actual\": \"0x1.fffffffffffffp-1\", \"expected\": \"0x1.fffffffffffffp+1023\", \"passed\": false}, {\"check\": \"positive overflow\", \"actual\": \"0x1.0000000000000p+0\", \"expected\": \"+overflow\", \"passed\": false}, {\"check\": \"negative overflow\", \"actual\": \"-0x1.0000000000000p+0\", \"expected\": \"-overflow\", \"passed\": false}, {\"check\": \"negative underflow\", \"actual\": \"-0x1.0000000000000p-2\", \"expected\": \"-0x0.0p+0\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.363,"exit_code":1,"observations":[{"actual":"0x1.8000000000000p-1","check":"scale up","expected":"0x1.8000000000000p+1","passed":false},{"actual":"-0x1.8000000000000p+1","check":"scale down","expected":"-0x1.8000000000000p-1","passed":false},{"actual":"-0x0.0p+0","check":"negative zero","expected":"-0x0.0p+0","passed":true},{"actual":"0x0.0p+0","check":"positive zero","expected":"0x0.0p+0","passed":true},{"actual":"0x0.0p+0","check":"subnormal input","expected":"0x0.0000000000002p-1022","passed":false},{"actual":"0x1.0000000000000p-1021","check":"subnormal output","expected":"0x0.8000000000000p-1022","passed":false},{"actual":"0x1.fffffffffffffp+1023","check":"max finite shift zero","expected":"0x1.fffffffffffffp+1023","passed":true},{"actual":"0x1.0000000000000p+1022","check":"positive overflow","expected":"+overflow","passed":false},{"actual":"-0x1.0000000000000p+1022","check":"negative overflow","expected":"-overflow","passed":false},{"actual":"-0x0.0000000000002p-1022","check":"negative underflow","expected":"-0x0.0p+0","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"scale up\", \"actual\": \"0x1.8000000000000p-1\", \"expected\": \"0x1.8000000000000p+1\", \"passed\": false}, {\"check\": \"scale down\", \"actual\": \"-0x1.8000000000000p+1\", \"expected\": \"-0x1.8000000000000p-1\", \"passed\": false}, {\"check\": \"negative zero\", \"actual\": \"-0x0.0p+0\", \"expected\": \"-0x0.0p+0\", \"passed\": true}, {\"check\": \"positive zero\", \"actual\": \"0x0.0p+0\", \"expected\": \"0x0.0p+0\", \"passed\": true}, {\"check\": \"subnormal input\", \"actual\": \"0x0.0p+0\", \"expected\": \"0x0.0000000000002p-1022\", \"passed\": false}, {\"check\": \"subnormal output\", \"actual\": \"0x1.0000000000000p-1021\", \"expected\": \"0x0.8000000000000p-1022\", \"passed\": false}, {\"check\": \"max finite shift zero\", \"actual\": \"0x1.fffffffffffffp+1023\", \"expected\": \"0x1.fffffffffffffp+1023\", \"passed\": true}, {\"check\": \"positive overflow\", \"actual\": \"0x1.0000000000000p+1022\", \"expected\": \"+overflow\", \"passed\": false}, {\"check\": \"negative overflow\", \"actual\": \"-0x1.0000000000000p+1022\", \"expected\": \"-overflow\", \"passed\": false}, {\"check\": \"negative underflow\", \"actual\": \"-0x0.0000000000002p-1022\", \"expected\": \"-0x0.0p+0\", \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.828,"exit_code":0,"observations":[{"actual":"0x1.8000000000000p+1","check":"scale up","expected":"0x1.8000000000000p+1","passed":true},{"actual":"-0x1.8000000000000p-1","check":"scale down","expected":"-0x1.8000000000000p-1","passed":true},{"actual":"-0x0.0p+0","check":"negative zero","expected":"-0x0.0p+0","passed":true},{"actual":"0x0.0p+0","check":"positive zero","expected":"0x0.0p+0","passed":true},{"actual":"0x0.0000000000002p-1022","check":"subnormal input","expected":"0x0.0000000000002p-1022","passed":true},{"actual":"0x0.8000000000000p-1022","check":"subnormal output","expected":"0x0.8000000000000p-1022","passed":true},{"actual":"0x1.fffffffffffffp+1023","check":"max finite shift zero","expected":"0x1.fffffffffffffp+1023","passed":true},{"actual":"+overflow","check":"positive overflow","expected":"+overflow","passed":true},{"actual":"-overflow","check":"negative overflow","expected":"-overflow","passed":true},{"actual":"-0x0.0p+0","check":"negative underflow","expected":"-0x0.0p+0","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"scale up\", \"actual\": \"0x1.8000000000000p+1\", \"expected\": \"0x1.8000000000000p+1\", \"passed\": true}, {\"check\": \"scale down\", \"actual\": \"-0x1.8000000000000p-1\", \"expected\": \"-0x1.8000000000000p-1\", \"passed\": true}, {\"check\": \"negative zero\", \"actual\": \"-0x0.0p+0\", \"expected\": \"-0x0.0p+0\", \"passed\": true}, {\"check\": \"positive zero\", \"actual\": \"0x0.0p+0\", \"expected\": \"0x0.0p+0\", \"passed\": true}, {\"check\": \"subnormal input\", \"actual\": \"0x0.0000000000002p-1022\", \"expected\": \"0x0.0000000000002p-1022\", \"passed\": true}, {\"check\": \"subnormal output\", \"actual\": \"0x0.8000000000000p-1022\", \"expected\": \"0x0.8000000000000p-1022\", \"passed\": true}, {\"check\": \"max finite shift zero\", \"actual\": \"0x1.fffffffffffffp+1023\", \"expected\": \"0x1.fffffffffffffp+1023\", \"passed\": true}, {\"check\": \"positive overflow\", \"actual\": \"+overflow\", \"expected\": \"+overflow\", \"passed\": true}, {\"check\": \"negative overflow\", \"actual\": \"-overflow\", \"expected\": \"-overflow\", \"passed\": true}, {\"check\": \"negative underflow\", \"actual\": \"-0x0.0p+0\", \"expected\": \"-0x0.0p+0\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}