{"abstract":"Cosine decrement violates its limiting zero sign.","category":"Floating-point arithmetic","checks":7,"contract":"Evaluate cos(x)-1 for finite x without cancellation using the half-angle identity. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.","evaluation_group":"s3-float-cosm1","failed_approach":"The attempted local correction if x==0: return render(x) still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-cosm1-zero-sign-convention","id":"FA-16376","implementations":{"attempt":{"sha256":"1a5a1eb847fda147defacf953bc58c3ec628a6d0fe15f349e024206c9b8ec9d9","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 render(x)\n        s=math.sin(x/2)\n        result=-2*s*s\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('tiny', solve(N*2.0**-30), render(-0.5*(N*2.0**-30)**2))\ncheck('negative tiny', solve(-N*2.0**-30), render(-0.5*(N*2.0**-30)**2))\ncheck('normal', solve(float(N)), render(-2*math.sin(N/2)**2))\ncheck('negative normal', solve(-float(N)), render(-2*math.sin(N/2)**2))\ncheck('zero', solve(0.0), \"-0\")\ncheck('pi', solve(math.pi), \"-2\")\ncheck('half pi', solve(math.pi/2), \"-1\")\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":"fbf56ac6c5ea50a07ba5245fcc71c06b6e7ce5ff2d5a2a70763d9598267097be","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 '0'\n        s=math.sin(x/2)\n        result=-2*s*s\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('tiny', solve(N*2.0**-30), render(-0.5*(N*2.0**-30)**2))\ncheck('negative tiny', solve(-N*2.0**-30), render(-0.5*(N*2.0**-30)**2))\ncheck('normal', solve(float(N)), render(-2*math.sin(N/2)**2))\ncheck('negative normal', solve(-float(N)), render(-2*math.sin(N/2)**2))\ncheck('zero', solve(0.0), \"-0\")\ncheck('pi', solve(math.pi), \"-2\")\ncheck('half pi', solve(math.pi/2), \"-1\")\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":"574c04d51a1b28a816c764b6b202eef5b0e3c80f7a3240d643a5f67654f8271c","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 '-0'\n        s=math.sin(x/2)\n        result=-2*s*s\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('tiny', solve(N*2.0**-30), render(-0.5*(N*2.0**-30)**2))\ncheck('negative tiny', solve(-N*2.0**-30), render(-0.5*(N*2.0**-30)**2))\ncheck('normal', solve(float(N)), render(-2*math.sin(N/2)**2))\ncheck('negative normal', solve(-float(N)), render(-2*math.sin(N/2)**2))\ncheck('zero', solve(0.0), \"-0\")\ncheck('pi', solve(math.pi), \"-2\")\ncheck('half pi', solve(math.pi/2), \"-1\")\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-cosm1-zero-sign-convention","generated_at":"2026-09-29T14:39:35.721023+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 if x==0: return '-0'.","root_cause":"Cosine decrement violates its limiting zero sign. The faulty expression is if x==0: return '0'.","sha256":"922101ba8a9dbc6b931503042f913e4f1b3ef0764e7605a18901bb2577d5638c","title":"Cosine decrement violates its limiting zero sign · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.556,"exit_code":1,"observations":[{"actual":"-4.3368086899e-19","check":"tiny","expected":"-4.3368086899e-19","passed":true},{"actual":"-4.3368086899e-19","check":"negative tiny","expected":"-4.3368086899e-19","passed":true},{"actual":"-0.45969769413","check":"normal","expected":"-0.45969769413","passed":true},{"actual":"-0.45969769413","check":"negative normal","expected":"-0.45969769413","passed":true},{"actual":"0","check":"zero","expected":"-0","passed":false},{"actual":"-2","check":"pi","expected":"-2","passed":true},{"actual":"-1","check":"half pi","expected":"-1","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"tiny\", \"actual\": \"-4.3368086899e-19\", \"expected\": \"-4.3368086899e-19\", \"passed\": true}, {\"check\": \"negative tiny\", \"actual\": \"-4.3368086899e-19\", \"expected\": \"-4.3368086899e-19\", \"passed\": true}, {\"check\": \"normal\", \"actual\": \"-0.45969769413\", \"expected\": \"-0.45969769413\", \"passed\": true}, {\"check\": \"negative normal\", \"actual\": \"-0.45969769413\", \"expected\": \"-0.45969769413\", \"passed\": true}, {\"check\": \"zero\", \"actual\": \"0\", \"expected\": \"-0\", \"passed\": false}, {\"check\": \"pi\", \"actual\": \"-2\", \"expected\": \"-2\", \"passed\": true}, {\"check\": \"half pi\", \"actual\": \"-1\", \"expected\": \"-1\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.804,"exit_code":1,"observations":[{"actual":"-4.3368086899e-19","check":"tiny","expected":"-4.3368086899e-19","passed":true},{"actual":"-4.3368086899e-19","check":"negative tiny","expected":"-4.3368086899e-19","passed":true},{"actual":"-0.45969769413","check":"normal","expected":"-0.45969769413","passed":true},{"actual":"-0.45969769413","check":"negative normal","expected":"-0.45969769413","passed":true},{"actual":"0","check":"zero","expected":"-0","passed":false},{"actual":"-2","check":"pi","expected":"-2","passed":true},{"actual":"-1","check":"half pi","expected":"-1","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"tiny\", \"actual\": \"-4.3368086899e-19\", \"expected\": \"-4.3368086899e-19\", \"passed\": true}, {\"check\": \"negative tiny\", \"actual\": \"-4.3368086899e-19\", \"expected\": \"-4.3368086899e-19\", \"passed\": true}, {\"check\": \"normal\", \"actual\": \"-0.45969769413\", \"expected\": \"-0.45969769413\", \"passed\": true}, {\"check\": \"negative normal\", \"actual\": \"-0.45969769413\", \"expected\": \"-0.45969769413\", \"passed\": true}, {\"check\": \"zero\", \"actual\": \"0\", \"expected\": \"-0\", \"passed\": false}, {\"check\": \"pi\", \"actual\": \"-2\", \"expected\": \"-2\", \"passed\": true}, {\"check\": \"half pi\", \"actual\": \"-1\", \"expected\": \"-1\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.962,"exit_code":0,"observations":[{"actual":"-4.3368086899e-19","check":"tiny","expected":"-4.3368086899e-19","passed":true},{"actual":"-4.3368086899e-19","check":"negative tiny","expected":"-4.3368086899e-19","passed":true},{"actual":"-0.45969769413","check":"normal","expected":"-0.45969769413","passed":true},{"actual":"-0.45969769413","check":"negative normal","expected":"-0.45969769413","passed":true},{"actual":"-0","check":"zero","expected":"-0","passed":true},{"actual":"-2","check":"pi","expected":"-2","passed":true},{"actual":"-1","check":"half pi","expected":"-1","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"tiny\", \"actual\": \"-4.3368086899e-19\", \"expected\": \"-4.3368086899e-19\", \"passed\": true}, {\"check\": \"negative tiny\", \"actual\": \"-4.3368086899e-19\", \"expected\": \"-4.3368086899e-19\", \"passed\": true}, {\"check\": \"normal\", \"actual\": \"-0.45969769413\", \"expected\": \"-0.45969769413\", \"passed\": true}, {\"check\": \"negative normal\", \"actual\": \"-0.45969769413\", \"expected\": \"-0.45969769413\", \"passed\": true}, {\"check\": \"zero\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"pi\", \"actual\": \"-2\", \"expected\": \"-2\", \"passed\": true}, {\"check\": \"half pi\", \"actual\": \"-1\", \"expected\": \"-1\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}