{"abstract":"Tangent-pi reports the reduction sign for integer zeros.","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.","contract_signature":"x","evaluation_group":"s3-float-tanpi","failed_approach":"The attempted local correction if r==0: return \"0\" still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-tanpi-integer-sign","id":"FA-16831","implementations":{"attempt":{"sha256":"76aadf5cee57b1a61e0cfd39e79f6d99201ee444a50739a06623e817e5855372","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 \"0\"\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"},"broken":{"sha256":"cee18f80b26f2aa73cad5039c17c0ad86c5ddb3c2dc50eed97ab1b9c87fa5ec4","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(abs(r))\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-integer-sign","generated_at":"2026-09-29T14:39:40.314227+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":"Tangent-pi reports the reduction sign for integer zeros. The faulty expression is if r==0: return render(abs(r)).","sha256":"4fb34941a3bc19cd065a19fbefed582fda815cf50d53de1f83b5ee7b84af7e23","title":"Tangent-pi reports the reduction sign for integer zeros · 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":42.905,"exit_code":1,"observations":[{"actual":"0","check":"integer","expected":"0","passed":true},{"actual":"0","check":"negative integer","expected":"-0","passed":false},{"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":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"integer\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"negative integer\", \"actual\": \"0\", \"expected\": \"-0\", \"passed\": false}, {\"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\": false}\n"},"broken":{"elapsed_ms":43.171,"exit_code":1,"observations":[{"actual":"0","check":"integer","expected":"0","passed":true},{"actual":"0","check":"negative integer","expected":"-0","passed":false},{"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":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"integer\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"negative integer\", \"actual\": \"0\", \"expected\": \"-0\", \"passed\": false}, {\"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\": 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."}}