{"abstract":"Sine-pi assigns the wrong sign to a negative half integer.","category":"Floating-point arithmetic","checks":11,"contract":"Evaluate sin(pi*x) for finite x using modulo-two reduction, with exact integer zeros carrying the sign of x and exact half-integer extrema. 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-sinpi","failed_approach":"The attempted local correction if r==-0.5: return '0' still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-sinpi-half-extremum","id":"FA-16771","implementations":{"attempt":{"sha256":"6e323a3f148096a063b8e2d0dd7c14308937bfd187034f6bb8cab40233d87b8f","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,2.0)\n        if r==0 or abs(r)==1: return render(math.copysign(0.0,x))\n        if r==0.5: return '1'\n        if r==-0.5: return '0'\n        if r>0.5: r=1-r\n        elif r < -0.5: r=-1-r\n        return render(math.sin(math.pi*r))\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('remainder sign reversal', solve(3.0), \"0\")\ncheck('positive integer', solve(float(N)), \"0\")\ncheck('negative integer', solve(-float(N)), \"-0\")\ncheck('half positive', solve(2.0*N+0.5), \"1\")\ncheck('half negative', solve(-2.0*N-0.5), \"-1\")\ncheck('quarter', solve(2.0*N+0.25), render(math.sqrt(0.5)))\ncheck('three quarters', solve(2.0*N+0.75), render(math.sqrt(0.5)))\ncheck('negative three quarters', solve(-2.0*N-0.75), render(-math.sqrt(0.5)))\ncheck('large integer', solve(2.0**52+N), \"0\")\ncheck('negative zero', solve(-0.0), \"-0\")\ncheck('near integer', solve(1.0-2.0**-40), render(math.sin(math.pi*2.0**-40)))\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":"5a80cd1292db91ae3b903c73b3b791b3c027255ae993f383c7fa3dabbe58384a","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,2.0)\n        if r==0 or abs(r)==1: return render(math.copysign(0.0,x))\n        if r==0.5: return '1'\n        if r==-0.5: return '1'\n        if r>0.5: r=1-r\n        elif r < -0.5: r=-1-r\n        return render(math.sin(math.pi*r))\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('remainder sign reversal', solve(3.0), \"0\")\ncheck('positive integer', solve(float(N)), \"0\")\ncheck('negative integer', solve(-float(N)), \"-0\")\ncheck('half positive', solve(2.0*N+0.5), \"1\")\ncheck('half negative', solve(-2.0*N-0.5), \"-1\")\ncheck('quarter', solve(2.0*N+0.25), render(math.sqrt(0.5)))\ncheck('three quarters', solve(2.0*N+0.75), render(math.sqrt(0.5)))\ncheck('negative three quarters', solve(-2.0*N-0.75), render(-math.sqrt(0.5)))\ncheck('large integer', solve(2.0**52+N), \"0\")\ncheck('negative zero', solve(-0.0), \"-0\")\ncheck('near integer', solve(1.0-2.0**-40), render(math.sin(math.pi*2.0**-40)))\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-sinpi-half-extremum","generated_at":"2026-09-29T14:39:39.513670+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":"Sine-pi assigns the wrong sign to a negative half integer. The faulty expression is if r==-0.5: return '1'.","sha256":"10030b29709a5c59996735c55718987ad381c1689980ce2079bfbc199effe150","title":"Sine-pi assigns the wrong sign to a negative half integer · 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":88.249,"exit_code":1,"observations":[{"actual":"0","check":"remainder sign reversal","expected":"0","passed":true},{"actual":"0","check":"positive integer","expected":"0","passed":true},{"actual":"-0","check":"negative integer","expected":"-0","passed":true},{"actual":"1","check":"half positive","expected":"1","passed":true},{"actual":"0","check":"half negative","expected":"-1","passed":false},{"actual":"0.70710678119","check":"quarter","expected":"0.70710678119","passed":true},{"actual":"0.70710678119","check":"three quarters","expected":"0.70710678119","passed":true},{"actual":"-0.70710678119","check":"negative three quarters","expected":"-0.70710678119","passed":true},{"actual":"0","check":"large integer","expected":"0","passed":true},{"actual":"-0","check":"negative zero","expected":"-0","passed":true},{"actual":"2.8572618736e-12","check":"near integer","expected":"2.8572618736e-12","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"remainder sign reversal\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"positive integer\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"negative integer\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"half positive\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"half negative\", \"actual\": \"0\", \"expected\": \"-1\", \"passed\": false}, {\"check\": \"quarter\", \"actual\": \"0.70710678119\", \"expected\": \"0.70710678119\", \"passed\": true}, {\"check\": \"three quarters\", \"actual\": \"0.70710678119\", \"expected\": \"0.70710678119\", \"passed\": true}, {\"check\": \"negative three quarters\", \"actual\": \"-0.70710678119\", \"expected\": \"-0.70710678119\", \"passed\": true}, {\"check\": \"large integer\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"negative zero\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"near integer\", \"actual\": \"2.8572618736e-12\", \"expected\": \"2.8572618736e-12\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":61.034,"exit_code":1,"observations":[{"actual":"0","check":"remainder sign reversal","expected":"0","passed":true},{"actual":"0","check":"positive integer","expected":"0","passed":true},{"actual":"-0","check":"negative integer","expected":"-0","passed":true},{"actual":"1","check":"half positive","expected":"1","passed":true},{"actual":"1","check":"half negative","expected":"-1","passed":false},{"actual":"0.70710678119","check":"quarter","expected":"0.70710678119","passed":true},{"actual":"0.70710678119","check":"three quarters","expected":"0.70710678119","passed":true},{"actual":"-0.70710678119","check":"negative three quarters","expected":"-0.70710678119","passed":true},{"actual":"0","check":"large integer","expected":"0","passed":true},{"actual":"-0","check":"negative zero","expected":"-0","passed":true},{"actual":"2.8572618736e-12","check":"near integer","expected":"2.8572618736e-12","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"remainder sign reversal\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"positive integer\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"negative integer\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"half positive\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"half negative\", \"actual\": \"1\", \"expected\": \"-1\", \"passed\": false}, {\"check\": \"quarter\", \"actual\": \"0.70710678119\", \"expected\": \"0.70710678119\", \"passed\": true}, {\"check\": \"three quarters\", \"actual\": \"0.70710678119\", \"expected\": \"0.70710678119\", \"passed\": true}, {\"check\": \"negative three quarters\", \"actual\": \"-0.70710678119\", \"expected\": \"-0.70710678119\", \"passed\": true}, {\"check\": \"large integer\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"negative zero\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"near integer\", \"actual\": \"2.8572618736e-12\", \"expected\": \"2.8572618736e-12\", \"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."}}