{"abstract":"Same-sign midpoint separately halves subnormal endpoints.","category":"Floating-point arithmetic","checks":9,"contract":"Finite ordered binary64 midpoint rendered as hex. Opposite-sign endpoints use half-sums to avoid difference overflow; same-sign endpoints use a difference to preserve subnormal increments. Exact equal endpoints preserve their bits.","evaluation_group":"s3-float-midpoint","failed_approach":"The attempted local correction midpoint=math.ldexp(a,-1)+math.ldexp(b,-1) still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-midpoint-midpoint-underflow","id":"FA-17101","implementations":{"attempt":{"sha256":"ab4af1567a93ae15d12fe5afdf7f700a3ae44288850a83d78b909db4dc8dbe25","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\nN = 1\nobservations = []\ndef solve(a,b):\n    if a>b: return 'invalid'\n    if a==b: return a.hex()\n    if a<0<b:\n        midpoint=a/2+b/2\n    else:\n        midpoint=math.ldexp(a,-1)+math.ldexp(b,-1)\n    return midpoint.hex()\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('opposite huge', solve(-1e308,1e308), 0.0.hex())\ncheck('positive huge', solve(1e308,1.5e308), (1.25e308).hex())\ncheck('negative huge', solve(-1.5e308,-1e308), (-1.25e308).hex())\ncheck('subnormal midpoint', solve(math.ldexp(1.0,-1074),math.ldexp(5.0,-1074)), math.ldexp(3.0,-1074).hex())\ncheck('subnormal same', solve(math.ldexp(1.0,-1074),math.ldexp(3.0,-1074)), math.ldexp(2.0,-1074).hex())\ncheck('negative subnormal', solve(-math.ldexp(3.0,-1074),-math.ldexp(1.0,-1074)), (-math.ldexp(2.0,-1074)).hex())\ncheck('negative zero equal', solve(-0.0,-0.0), (-0.0).hex())\ncheck('ordinary', solve(float(N),float(N+8)), float(N+4).hex())\ncheck('reverse', solve(float(N+1),float(N)), \"invalid\")\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":"aa499dd0c9df073f1ccfa0c0ef63a04e1ebf46b8ef20b7db475e07b094188d26","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\nN = 1\nobservations = []\ndef solve(a,b):\n    if a>b: return 'invalid'\n    if a==b: return a.hex()\n    if a<0<b:\n        midpoint=a/2+b/2\n    else:\n        midpoint=a/2+b/2\n    return midpoint.hex()\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('opposite huge', solve(-1e308,1e308), 0.0.hex())\ncheck('positive huge', solve(1e308,1.5e308), (1.25e308).hex())\ncheck('negative huge', solve(-1.5e308,-1e308), (-1.25e308).hex())\ncheck('subnormal midpoint', solve(math.ldexp(1.0,-1074),math.ldexp(5.0,-1074)), math.ldexp(3.0,-1074).hex())\ncheck('subnormal same', solve(math.ldexp(1.0,-1074),math.ldexp(3.0,-1074)), math.ldexp(2.0,-1074).hex())\ncheck('negative subnormal', solve(-math.ldexp(3.0,-1074),-math.ldexp(1.0,-1074)), (-math.ldexp(2.0,-1074)).hex())\ncheck('negative zero equal', solve(-0.0,-0.0), (-0.0).hex())\ncheck('ordinary', solve(float(N),float(N+8)), float(N+4).hex())\ncheck('reverse', solve(float(N+1),float(N)), \"invalid\")\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":"0012a90273b46b3f5e0d0c84c54b3347f32324dff9ac8f78b39bd3527c153291","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\nN = 1\nobservations = []\ndef solve(a,b):\n    if a>b: return 'invalid'\n    if a==b: return a.hex()\n    if a<0<b:\n        midpoint=a/2+b/2\n    else:\n        midpoint=a+(b-a)/2\n    return midpoint.hex()\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('opposite huge', solve(-1e308,1e308), 0.0.hex())\ncheck('positive huge', solve(1e308,1.5e308), (1.25e308).hex())\ncheck('negative huge', solve(-1.5e308,-1e308), (-1.25e308).hex())\ncheck('subnormal midpoint', solve(math.ldexp(1.0,-1074),math.ldexp(5.0,-1074)), math.ldexp(3.0,-1074).hex())\ncheck('subnormal same', solve(math.ldexp(1.0,-1074),math.ldexp(3.0,-1074)), math.ldexp(2.0,-1074).hex())\ncheck('negative subnormal', solve(-math.ldexp(3.0,-1074),-math.ldexp(1.0,-1074)), (-math.ldexp(2.0,-1074)).hex())\ncheck('negative zero equal', solve(-0.0,-0.0), (-0.0).hex())\ncheck('ordinary', solve(float(N),float(N+8)), float(N+4).hex())\ncheck('reverse', solve(float(N+1),float(N)), \"invalid\")\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-midpoint-midpoint-underflow","generated_at":"2026-09-29T14:39:42.988954+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 midpoint=a+(b-a)/2.","root_cause":"Same-sign midpoint separately halves subnormal endpoints. The faulty expression is midpoint=a/2+b/2.","sha256":"1d40e820ea1917fa06ff69b10cfdda2b453c6eb188298a49a5e974059b55dd6b","title":"Same-sign midpoint separately halves subnormal endpoints · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":45.843,"exit_code":1,"observations":[{"actual":"0x0.0p+0","check":"opposite huge","expected":"0x0.0p+0","passed":true},{"actual":"0x1.640306766bac8p+1023","check":"positive huge","expected":"0x1.640306766bac8p+1023","passed":true},{"actual":"-0x1.640306766bac8p+1023","check":"negative huge","expected":"-0x1.640306766bac8p+1023","passed":true},{"actual":"0x0.0000000000002p-1022","check":"subnormal midpoint","expected":"0x0.0000000000003p-1022","passed":false},{"actual":"0x0.0000000000002p-1022","check":"subnormal same","expected":"0x0.0000000000002p-1022","passed":true},{"actual":"-0x0.0000000000002p-1022","check":"negative subnormal","expected":"-0x0.0000000000002p-1022","passed":true},{"actual":"-0x0.0p+0","check":"negative zero equal","expected":"-0x0.0p+0","passed":true},{"actual":"0x1.4000000000000p+2","check":"ordinary","expected":"0x1.4000000000000p+2","passed":true},{"actual":"invalid","check":"reverse","expected":"invalid","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"opposite huge\", \"actual\": \"0x0.0p+0\", \"expected\": \"0x0.0p+0\", \"passed\": true}, {\"check\": \"positive huge\", \"actual\": \"0x1.640306766bac8p+1023\", \"expected\": \"0x1.640306766bac8p+1023\", \"passed\": true}, {\"check\": \"negative huge\", \"actual\": \"-0x1.640306766bac8p+1023\", \"expected\": \"-0x1.640306766bac8p+1023\", \"passed\": true}, {\"check\": \"subnormal midpoint\", \"actual\": \"0x0.0000000000002p-1022\", \"expected\": \"0x0.0000000000003p-1022\", \"passed\": false}, {\"check\": \"subnormal same\", \"actual\": \"0x0.0000000000002p-1022\", \"expected\": \"0x0.0000000000002p-1022\", \"passed\": true}, {\"check\": \"negative subnormal\", \"actual\": \"-0x0.0000000000002p-1022\", \"expected\": \"-0x0.0000000000002p-1022\", \"passed\": true}, {\"check\": \"negative zero equal\", \"actual\": \"-0x0.0p+0\", \"expected\": \"-0x0.0p+0\", \"passed\": true}, {\"check\": \"ordinary\", \"actual\": \"0x1.4000000000000p+2\", \"expected\": \"0x1.4000000000000p+2\", \"passed\": true}, {\"check\": \"reverse\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.904,"exit_code":1,"observations":[{"actual":"0x0.0p+0","check":"opposite huge","expected":"0x0.0p+0","passed":true},{"actual":"0x1.640306766bac8p+1023","check":"positive huge","expected":"0x1.640306766bac8p+1023","passed":true},{"actual":"-0x1.640306766bac8p+1023","check":"negative huge","expected":"-0x1.640306766bac8p+1023","passed":true},{"actual":"0x0.0000000000002p-1022","check":"subnormal midpoint","expected":"0x0.0000000000003p-1022","passed":false},{"actual":"0x0.0000000000002p-1022","check":"subnormal same","expected":"0x0.0000000000002p-1022","passed":true},{"actual":"-0x0.0000000000002p-1022","check":"negative subnormal","expected":"-0x0.0000000000002p-1022","passed":true},{"actual":"-0x0.0p+0","check":"negative zero equal","expected":"-0x0.0p+0","passed":true},{"actual":"0x1.4000000000000p+2","check":"ordinary","expected":"0x1.4000000000000p+2","passed":true},{"actual":"invalid","check":"reverse","expected":"invalid","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"opposite huge\", \"actual\": \"0x0.0p+0\", \"expected\": \"0x0.0p+0\", \"passed\": true}, {\"check\": \"positive huge\", \"actual\": \"0x1.640306766bac8p+1023\", \"expected\": \"0x1.640306766bac8p+1023\", \"passed\": true}, {\"check\": \"negative huge\", \"actual\": \"-0x1.640306766bac8p+1023\", \"expected\": \"-0x1.640306766bac8p+1023\", \"passed\": true}, {\"check\": \"subnormal midpoint\", \"actual\": \"0x0.0000000000002p-1022\", \"expected\": \"0x0.0000000000003p-1022\", \"passed\": false}, {\"check\": \"subnormal same\", \"actual\": \"0x0.0000000000002p-1022\", \"expected\": \"0x0.0000000000002p-1022\", \"passed\": true}, {\"check\": \"negative subnormal\", \"actual\": \"-0x0.0000000000002p-1022\", \"expected\": \"-0x0.0000000000002p-1022\", \"passed\": true}, {\"check\": \"negative zero equal\", \"actual\": \"-0x0.0p+0\", \"expected\": \"-0x0.0p+0\", \"passed\": true}, {\"check\": \"ordinary\", \"actual\": \"0x1.4000000000000p+2\", \"expected\": \"0x1.4000000000000p+2\", \"passed\": true}, {\"check\": \"reverse\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":47.035,"exit_code":0,"observations":[{"actual":"0x0.0p+0","check":"opposite huge","expected":"0x0.0p+0","passed":true},{"actual":"0x1.640306766bac8p+1023","check":"positive huge","expected":"0x1.640306766bac8p+1023","passed":true},{"actual":"-0x1.640306766bac8p+1023","check":"negative huge","expected":"-0x1.640306766bac8p+1023","passed":true},{"actual":"0x0.0000000000003p-1022","check":"subnormal midpoint","expected":"0x0.0000000000003p-1022","passed":true},{"actual":"0x0.0000000000002p-1022","check":"subnormal same","expected":"0x0.0000000000002p-1022","passed":true},{"actual":"-0x0.0000000000002p-1022","check":"negative subnormal","expected":"-0x0.0000000000002p-1022","passed":true},{"actual":"-0x0.0p+0","check":"negative zero equal","expected":"-0x0.0p+0","passed":true},{"actual":"0x1.4000000000000p+2","check":"ordinary","expected":"0x1.4000000000000p+2","passed":true},{"actual":"invalid","check":"reverse","expected":"invalid","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"opposite huge\", \"actual\": \"0x0.0p+0\", \"expected\": \"0x0.0p+0\", \"passed\": true}, {\"check\": \"positive huge\", \"actual\": \"0x1.640306766bac8p+1023\", \"expected\": \"0x1.640306766bac8p+1023\", \"passed\": true}, {\"check\": \"negative huge\", \"actual\": \"-0x1.640306766bac8p+1023\", \"expected\": \"-0x1.640306766bac8p+1023\", \"passed\": true}, {\"check\": \"subnormal midpoint\", \"actual\": \"0x0.0000000000003p-1022\", \"expected\": \"0x0.0000000000003p-1022\", \"passed\": true}, {\"check\": \"subnormal same\", \"actual\": \"0x0.0000000000002p-1022\", \"expected\": \"0x0.0000000000002p-1022\", \"passed\": true}, {\"check\": \"negative subnormal\", \"actual\": \"-0x0.0000000000002p-1022\", \"expected\": \"-0x0.0000000000002p-1022\", \"passed\": true}, {\"check\": \"negative zero equal\", \"actual\": \"-0x0.0p+0\", \"expected\": \"-0x0.0p+0\", \"passed\": true}, {\"check\": \"ordinary\", \"actual\": \"0x1.4000000000000p+2\", \"expected\": \"0x1.4000000000000p+2\", \"passed\": true}, {\"check\": \"reverse\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}