{"abstract":"Tangent-pi measures pole distance from an integer.","category":"Floating-point arithmetic","checks":10,"contract":"Evaluate tan(pi*x) after modulo-one reduction. Exact half integers are poles; integer zeros carry the sign of x. Near poles use a reciprocal tangent of distance to the pole. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.","evaluation_group":"s3-float-tanpi","failed_approach":"The attempted local correction d=abs(r) still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-tanpi-pole-distance","id":"FA-16816","implementations":{"attempt":{"sha256":"b253c41beda8093fda7d5cbfcdeaa9b15e9bc3e5d2a30d5ed0d8fa7c21a959c2","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        r=math.remainder(x,1.0)\n        if r==0: return render(math.copysign(0.0,x))\n        if abs(r)==0.5: return 'pole'\n        if abs(r)>0.25:\n            d=abs(r)\n            result=math.copysign(1/math.tan(math.pi*d),r)\n        else:\n            result=math.tan(math.pi*r)\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('integer', solve(float(N)), \"0\")\ncheck('negative integer', solve(-float(N)), \"-0\")\ncheck('positive quarter', solve(2.0*N+0.25), \"1\")\ncheck('negative quarter', solve(-2.0*N-0.25), \"-1\")\ncheck('pole', solve(N+0.5), \"pole\")\ncheck('negative pole', solve(-N-0.5), \"pole\")\ncheck('near positive pole', solve(0.5-N*2.0**-50), render(1/math.tan(math.pi*N*2.0**-50)))\ncheck('near negative pole', solve(-0.5+N*2.0**-50), render(-1/math.tan(math.pi*N*2.0**-50)))\ncheck('beyond pole', solve(0.75), \"-1\")\ncheck('huge integer', solve(2.0**52+N), \"0\")\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":"dc8d67a32743d5fc57b930fdbf38cfdbd1f61e748aed2161ee23da5ec7994aab","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        r=math.remainder(x,1.0)\n        if r==0: return render(math.copysign(0.0,x))\n        if abs(r)==0.5: return 'pole'\n        if abs(r)>0.25:\n            d=1-abs(r)\n            result=math.copysign(1/math.tan(math.pi*d),r)\n        else:\n            result=math.tan(math.pi*r)\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('integer', solve(float(N)), \"0\")\ncheck('negative integer', solve(-float(N)), \"-0\")\ncheck('positive quarter', solve(2.0*N+0.25), \"1\")\ncheck('negative quarter', solve(-2.0*N-0.25), \"-1\")\ncheck('pole', solve(N+0.5), \"pole\")\ncheck('negative pole', solve(-N-0.5), \"pole\")\ncheck('near positive pole', solve(0.5-N*2.0**-50), render(1/math.tan(math.pi*N*2.0**-50)))\ncheck('near negative pole', solve(-0.5+N*2.0**-50), render(-1/math.tan(math.pi*N*2.0**-50)))\ncheck('beyond pole', solve(0.75), \"-1\")\ncheck('huge integer', solve(2.0**52+N), \"0\")\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":"7bb38e60b67d2bd67d075181f824cc22d182debd28495d76f9e37878be73bfdd","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        r=math.remainder(x,1.0)\n        if r==0: return render(math.copysign(0.0,x))\n        if abs(r)==0.5: return 'pole'\n        if abs(r)>0.25:\n            d=0.5-abs(r)\n            result=math.copysign(1/math.tan(math.pi*d),r)\n        else:\n            result=math.tan(math.pi*r)\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('integer', solve(float(N)), \"0\")\ncheck('negative integer', solve(-float(N)), \"-0\")\ncheck('positive quarter', solve(2.0*N+0.25), \"1\")\ncheck('negative quarter', solve(-2.0*N-0.25), \"-1\")\ncheck('pole', solve(N+0.5), \"pole\")\ncheck('negative pole', solve(-N-0.5), \"pole\")\ncheck('near positive pole', solve(0.5-N*2.0**-50), render(1/math.tan(math.pi*N*2.0**-50)))\ncheck('near negative pole', solve(-0.5+N*2.0**-50), render(-1/math.tan(math.pi*N*2.0**-50)))\ncheck('beyond pole', solve(0.75), \"-1\")\ncheck('huge integer', solve(2.0**52+N), \"0\")\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-tanpi-pole-distance","generated_at":"2026-09-29T14:39:40.292427+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 d=0.5-abs(r).","root_cause":"Tangent-pi measures pole distance from an integer. The faulty expression is d=1-abs(r).","sha256":"8d6d5aa4da1234563397f6a40178cf0e6ef27c38b117b9a1dc9926765dce5cd5","title":"Tangent-pi measures pole distance from an integer · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.898,"exit_code":1,"observations":[{"actual":"0","check":"integer","expected":"0","passed":true},{"actual":"-0","check":"negative integer","expected":"-0","passed":true},{"actual":"1","check":"positive quarter","expected":"1","passed":true},{"actual":"-1","check":"negative quarter","expected":"-1","passed":true},{"actual":"pole","check":"pole","expected":"pole","passed":true},{"actual":"pole","check":"negative pole","expected":"pole","passed":true},{"actual":"2.947812204e-15","check":"near positive pole","expected":"3.583850712e+14","passed":false},{"actual":"-2.947812204e-15","check":"near negative pole","expected":"-3.583850712e+14","passed":false},{"actual":"-1","check":"beyond pole","expected":"-1","passed":true},{"actual":"0","check":"huge integer","expected":"0","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"integer\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"negative integer\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"positive quarter\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"negative quarter\", \"actual\": \"-1\", \"expected\": \"-1\", \"passed\": true}, {\"check\": \"pole\", \"actual\": \"pole\", \"expected\": \"pole\", \"passed\": true}, {\"check\": \"negative pole\", \"actual\": \"pole\", \"expected\": \"pole\", \"passed\": true}, {\"check\": \"near positive pole\", \"actual\": \"2.947812204e-15\", \"expected\": \"3.583850712e+14\", \"passed\": false}, {\"check\": \"near negative pole\", \"actual\": \"-2.947812204e-15\", \"expected\": \"-3.583850712e+14\", \"passed\": false}, {\"check\": \"beyond pole\", \"actual\": \"-1\", \"expected\": \"-1\", \"passed\": true}, {\"check\": \"huge integer\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.886,"exit_code":1,"observations":[{"actual":"0","check":"integer","expected":"0","passed":true},{"actual":"-0","check":"negative integer","expected":"-0","passed":true},{"actual":"1","check":"positive quarter","expected":"1","passed":true},{"actual":"-1","check":"negative quarter","expected":"-1","passed":true},{"actual":"pole","check":"pole","expected":"pole","passed":true},{"actual":"pole","check":"negative pole","expected":"pole","passed":true},{"actual":"2.8253475241e-15","check":"near positive pole","expected":"3.583850712e+14","passed":false},{"actual":"-2.8253475241e-15","check":"near negative pole","expected":"-3.583850712e+14","passed":false},{"actual":"-1","check":"beyond pole","expected":"-1","passed":true},{"actual":"0","check":"huge integer","expected":"0","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"integer\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"negative integer\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"positive quarter\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"negative quarter\", \"actual\": \"-1\", \"expected\": \"-1\", \"passed\": true}, {\"check\": \"pole\", \"actual\": \"pole\", \"expected\": \"pole\", \"passed\": true}, {\"check\": \"negative pole\", \"actual\": \"pole\", \"expected\": \"pole\", \"passed\": true}, {\"check\": \"near positive pole\", \"actual\": \"2.8253475241e-15\", \"expected\": \"3.583850712e+14\", \"passed\": false}, {\"check\": \"near negative pole\", \"actual\": \"-2.8253475241e-15\", \"expected\": \"-3.583850712e+14\", \"passed\": false}, {\"check\": \"beyond pole\", \"actual\": \"-1\", \"expected\": \"-1\", \"passed\": true}, {\"check\": \"huge integer\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.172,"exit_code":0,"observations":[{"actual":"0","check":"integer","expected":"0","passed":true},{"actual":"-0","check":"negative integer","expected":"-0","passed":true},{"actual":"1","check":"positive quarter","expected":"1","passed":true},{"actual":"-1","check":"negative quarter","expected":"-1","passed":true},{"actual":"pole","check":"pole","expected":"pole","passed":true},{"actual":"pole","check":"negative pole","expected":"pole","passed":true},{"actual":"3.583850712e+14","check":"near positive pole","expected":"3.583850712e+14","passed":true},{"actual":"-3.583850712e+14","check":"near negative pole","expected":"-3.583850712e+14","passed":true},{"actual":"-1","check":"beyond pole","expected":"-1","passed":true},{"actual":"0","check":"huge integer","expected":"0","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"integer\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"negative integer\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"positive quarter\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"negative quarter\", \"actual\": \"-1\", \"expected\": \"-1\", \"passed\": true}, {\"check\": \"pole\", \"actual\": \"pole\", \"expected\": \"pole\", \"passed\": true}, {\"check\": \"negative pole\", \"actual\": \"pole\", \"expected\": \"pole\", \"passed\": true}, {\"check\": \"near positive pole\", \"actual\": \"3.583850712e+14\", \"expected\": \"3.583850712e+14\", \"passed\": true}, {\"check\": \"near negative pole\", \"actual\": \"-3.583850712e+14\", \"expected\": \"-3.583850712e+14\", \"passed\": true}, {\"check\": \"beyond pole\", \"actual\": \"-1\", \"expected\": \"-1\", \"passed\": true}, {\"check\": \"huge integer\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}