{"abstract":"Sigmoid computes its negative tail as a complement.","category":"Floating-point arithmetic","checks":7,"contract":"Evaluate 1/(1+exp(-x)) using a stable branch for negative x. Return a nonnegative probability. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.","evaluation_group":"s3-float-sigmoid","failed_approach":"The attempted local correction result=max(0.0,1-1/(1+z)) still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-sigmoid-negative-cancellation","id":"FA-16186","implementations":{"attempt":{"sha256":"76b8c4ca365887f867c24c79472f073720c7b7b458a4c117d483d04b73d13cc2","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:\n            z=math.exp(-x)\n            result=1/(1+z)\n        else:\n            z=math.exp(x)\n            result=max(0.0,1-1/(1+z))\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('negative huge', solve(-1000.0*N), \"0\")\ncheck('positive huge', solve(1000.0*N), \"1\")\ncheck('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))\ncheck('zero', solve(0.0), \"0.5\")\ncheck('positive moderate', solve(float(N)), render(1/(1+math.exp(-N))))\ncheck('negative moderate', solve(-float(N)), render(1/(1+math.exp(N))))\ncheck('small', solve(N*1e-8), render(1/(1+math.exp(-N*1e-8))))\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":"80acb7dc2dc7989858cf24e6f83589b1a3725e349cd8517b414b966333365d7f","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:\n            z=math.exp(-x)\n            result=1/(1+z)\n        else:\n            z=math.exp(x)\n            result=1-1/(1+z)\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('negative huge', solve(-1000.0*N), \"0\")\ncheck('positive huge', solve(1000.0*N), \"1\")\ncheck('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))\ncheck('zero', solve(0.0), \"0.5\")\ncheck('positive moderate', solve(float(N)), render(1/(1+math.exp(-N))))\ncheck('negative moderate', solve(-float(N)), render(1/(1+math.exp(N))))\ncheck('small', solve(N*1e-8), render(1/(1+math.exp(-N*1e-8))))\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":"c9a5a17cf9866855ffaceed533977c925032502789c904cb13ea4d0c423043b6","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:\n            z=math.exp(-x)\n            result=1/(1+z)\n        else:\n            z=math.exp(x)\n            result=z/(1+z)\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('negative huge', solve(-1000.0*N), \"0\")\ncheck('positive huge', solve(1000.0*N), \"1\")\ncheck('negative tail', solve(-50.0-N), render(math.exp(-50.0-N)))\ncheck('zero', solve(0.0), \"0.5\")\ncheck('positive moderate', solve(float(N)), render(1/(1+math.exp(-N))))\ncheck('negative moderate', solve(-float(N)), render(1/(1+math.exp(N))))\ncheck('small', solve(N*1e-8), render(1/(1+math.exp(-N*1e-8))))\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-sigmoid-negative-cancellation","generated_at":"2026-09-29T14:39:34.048407+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=z/(1+z).","root_cause":"Sigmoid computes its negative tail as a complement. The faulty expression is result=1-1/(1+z).","sha256":"425c15c5c1d5f15770e452ac5878a9b3254841c0c9fe46bda390474542f87593","title":"Sigmoid computes its negative tail as a complement · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.971,"exit_code":1,"observations":[{"actual":"0","check":"negative huge","expected":"0","passed":true},{"actual":"1","check":"positive huge","expected":"1","passed":true},{"actual":"0","check":"negative tail","expected":"7.0954741623e-23","passed":false},{"actual":"0.5","check":"zero","expected":"0.5","passed":true},{"actual":"0.73105857863","check":"positive moderate","expected":"0.73105857863","passed":true},{"actual":"0.26894142137","check":"negative moderate","expected":"0.26894142137","passed":true},{"actual":"0.5000000025","check":"small","expected":"0.5000000025","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"negative huge\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"positive huge\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"negative tail\", \"actual\": \"0\", \"expected\": \"7.0954741623e-23\", \"passed\": false}, {\"check\": \"zero\", \"actual\": \"0.5\", \"expected\": \"0.5\", \"passed\": true}, {\"check\": \"positive moderate\", \"actual\": \"0.73105857863\", \"expected\": \"0.73105857863\", \"passed\": true}, {\"check\": \"negative moderate\", \"actual\": \"0.26894142137\", \"expected\": \"0.26894142137\", \"passed\": true}, {\"check\": \"small\", \"actual\": \"0.5000000025\", \"expected\": \"0.5000000025\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.894,"exit_code":1,"observations":[{"actual":"0","check":"negative huge","expected":"0","passed":true},{"actual":"1","check":"positive huge","expected":"1","passed":true},{"actual":"0","check":"negative tail","expected":"7.0954741623e-23","passed":false},{"actual":"0.5","check":"zero","expected":"0.5","passed":true},{"actual":"0.73105857863","check":"positive moderate","expected":"0.73105857863","passed":true},{"actual":"0.26894142137","check":"negative moderate","expected":"0.26894142137","passed":true},{"actual":"0.5000000025","check":"small","expected":"0.5000000025","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"negative huge\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"positive huge\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"negative tail\", \"actual\": \"0\", \"expected\": \"7.0954741623e-23\", \"passed\": false}, {\"check\": \"zero\", \"actual\": \"0.5\", \"expected\": \"0.5\", \"passed\": true}, {\"check\": \"positive moderate\", \"actual\": \"0.73105857863\", \"expected\": \"0.73105857863\", \"passed\": true}, {\"check\": \"negative moderate\", \"actual\": \"0.26894142137\", \"expected\": \"0.26894142137\", \"passed\": true}, {\"check\": \"small\", \"actual\": \"0.5000000025\", \"expected\": \"0.5000000025\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.186,"exit_code":0,"observations":[{"actual":"0","check":"negative huge","expected":"0","passed":true},{"actual":"1","check":"positive huge","expected":"1","passed":true},{"actual":"7.0954741623e-23","check":"negative tail","expected":"7.0954741623e-23","passed":true},{"actual":"0.5","check":"zero","expected":"0.5","passed":true},{"actual":"0.73105857863","check":"positive moderate","expected":"0.73105857863","passed":true},{"actual":"0.26894142137","check":"negative moderate","expected":"0.26894142137","passed":true},{"actual":"0.5000000025","check":"small","expected":"0.5000000025","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"negative huge\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"positive huge\", \"actual\": \"1\", \"expected\": \"1\", \"passed\": true}, {\"check\": \"negative tail\", \"actual\": \"7.0954741623e-23\", \"expected\": \"7.0954741623e-23\", \"passed\": true}, {\"check\": \"zero\", \"actual\": \"0.5\", \"expected\": \"0.5\", \"passed\": true}, {\"check\": \"positive moderate\", \"actual\": \"0.73105857863\", \"expected\": \"0.73105857863\", \"passed\": true}, {\"check\": \"negative moderate\", \"actual\": \"0.26894142137\", \"expected\": \"0.26894142137\", \"passed\": true}, {\"check\": \"small\", \"actual\": \"0.5000000025\", \"expected\": \"0.5000000025\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}