{"abstract":"Reciprocal drops sign after magnitude normalization.","category":"Floating-point arithmetic","checks":9,"contract":"Compute the reciprocal of finite binary64 x using exponent decomposition. Signed zeros return signed infinity; overflow returns signed infinity and representable subnormal reciprocals are retained. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.","evaluation_group":"s3-float-reciprocal-scaled","failed_approach":"The attempted local correction return render(-result) still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-reciprocal-scaled-reciprocal-final-sign","id":"FA-17256","implementations":{"attempt":{"sha256":"698f1ddcb0613a53b740948ba23a84e91f131939d7766399e32655adfb76410f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\ndef render(x):\n    if math.isnan(x): return 'nan'\n    if math.isinf(x): return '-infinity' if x<0 else '+infinity'\n    return format(x,'.11g')\n\nN = 1\nobservations = []\ndef solve(x):\n    try:\n        if x==0: return '-infinity' if math.copysign(1.0,x)<0 else '+infinity'\n        m,e=math.frexp(abs(x))\n        fraction=1/m\n        try:\n            result=math.ldexp(fraction,-e)\n        except OverflowError:\n            return '-infinity' if x<0 else '+infinity'\n        return render(-result)\n    except (ValueError, OverflowError, ZeroDivisionError, TypeError):\n        return \"arithmetic-error\"\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('positive ordinary', solve(float(N)), render(1/N))\ncheck('negative ordinary', solve(-float(N)), render(-1/N))\ncheck('huge', solve(1e308), render(1e-308))\ncheck('negative huge', solve(-1e308), render(-1e-308))\ncheck('tiny overflow', solve(math.ldexp(1.0,-1074)), \"+infinity\")\ncheck('negative tiny', solve(-math.ldexp(1.0,-1074)), \"-infinity\")\ncheck('positive zero', solve(0.0), \"+infinity\")\ncheck('negative zero', solve(-0.0), \"-infinity\")\ncheck('fraction', solve(0.125), \"8\")\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":"bbed0da9b02f9cbceea4602fc6e64fb472d5e58e504f9c6ea6be2e2f4bb48437","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\ndef render(x):\n    if math.isnan(x): return 'nan'\n    if math.isinf(x): return '-infinity' if x<0 else '+infinity'\n    return format(x,'.11g')\n\nN = 1\nobservations = []\ndef solve(x):\n    try:\n        if x==0: return '-infinity' if math.copysign(1.0,x)<0 else '+infinity'\n        m,e=math.frexp(abs(x))\n        fraction=1/m\n        try:\n            result=math.ldexp(fraction,-e)\n        except OverflowError:\n            return '-infinity' if x<0 else '+infinity'\n        return render(result)\n    except (ValueError, OverflowError, ZeroDivisionError, TypeError):\n        return \"arithmetic-error\"\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('positive ordinary', solve(float(N)), render(1/N))\ncheck('negative ordinary', solve(-float(N)), render(-1/N))\ncheck('huge', solve(1e308), render(1e-308))\ncheck('negative huge', solve(-1e308), render(-1e-308))\ncheck('tiny overflow', solve(math.ldexp(1.0,-1074)), \"+infinity\")\ncheck('negative tiny', solve(-math.ldexp(1.0,-1074)), \"-infinity\")\ncheck('positive zero', solve(0.0), \"+infinity\")\ncheck('negative zero', solve(-0.0), \"-infinity\")\ncheck('fraction', solve(0.125), \"8\")\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":"82643796da93f08648e3a833d9bd6056f8ef38de0bbe127c8c746d13d50f4515","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nimport struct\ndef render(x):\n    if math.isnan(x): return 'nan'\n    if math.isinf(x): return '-infinity' if x<0 else '+infinity'\n    return format(x,'.11g')\n\nN = 1\nobservations = []\ndef solve(x):\n    try:\n        if x==0: return '-infinity' if math.copysign(1.0,x)<0 else '+infinity'\n        m,e=math.frexp(abs(x))\n        fraction=1/m\n        try:\n            result=math.ldexp(fraction,-e)\n        except OverflowError:\n            return '-infinity' if x<0 else '+infinity'\n        return render(math.copysign(result,x))\n    except (ValueError, OverflowError, ZeroDivisionError, TypeError):\n        return \"arithmetic-error\"\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('positive ordinary', solve(float(N)), render(1/N))\ncheck('negative ordinary', solve(-float(N)), render(-1/N))\ncheck('huge', solve(1e308), render(1e-308))\ncheck('negative huge', solve(-1e308), render(-1e-308))\ncheck('tiny overflow', solve(math.ldexp(1.0,-1074)), \"+infinity\")\ncheck('negative tiny', solve(-math.ldexp(1.0,-1074)), \"-infinity\")\ncheck('positive zero', solve(0.0), \"+infinity\")\ncheck('negative zero', solve(-0.0), \"-infinity\")\ncheck('fraction', solve(0.125), \"8\")\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-reciprocal-scaled-reciprocal-final-sign","generated_at":"2026-09-29T14:39:44.411605+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 return render(math.copysign(result,x)).","root_cause":"Reciprocal drops sign after magnitude normalization. The faulty expression is return render(result).","sha256":"b619f6a6ab7ded92dba5ee58180756b7484c85f07381fc343566de4a8e148065","title":"Reciprocal drops sign after magnitude normalization · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.201,"exit_code":1,"observations":[{"actual":"-1","check":"positive ordinary","expected":"1","passed":false},{"actual":"-1","check":"negative ordinary","expected":"-1","passed":true},{"actual":"-1e-308","check":"huge","expected":"1e-308","passed":false},{"actual":"-1e-308","check":"negative huge","expected":"-1e-308","passed":true},{"actual":"+infinity","check":"tiny overflow","expected":"+infinity","passed":true},{"actual":"-infinity","check":"negative tiny","expected":"-infinity","passed":true},{"actual":"+infinity","check":"positive zero","expected":"+infinity","passed":true},{"actual":"-infinity","check":"negative zero","expected":"-infinity","passed":true},{"actual":"-8","check":"fraction","expected":"8","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"positive ordinary\", \"actual\": \"-1\", \"expected\": \"1\", \"passed\": false}, {\"check\": \"negative ordinary\", \"actual\": \"-1\", \"expected\": \"-1\", \"passed\": true}, {\"check\": \"huge\", \"actual\": \"-1e-308\", \"expected\": \"1e-308\", \"passed\": false}, {\"check\": \"negative huge\", \"actual\": \"-1e-308\", \"expected\": \"-1e-308\", \"passed\": true}, {\"check\": \"tiny overflow\", \"actual\": \"+infinity\", \"expected\": \"+infinity\", \"passed\": true}, {\"check\": \"negative tiny\", \"actual\": \"-infinity\", \"expected\": \"-infinity\", \"passed\": true}, {\"check\": \"positive zero\", \"actual\": \"+infinity\", \"expected\": \"+infinity\", \"passed\": true}, {\"check\": \"negative zero\", \"actual\": \"-infinity\", \"expected\": \"-infinity\", \"passed\": true}, {\"check\": \"fraction\", \"actual\": \"-8\", \"expected\": \"8\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.984,"exit_code":1,"observations":[{"actual":"1","check":"positive ordinary","expected":"1","passed":true},{"actual":"1","check":"negative ordinary","expected":"-1","passed":false},{"actual":"1e-308","check":"huge","expected":"1e-308","passed":true},{"actual":"1e-308","check":"negative huge","expected":"-1e-308","passed":false},{"actual":"+infinity","check":"tiny overflow","expected":"+infinity","passed":true},{"actual":"-infinity","check":"negative tiny","expected":"-infinity","passed":true},{"actual":"+infinity","check":"positive zero","expected":"+infinity","passed":true},{"actual":"-infinity","check":"negative zero","expected":"-infinity","passed":true},{"actual":"8","check":"fraction","expected":"8","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"positive ordinary\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"negative ordinary\", \"actual\": \"1\", \"expected\": \"-1\", \"passed\": false}, {\"check\": \"huge\", \"actual\": \"1e-308\", \"expected\": \"1e-308\", \"passed\": true}, {\"check\": \"negative huge\", \"actual\": \"1e-308\", \"expected\": \"-1e-308\", \"passed\": false}, {\"check\": \"tiny overflow\", \"actual\": \"+infinity\", \"expected\": \"+infinity\", \"passed\": true}, {\"check\": \"negative tiny\", \"actual\": \"-infinity\", \"expected\": \"-infinity\", \"passed\": true}, {\"check\": \"positive zero\", \"actual\": \"+infinity\", \"expected\": \"+infinity\", \"passed\": true}, {\"check\": \"negative zero\", \"actual\": \"-infinity\", \"expected\": \"-infinity\", \"passed\": true}, {\"check\": \"fraction\", \"actual\": \"8\", \"expected\": \"8\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.05,"exit_code":0,"observations":[{"actual":"1","check":"positive ordinary","expected":"1","passed":true},{"actual":"-1","check":"negative ordinary","expected":"-1","passed":true},{"actual":"1e-308","check":"huge","expected":"1e-308","passed":true},{"actual":"-1e-308","check":"negative huge","expected":"-1e-308","passed":true},{"actual":"+infinity","check":"tiny overflow","expected":"+infinity","passed":true},{"actual":"-infinity","check":"negative tiny","expected":"-infinity","passed":true},{"actual":"+infinity","check":"positive zero","expected":"+infinity","passed":true},{"actual":"-infinity","check":"negative zero","expected":"-infinity","passed":true},{"actual":"8","check":"fraction","expected":"8","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"positive ordinary\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"negative ordinary\", \"actual\": \"-1\", \"expected\": \"-1\", \"passed\": true}, {\"check\": \"huge\", \"actual\": \"1e-308\", \"expected\": \"1e-308\", \"passed\": true}, {\"check\": \"negative huge\", \"actual\": \"-1e-308\", \"expected\": \"-1e-308\", \"passed\": true}, {\"check\": \"tiny overflow\", \"actual\": \"+infinity\", \"expected\": \"+infinity\", \"passed\": true}, {\"check\": \"negative tiny\", \"actual\": \"-infinity\", \"expected\": \"-infinity\", \"passed\": true}, {\"check\": \"positive zero\", \"actual\": \"+infinity\", \"expected\": \"+infinity\", \"passed\": true}, {\"check\": \"negative zero\", \"actual\": \"-infinity\", \"expected\": \"-infinity\", \"passed\": true}, {\"check\": \"fraction\", \"actual\": \"8\", \"expected\": \"8\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}