{"abstract":"Cosine decrement forgets half-angle reduction.","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.","contract_signature":"x","evaluation_group":"s3-float-cosm1","failed_approach":"The attempted local correction s=math.sin(x)/2 still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-cosm1-half-angle","id":"FA-16361","implementations":{"attempt":{"sha256":"8128e55f6a1c7b75577061ca5d5f40440dcbfbf7414751816d83dfdc9cab5b66","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"},"broken":{"sha256":"28e2314d46e11c76f9593c2db2206271cdd6ac2ff02ef4aaac17f1c590f40c34","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)\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-half-angle","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.","root_cause":"Cosine decrement forgets half-angle reduction. The faulty expression is s=math.sin(x).","sha256":"6c61080507a669fca8b981addc2bbbecbc159a4b1ca95244feea2a127c0c36ac","title":"Cosine decrement forgets half-angle reduction · 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.333,"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.35403670914","check":"normal","expected":"-0.45969769413","passed":false},{"actual":"-0.35403670914","check":"negative normal","expected":"-0.45969769413","passed":false},{"actual":"-0","check":"zero","expected":"-0","passed":true},{"actual":"-7.4987989133e-33","check":"pi","expected":"-2","passed":false},{"actual":"-0.5","check":"half pi","expected":"-1","passed":false}],"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.35403670914\", \"expected\": \"-0.45969769413\", \"passed\": false}, {\"check\": \"negative normal\", \"actual\": \"-0.35403670914\", \"expected\": \"-0.45969769413\", \"passed\": false}, {\"check\": \"zero\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"pi\", \"actual\": \"-7.4987989133e-33\", \"expected\": \"-2\", \"passed\": false}, {\"check\": \"half pi\", \"actual\": \"-0.5\", \"expected\": \"-1\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.21,"exit_code":1,"observations":[{"actual":"-1.734723476e-18","check":"tiny","expected":"-4.3368086899e-19","passed":false},{"actual":"-1.734723476e-18","check":"negative tiny","expected":"-4.3368086899e-19","passed":false},{"actual":"-1.4161468365","check":"normal","expected":"-0.45969769413","passed":false},{"actual":"-1.4161468365","check":"negative normal","expected":"-0.45969769413","passed":false},{"actual":"-0","check":"zero","expected":"-0","passed":true},{"actual":"-2.9995195653e-32","check":"pi","expected":"-2","passed":false},{"actual":"-2","check":"half pi","expected":"-1","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"tiny\", \"actual\": \"-1.734723476e-18\", \"expected\": \"-4.3368086899e-19\", \"passed\": false}, {\"check\": \"negative tiny\", \"actual\": \"-1.734723476e-18\", \"expected\": \"-4.3368086899e-19\", \"passed\": false}, {\"check\": \"normal\", \"actual\": \"-1.4161468365\", \"expected\": \"-0.45969769413\", \"passed\": false}, {\"check\": \"negative normal\", \"actual\": \"-1.4161468365\", \"expected\": \"-0.45969769413\", \"passed\": false}, {\"check\": \"zero\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"pi\", \"actual\": \"-2.9995195653e-32\", \"expected\": \"-2\", \"passed\": false}, {\"check\": \"half pi\", \"actual\": \"-2\", \"expected\": \"-1\", \"passed\": false}], \"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."}}