{"abstract":"ULP distance complements the second negative encoding without zero alignment.","category":"Floating-point arithmetic","checks":9,"contract":"Distance between finite binary64 values in representable steps, treating the two zeros as a single position; NaN or infinity yields null. Negative and positive subnormals are adjacent through zero.","contract_signature":"a,b","evaluation_group":"s3-float-ulp-distance","failed_approach":"The attempted local correction b_index=bb still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-ulp-distance-negative-index-b","id":"FA-16096","implementations":{"attempt":{"sha256":"1bf27baa9ab3ccd4c99dc2db756c660bfde875edcfdc36e07874f1b44086efd8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\nN = 1\nobservations = []\ndef solve(a,b):\n    if not math.isfinite(a) or not math.isfinite(b): return None\n    ab=int.from_bytes(struct.pack('>d',a),'big')\n    bb=int.from_bytes(struct.pack('>d',b),'big')\n    a_index=-(ab&((1<<63)-1)) if ab>>63 else ab\n    b_index=bb\n    return abs(a_index-b_index)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('same', solve(float(N),float(N)), 0)\ncheck('zero signs', solve(-0.0,0.0), 0)\ncheck('negative adjacent', solve(-float(N),math.nextafter(-float(N),-math.inf)), 1)\ncheck('positive adjacent', solve(float(N),math.nextafter(float(N),math.inf)), 1)\ncheck('cross zero', solve(-math.ldexp(float(N),-1074),math.ldexp(float(N),-1074)), 2*N)\ncheck('reverse cross', solve(math.ldexp(float(N),-1074),-math.ldexp(float(N),-1074)), 2*N)\ncheck('nan left', solve(float(\"nan\"),1.0), None)\ncheck('nan right', solve(1.0,float(\"nan\")), None)\ncheck('infinity', solve(math.inf,math.inf), None)\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":"6d36497fb42b9da20d1178ede522045f3e253dd9b479247001048d4f0c3281aa","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\nN = 1\nobservations = []\ndef solve(a,b):\n    if not math.isfinite(a) or not math.isfinite(b): return None\n    ab=int.from_bytes(struct.pack('>d',a),'big')\n    bb=int.from_bytes(struct.pack('>d',b),'big')\n    a_index=-(ab&((1<<63)-1)) if ab>>63 else ab\n    b_index=~bb if bb>>63 else bb\n    return abs(a_index-b_index)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('same', solve(float(N),float(N)), 0)\ncheck('zero signs', solve(-0.0,0.0), 0)\ncheck('negative adjacent', solve(-float(N),math.nextafter(-float(N),-math.inf)), 1)\ncheck('positive adjacent', solve(float(N),math.nextafter(float(N),math.inf)), 1)\ncheck('cross zero', solve(-math.ldexp(float(N),-1074),math.ldexp(float(N),-1074)), 2*N)\ncheck('reverse cross', solve(math.ldexp(float(N),-1074),-math.ldexp(float(N),-1074)), 2*N)\ncheck('nan left', solve(float(\"nan\"),1.0), None)\ncheck('nan right', solve(1.0,float(\"nan\")), None)\ncheck('infinity', solve(math.inf,math.inf), None)\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-ulp-distance-negative-index-b","generated_at":"2026-09-29T14:39:33.258410+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":"ULP distance complements the second negative encoding without zero alignment. The faulty expression is b_index=~bb if bb>>63 else bb.","sha256":"ba39a1654cc8affb203c6bc9499618cb1abf3b1691afec5812d3a806fdd04f16","title":"ULP distance complements the second negative encoding without zero alignment · 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":45.509,"exit_code":1,"observations":[{"actual":0,"check":"same","expected":0,"passed":true},{"actual":0,"check":"zero signs","expected":0,"passed":true},{"actual":18437736874454810625,"check":"negative adjacent","expected":1,"passed":false},{"actual":1,"check":"positive adjacent","expected":1,"passed":true},{"actual":2,"check":"cross zero","expected":2,"passed":true},{"actual":9223372036854775808,"check":"reverse cross","expected":2,"passed":false},{"actual":null,"check":"nan left","expected":null,"passed":true},{"actual":null,"check":"nan right","expected":null,"passed":true},{"actual":null,"check":"infinity","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"same\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"zero signs\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"negative adjacent\", \"actual\": 18437736874454810625, \"expected\": 1, \"passed\": false}, {\"check\": \"positive adjacent\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"cross zero\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"reverse cross\", \"actual\": 9223372036854775808, \"expected\": 2, \"passed\": false}, {\"check\": \"nan left\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"nan right\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"infinity\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.406,"exit_code":1,"observations":[{"actual":0,"check":"same","expected":0,"passed":true},{"actual":0,"check":"zero signs","expected":0,"passed":true},{"actual":9223372036854775810,"check":"negative adjacent","expected":1,"passed":false},{"actual":1,"check":"positive adjacent","expected":1,"passed":true},{"actual":2,"check":"cross zero","expected":2,"passed":true},{"actual":9223372036854775811,"check":"reverse cross","expected":2,"passed":false},{"actual":null,"check":"nan left","expected":null,"passed":true},{"actual":null,"check":"nan right","expected":null,"passed":true},{"actual":null,"check":"infinity","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"same\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"zero signs\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"negative adjacent\", \"actual\": 9223372036854775810, \"expected\": 1, \"passed\": false}, {\"check\": \"positive adjacent\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"cross zero\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"reverse cross\", \"actual\": 9223372036854775811, \"expected\": 2, \"passed\": false}, {\"check\": \"nan left\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"nan right\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"infinity\", \"actual\": null, \"expected\": null, \"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."}}