{"abstract":"Cosine decrement returns a positive half-angle square.","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 result=-s*s still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-cosm1-range-sign","id":"FA-16371","implementations":{"attempt":{"sha256":"311e68eeef9f78e3cb3159cd261281fb38389c385e3cb0b7f57bd0fb47a1c587","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=-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":"1cadae1ad04f419cb84a057beab0523b0099787e81c99dbf286864fceb956751","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-range-sign","generated_at":"2026-09-29T14:39:35.663490+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 result=-2*s*s.","root_cause":"Cosine decrement returns a positive half-angle square. The faulty expression is result=2*s*s.","sha256":"b6a08fde77c38a14a5d38553cb8f73e0623f890afa8d91b0e5e52596e74e63d8","title":"Cosine decrement returns a positive half-angle square · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.03,"exit_code":1,"observations":[{"actual":"-2.168404345e-19","check":"tiny","expected":"-4.3368086899e-19","passed":false},{"actual":"-2.168404345e-19","check":"negative tiny","expected":"-4.3368086899e-19","passed":false},{"actual":"-0.22984884707","check":"normal","expected":"-0.45969769413","passed":false},{"actual":"-0.22984884707","check":"negative normal","expected":"-0.45969769413","passed":false},{"actual":"-0","check":"zero","expected":"-0","passed":true},{"actual":"-1","check":"pi","expected":"-2","passed":false},{"actual":"-0.5","check":"half pi","expected":"-1","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"tiny\", \"actual\": \"-2.168404345e-19\", \"expected\": \"-4.3368086899e-19\", \"passed\": false}, {\"check\": \"negative tiny\", \"actual\": \"-2.168404345e-19\", \"expected\": \"-4.3368086899e-19\", \"passed\": false}, {\"check\": \"normal\", \"actual\": \"-0.22984884707\", \"expected\": \"-0.45969769413\", \"passed\": false}, {\"check\": \"negative normal\", \"actual\": \"-0.22984884707\", \"expected\": \"-0.45969769413\", \"passed\": false}, {\"check\": \"zero\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"pi\", \"actual\": \"-1\", \"expected\": \"-2\", \"passed\": false}, {\"check\": \"half pi\", \"actual\": \"-0.5\", \"expected\": \"-1\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.544,"exit_code":1,"observations":[{"actual":"4.3368086899e-19","check":"tiny","expected":"-4.3368086899e-19","passed":false},{"actual":"4.3368086899e-19","check":"negative tiny","expected":"-4.3368086899e-19","passed":false},{"actual":"0.45969769413","check":"normal","expected":"-0.45969769413","passed":false},{"actual":"0.45969769413","check":"negative normal","expected":"-0.45969769413","passed":false},{"actual":"-0","check":"zero","expected":"-0","passed":true},{"actual":"2","check":"pi","expected":"-2","passed":false},{"actual":"1","check":"half pi","expected":"-1","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"tiny\", \"actual\": \"4.3368086899e-19\", \"expected\": \"-4.3368086899e-19\", \"passed\": false}, {\"check\": \"negative tiny\", \"actual\": \"4.3368086899e-19\", \"expected\": \"-4.3368086899e-19\", \"passed\": false}, {\"check\": \"normal\", \"actual\": \"0.45969769413\", \"expected\": \"-0.45969769413\", \"passed\": false}, {\"check\": \"negative normal\", \"actual\": \"0.45969769413\", \"expected\": \"-0.45969769413\", \"passed\": false}, {\"check\": \"zero\", \"actual\": \"-0\", \"expected\": \"-0\", \"passed\": true}, {\"check\": \"pi\", \"actual\": \"2\", \"expected\": \"-2\", \"passed\": false}, {\"check\": \"half pi\", \"actual\": \"1\", \"expected\": \"-1\", \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.488,"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"}