{"abstract":"Complex logarithm mistakes axis points for the origin.","category":"Floating-point arithmetic","checks":9,"contract":"Principal logarithm of nonzero finite complex x+iy, using hypot and atan2; zero returns a pole marker. Inputs keep hypot finite. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.","evaluation_group":"s3-float-complex-log","failed_approach":"The attempted local correction if x==0: return 'pole' still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-complex-log-axis-pole","id":"FA-16491","implementations":{"attempt":{"sha256":"651a546efe9fec52b644638827790f81d2c9c1a67fea9ce92ede525487682dfa","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,y):\n    try:\n        if x==0: return 'pole'\n        a=abs(x); b=abs(y)\n        hi=max(a,b); lo=min(a,b)\n        ratio=lo/hi\n        real=math.log(hi)+0.5*math.log1p(ratio*ratio)\n        imag=math.atan2(y,x)\n        return [render(real),render(imag)]\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('unequal components', solve(3.0,4.0), [render(math.log(5)),render(math.atan2(4,3))])\ncheck('huge', solve(N*1e200,1e200), [render(math.log(math.hypot(N*1e200,1e200))),render(math.atan2(1,N))])\ncheck('tiny', solve(N*1e-200,-1e-200), [render(math.log(math.hypot(N*1e-200,1e-200))),render(math.atan2(-1,N))])\ncheck('negative real above', solve(-float(N),0.0), [render(math.log(N)),render(math.pi)])\ncheck('negative real below', solve(-float(N),-0.0), [render(math.log(N)),render(-math.pi)])\ncheck('imaginary axis', solve(0.0,float(N)), [render(math.log(N)),render(math.pi/2)])\ncheck('real axis', solve(float(N),0.0), [render(math.log(N)),\"0\"])\ncheck('origin', solve(0.0,0.0), \"pole\")\ncheck('quadrant three', solve(-float(N),-float(N)), [render(math.log(math.hypot(N,N))),render(-3*math.pi/4)])\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":"cca425eda198248d8f535e5281414a825c81b2ab6b073c65c690c851585c8757","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,y):\n    try:\n        if x==0 or y==0: return 'pole'\n        a=abs(x); b=abs(y)\n        hi=max(a,b); lo=min(a,b)\n        ratio=lo/hi\n        real=math.log(hi)+0.5*math.log1p(ratio*ratio)\n        imag=math.atan2(y,x)\n        return [render(real),render(imag)]\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('unequal components', solve(3.0,4.0), [render(math.log(5)),render(math.atan2(4,3))])\ncheck('huge', solve(N*1e200,1e200), [render(math.log(math.hypot(N*1e200,1e200))),render(math.atan2(1,N))])\ncheck('tiny', solve(N*1e-200,-1e-200), [render(math.log(math.hypot(N*1e-200,1e-200))),render(math.atan2(-1,N))])\ncheck('negative real above', solve(-float(N),0.0), [render(math.log(N)),render(math.pi)])\ncheck('negative real below', solve(-float(N),-0.0), [render(math.log(N)),render(-math.pi)])\ncheck('imaginary axis', solve(0.0,float(N)), [render(math.log(N)),render(math.pi/2)])\ncheck('real axis', solve(float(N),0.0), [render(math.log(N)),\"0\"])\ncheck('origin', solve(0.0,0.0), \"pole\")\ncheck('quadrant three', solve(-float(N),-float(N)), [render(math.log(math.hypot(N,N))),render(-3*math.pi/4)])\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":"90d110e005a3f3aab59f9617726bd5a7fe057ca8740394bba91ace8bbd714e39","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,y):\n    try:\n        if x==0 and y==0: return 'pole'\n        a=abs(x); b=abs(y)\n        hi=max(a,b); lo=min(a,b)\n        ratio=lo/hi\n        real=math.log(hi)+0.5*math.log1p(ratio*ratio)\n        imag=math.atan2(y,x)\n        return [render(real),render(imag)]\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('unequal components', solve(3.0,4.0), [render(math.log(5)),render(math.atan2(4,3))])\ncheck('huge', solve(N*1e200,1e200), [render(math.log(math.hypot(N*1e200,1e200))),render(math.atan2(1,N))])\ncheck('tiny', solve(N*1e-200,-1e-200), [render(math.log(math.hypot(N*1e-200,1e-200))),render(math.atan2(-1,N))])\ncheck('negative real above', solve(-float(N),0.0), [render(math.log(N)),render(math.pi)])\ncheck('negative real below', solve(-float(N),-0.0), [render(math.log(N)),render(-math.pi)])\ncheck('imaginary axis', solve(0.0,float(N)), [render(math.log(N)),render(math.pi/2)])\ncheck('real axis', solve(float(N),0.0), [render(math.log(N)),\"0\"])\ncheck('origin', solve(0.0,0.0), \"pole\")\ncheck('quadrant three', solve(-float(N),-float(N)), [render(math.log(math.hypot(N,N))),render(-3*math.pi/4)])\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-complex-log-axis-pole","generated_at":"2026-09-29T14:39:36.734838+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 and y==0: return 'pole'.","root_cause":"Complex logarithm mistakes axis points for the origin. The faulty expression is if x==0 or y==0: return 'pole'.","sha256":"4550e05b07099c1381e421667269d9e9bbc53f0557278d784893c5ebaaba57ec","title":"Complex logarithm mistakes axis points for the origin · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.786,"exit_code":1,"observations":[{"actual":["1.6094379124","0.927295218"],"check":"unequal components","expected":["1.6094379124","0.927295218"],"passed":true},{"actual":["460.86359219","0.7853981634"],"check":"huge","expected":["460.86359219","0.7853981634"],"passed":true},{"actual":["-460.17044501","-0.7853981634"],"check":"tiny","expected":["-460.17044501","-0.7853981634"],"passed":true},{"actual":["0","3.1415926536"],"check":"negative real above","expected":["0","3.1415926536"],"passed":true},{"actual":["0","-3.1415926536"],"check":"negative real below","expected":["0","-3.1415926536"],"passed":true},{"actual":"pole","check":"imaginary axis","expected":["0","1.5707963268"],"passed":false},{"actual":["0","0"],"check":"real axis","expected":["0","0"],"passed":true},{"actual":"pole","check":"origin","expected":"pole","passed":true},{"actual":["0.34657359028","-2.3561944902"],"check":"quadrant three","expected":["0.34657359028","-2.3561944902"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"unequal components\", \"actual\": [\"1.6094379124\", \"0.927295218\"], \"expected\": [\"1.6094379124\", \"0.927295218\"], \"passed\": true}, {\"check\": \"huge\", \"actual\": [\"460.86359219\", \"0.7853981634\"], \"expected\": [\"460.86359219\", \"0.7853981634\"], \"passed\": true}, {\"check\": \"tiny\", \"actual\": [\"-460.17044501\", \"-0.7853981634\"], \"expected\": [\"-460.17044501\", \"-0.7853981634\"], \"passed\": true}, {\"check\": \"negative real above\", \"actual\": [\"0\", \"3.1415926536\"], \"expected\": [\"0\", \"3.1415926536\"], \"passed\": true}, {\"check\": \"negative real below\", \"actual\": [\"0\", \"-3.1415926536\"], \"expected\": [\"0\", \"-3.1415926536\"], \"passed\": true}, {\"check\": \"imaginary axis\", \"actual\": \"pole\", \"expected\": [\"0\", \"1.5707963268\"], \"passed\": false}, {\"check\": \"real axis\", \"actual\": [\"0\", \"0\"], \"expected\": [\"0\", \"0\"], \"passed\": true}, {\"check\": \"origin\", \"actual\": \"pole\", \"expected\": \"pole\", \"passed\": true}, {\"check\": \"quadrant three\", \"actual\": [\"0.34657359028\", \"-2.3561944902\"], \"expected\": [\"0.34657359028\", \"-2.3561944902\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.816,"exit_code":1,"observations":[{"actual":["1.6094379124","0.927295218"],"check":"unequal components","expected":["1.6094379124","0.927295218"],"passed":true},{"actual":["460.86359219","0.7853981634"],"check":"huge","expected":["460.86359219","0.7853981634"],"passed":true},{"actual":["-460.17044501","-0.7853981634"],"check":"tiny","expected":["-460.17044501","-0.7853981634"],"passed":true},{"actual":"pole","check":"negative real above","expected":["0","3.1415926536"],"passed":false},{"actual":"pole","check":"negative real below","expected":["0","-3.1415926536"],"passed":false},{"actual":"pole","check":"imaginary axis","expected":["0","1.5707963268"],"passed":false},{"actual":"pole","check":"real axis","expected":["0","0"],"passed":false},{"actual":"pole","check":"origin","expected":"pole","passed":true},{"actual":["0.34657359028","-2.3561944902"],"check":"quadrant three","expected":["0.34657359028","-2.3561944902"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"unequal components\", \"actual\": [\"1.6094379124\", \"0.927295218\"], \"expected\": [\"1.6094379124\", \"0.927295218\"], \"passed\": true}, {\"check\": \"huge\", \"actual\": [\"460.86359219\", \"0.7853981634\"], \"expected\": [\"460.86359219\", \"0.7853981634\"], \"passed\": true}, {\"check\": \"tiny\", \"actual\": [\"-460.17044501\", \"-0.7853981634\"], \"expected\": [\"-460.17044501\", \"-0.7853981634\"], \"passed\": true}, {\"check\": \"negative real above\", \"actual\": \"pole\", \"expected\": [\"0\", \"3.1415926536\"], \"passed\": false}, {\"check\": \"negative real below\", \"actual\": \"pole\", \"expected\": [\"0\", \"-3.1415926536\"], \"passed\": false}, {\"check\": \"imaginary axis\", \"actual\": \"pole\", \"expected\": [\"0\", \"1.5707963268\"], \"passed\": false}, {\"check\": \"real axis\", \"actual\": \"pole\", \"expected\": [\"0\", \"0\"], \"passed\": false}, {\"check\": \"origin\", \"actual\": \"pole\", \"expected\": \"pole\", \"passed\": true}, {\"check\": \"quadrant three\", \"actual\": [\"0.34657359028\", \"-2.3561944902\"], \"expected\": [\"0.34657359028\", \"-2.3561944902\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.923,"exit_code":0,"observations":[{"actual":["1.6094379124","0.927295218"],"check":"unequal components","expected":["1.6094379124","0.927295218"],"passed":true},{"actual":["460.86359219","0.7853981634"],"check":"huge","expected":["460.86359219","0.7853981634"],"passed":true},{"actual":["-460.17044501","-0.7853981634"],"check":"tiny","expected":["-460.17044501","-0.7853981634"],"passed":true},{"actual":["0","3.1415926536"],"check":"negative real above","expected":["0","3.1415926536"],"passed":true},{"actual":["0","-3.1415926536"],"check":"negative real below","expected":["0","-3.1415926536"],"passed":true},{"actual":["0","1.5707963268"],"check":"imaginary axis","expected":["0","1.5707963268"],"passed":true},{"actual":["0","0"],"check":"real axis","expected":["0","0"],"passed":true},{"actual":"pole","check":"origin","expected":"pole","passed":true},{"actual":["0.34657359028","-2.3561944902"],"check":"quadrant three","expected":["0.34657359028","-2.3561944902"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"unequal components\", \"actual\": [\"1.6094379124\", \"0.927295218\"], \"expected\": [\"1.6094379124\", \"0.927295218\"], \"passed\": true}, {\"check\": \"huge\", \"actual\": [\"460.86359219\", \"0.7853981634\"], \"expected\": [\"460.86359219\", \"0.7853981634\"], \"passed\": true}, {\"check\": \"tiny\", \"actual\": [\"-460.17044501\", \"-0.7853981634\"], \"expected\": [\"-460.17044501\", \"-0.7853981634\"], \"passed\": true}, {\"check\": \"negative real above\", \"actual\": [\"0\", \"3.1415926536\"], \"expected\": [\"0\", \"3.1415926536\"], \"passed\": true}, {\"check\": \"negative real below\", \"actual\": [\"0\", \"-3.1415926536\"], \"expected\": [\"0\", \"-3.1415926536\"], \"passed\": true}, {\"check\": \"imaginary axis\", \"actual\": [\"0\", \"1.5707963268\"], \"expected\": [\"0\", \"1.5707963268\"], \"passed\": true}, {\"check\": \"real axis\", \"actual\": [\"0\", \"0\"], \"expected\": [\"0\", \"0\"], \"passed\": true}, {\"check\": \"origin\", \"actual\": \"pole\", \"expected\": \"pole\", \"passed\": true}, {\"check\": \"quadrant three\", \"actual\": [\"0.34657359028\", \"-2.3561944902\"], \"expected\": [\"0.34657359028\", \"-2.3561944902\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}