{"abstract":"ULP lookup reports NaN as infinity.","category":"Floating-point arithmetic","checks":9,"contract":"Return a finite binary64 ulp as a hex string; NaN maps to nan and either infinity maps to infinity. For subnormals and zero the ulp is the minimum positive subnormal.","contract_signature":"bits","evaluation_group":"s3-float-ulp-scale","failed_approach":"The attempted local correction if math.isnan(x): return '0x0.0p+0' still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-ulp-scale-nan-status","id":"FA-15916","implementations":{"attempt":{"sha256":"912332f7933980399a231db82652c6bfa40c922b3d6ea118aabaccfbf1b39b4c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\nN = 1\nobservations = []\ndef solve(bits):\n    x=struct.unpack('>d',bits.to_bytes(8,'big'))[0]\n    if math.isnan(x): return '0x0.0p+0'\n    if math.isinf(x): return 'infinity'\n    x=abs(x)\n    if x == 0: return float.fromhex('0x0.0000000000001p-1022').hex()\n    m,e=math.frexp(x)\n    e=max(e-53,-1074)\n    return math.ldexp(1.0,e).hex()\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('zero', solve(0), '0x0.0000000000001p-1022')\ncheck('negative zero', solve(1<<63), '0x0.0000000000001p-1022')\ncheck('subnormal', solve(N), '0x0.0000000000001p-1022')\ncheck('power boundary', solve((1023+N)<<52), math.ldexp(1.0,N-52).hex())\ncheck('negative power', solve((1<<63)|((1023+N)<<52)), math.ldexp(1.0,N-52).hex())\ncheck('below power', solve(((1023+N)<<52)-1), math.ldexp(1.0,N-53).hex())\ncheck('infinity', solve(0x7ff0000000000000), 'infinity')\ncheck('nan', solve(0x7ff8000000000000|N), 'nan')\ncheck('maximum', solve(0x7fefffffffffffff), '0x1.0000000000000p+971')\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":"ff59651799f00f817688e577534546d60ef5993ee5f9ab48b6944c844a4e8fe0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\nN = 1\nobservations = []\ndef solve(bits):\n    x=struct.unpack('>d',bits.to_bytes(8,'big'))[0]\n    if math.isnan(x): return 'infinity'\n    if math.isinf(x): return 'infinity'\n    x=abs(x)\n    if x == 0: return float.fromhex('0x0.0000000000001p-1022').hex()\n    m,e=math.frexp(x)\n    e=max(e-53,-1074)\n    return math.ldexp(1.0,e).hex()\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('zero', solve(0), '0x0.0000000000001p-1022')\ncheck('negative zero', solve(1<<63), '0x0.0000000000001p-1022')\ncheck('subnormal', solve(N), '0x0.0000000000001p-1022')\ncheck('power boundary', solve((1023+N)<<52), math.ldexp(1.0,N-52).hex())\ncheck('negative power', solve((1<<63)|((1023+N)<<52)), math.ldexp(1.0,N-52).hex())\ncheck('below power', solve(((1023+N)<<52)-1), math.ldexp(1.0,N-53).hex())\ncheck('infinity', solve(0x7ff0000000000000), 'infinity')\ncheck('nan', solve(0x7ff8000000000000|N), 'nan')\ncheck('maximum', solve(0x7fefffffffffffff), '0x1.0000000000000p+971')\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-scale-nan-status","generated_at":"2026-09-29T14:39:31.496730+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 lookup reports NaN as infinity. The faulty expression is if math.isnan(x): return 'infinity'.","sha256":"b01169dbdd77aadf0c905e5a2bf707d01ebf6430149614c9631dc6a86095bd8a","title":"ULP lookup reports NaN as infinity · 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":40.978,"exit_code":1,"observations":[{"actual":"0x0.0000000000001p-1022","check":"zero","expected":"0x0.0000000000001p-1022","passed":true},{"actual":"0x0.0000000000001p-1022","check":"negative zero","expected":"0x0.0000000000001p-1022","passed":true},{"actual":"0x0.0000000000001p-1022","check":"subnormal","expected":"0x0.0000000000001p-1022","passed":true},{"actual":"0x1.0000000000000p-51","check":"power boundary","expected":"0x1.0000000000000p-51","passed":true},{"actual":"0x1.0000000000000p-51","check":"negative power","expected":"0x1.0000000000000p-51","passed":true},{"actual":"0x1.0000000000000p-52","check":"below power","expected":"0x1.0000000000000p-52","passed":true},{"actual":"infinity","check":"infinity","expected":"infinity","passed":true},{"actual":"0x0.0p+0","check":"nan","expected":"nan","passed":false},{"actual":"0x1.0000000000000p+971","check":"maximum","expected":"0x1.0000000000000p+971","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"zero\", \"actual\": \"0x0.0000000000001p-1022\", \"expected\": \"0x0.0000000000001p-1022\", \"passed\": true}, {\"check\": \"negative zero\", \"actual\": \"0x0.0000000000001p-1022\", \"expected\": \"0x0.0000000000001p-1022\", \"passed\": true}, {\"check\": \"subnormal\", \"actual\": \"0x0.0000000000001p-1022\", \"expected\": \"0x0.0000000000001p-1022\", \"passed\": true}, {\"check\": \"power boundary\", \"actual\": \"0x1.0000000000000p-51\", \"expected\": \"0x1.0000000000000p-51\", \"passed\": true}, {\"check\": \"negative power\", \"actual\": \"0x1.0000000000000p-51\", \"expected\": \"0x1.0000000000000p-51\", \"passed\": true}, {\"check\": \"below power\", \"actual\": \"0x1.0000000000000p-52\", \"expected\": \"0x1.0000000000000p-52\", \"passed\": true}, {\"check\": \"infinity\", \"actual\": \"infinity\", \"expected\": \"infinity\", \"passed\": true}, {\"check\": \"nan\", \"actual\": \"0x0.0p+0\", \"expected\": \"nan\", \"passed\": false}, {\"check\": \"maximum\", \"actual\": \"0x1.0000000000000p+971\", \"expected\": \"0x1.0000000000000p+971\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.208,"exit_code":1,"observations":[{"actual":"0x0.0000000000001p-1022","check":"zero","expected":"0x0.0000000000001p-1022","passed":true},{"actual":"0x0.0000000000001p-1022","check":"negative zero","expected":"0x0.0000000000001p-1022","passed":true},{"actual":"0x0.0000000000001p-1022","check":"subnormal","expected":"0x0.0000000000001p-1022","passed":true},{"actual":"0x1.0000000000000p-51","check":"power boundary","expected":"0x1.0000000000000p-51","passed":true},{"actual":"0x1.0000000000000p-51","check":"negative power","expected":"0x1.0000000000000p-51","passed":true},{"actual":"0x1.0000000000000p-52","check":"below power","expected":"0x1.0000000000000p-52","passed":true},{"actual":"infinity","check":"infinity","expected":"infinity","passed":true},{"actual":"infinity","check":"nan","expected":"nan","passed":false},{"actual":"0x1.0000000000000p+971","check":"maximum","expected":"0x1.0000000000000p+971","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"zero\", \"actual\": \"0x0.0000000000001p-1022\", \"expected\": \"0x0.0000000000001p-1022\", \"passed\": true}, {\"check\": \"negative zero\", \"actual\": \"0x0.0000000000001p-1022\", \"expected\": \"0x0.0000000000001p-1022\", \"passed\": true}, {\"check\": \"subnormal\", \"actual\": \"0x0.0000000000001p-1022\", \"expected\": \"0x0.0000000000001p-1022\", \"passed\": true}, {\"check\": \"power boundary\", \"actual\": \"0x1.0000000000000p-51\", \"expected\": \"0x1.0000000000000p-51\", \"passed\": true}, {\"check\": \"negative power\", \"actual\": \"0x1.0000000000000p-51\", \"expected\": \"0x1.0000000000000p-51\", \"passed\": true}, {\"check\": \"below power\", \"actual\": \"0x1.0000000000000p-52\", \"expected\": \"0x1.0000000000000p-52\", \"passed\": true}, {\"check\": \"infinity\", \"actual\": \"infinity\", \"expected\": \"infinity\", \"passed\": true}, {\"check\": \"nan\", \"actual\": \"infinity\", \"expected\": \"nan\", \"passed\": false}, {\"check\": \"maximum\", \"actual\": \"0x1.0000000000000p+971\", \"expected\": \"0x1.0000000000000p+971\", \"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."}}