{"abstract":"Midpoint computes an exact negative-zero endpoint through addition.","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.","contract_signature":"a,b","evaluation_group":"s3-float-midpoint","failed_approach":"The attempted local correction if a==b: return abs(a).hex() still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-midpoint-equal-endpoint-sign","id":"FA-17106","implementations":{"attempt":{"sha256":"f0f9d1a88500177220af6e9177a4f4543f4adc42b37d8c2c900d9c8af99c1c52","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 abs(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"},"broken":{"sha256":"829dd5dcf347adf4168632cf0d0cab2729ecce05d9689bdeb137c62b3ea3fed8","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+0.0).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-equal-endpoint-sign","generated_at":"2026-09-29T14:39:43.025443+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":"Midpoint computes an exact negative-zero endpoint through addition. The faulty expression is if a==b: return (a+0.0).hex().","sha256":"70481abdfd83251ec5dd18450c829bf70a337ef681ab82227f592fa140c0c0d1","title":"Midpoint computes an exact negative-zero endpoint through addition · 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.595,"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.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":false},{"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.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\": false}, {\"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":43.296,"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.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":false},{"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.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\": false}, {\"check\": \"ordinary\", \"actual\": \"0x1.4000000000000p+2\", \"expected\": \"0x1.4000000000000p+2\", \"passed\": true}, {\"check\": \"reverse\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}], \"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."}}