{"abstract":"Exponent adjustment discards the mantissa sign.","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.","contract_signature":"x, shift","evaluation_group":"s3-float-frexp-recompose","failed_approach":"The attempted local correction m,e=math.frexp(-abs(x)) still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-frexp-recompose-frexp-sign","id":"FA-16056","implementations":{"attempt":{"sha256":"c3dd75a90180b89f6ba6fd5011f7bf8854caef080fd4c9ed5c3f5048b313d3b8","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(-abs(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"},"broken":{"sha256":"b00a4c4ddcbfc34bad76a1c6e5a96c16f2ea174ff028ee6453cb16ec4e25aa75","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(abs(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-frexp-sign","generated_at":"2026-09-29T14:39:32.778300+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":"Exponent adjustment discards the mantissa sign. The faulty expression is m,e=math.frexp(abs(x)).","sha256":"afa559a76c8e7eb58fe755ba96e507b49ef8fec2fd8c1e126d74393ccd8f26b5","title":"Exponent adjustment discards the mantissa sign · 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":39.516,"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":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":false},{"actual":"-0x0.8000000000000p-1022","check":"subnormal output","expected":"0x0.8000000000000p-1022","passed":false},{"actual":"-0x1.fffffffffffffp+1023","check":"max finite shift zero","expected":"0x1.fffffffffffffp+1023","passed":false},{"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":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\": 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\": false}, {\"check\": \"subnormal output\", \"actual\": \"-0x0.8000000000000p-1022\", \"expected\": \"0x0.8000000000000p-1022\", \"passed\": false}, {\"check\": \"max finite shift zero\", \"actual\": \"-0x1.fffffffffffffp+1023\", \"expected\": \"0x1.fffffffffffffp+1023\", \"passed\": false}, {\"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\": false}\n"},"broken":{"elapsed_ms":39.029,"exit_code":1,"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":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.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":false}],"passed":false,"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\": 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.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\": 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."}}