{"abstract":"Log ratio reverses the distant logarithm difference.","category":"Floating-point arithmetic","checks":8,"contract":"Evaluate log(a/b) for positive finite endpoints without overflowing an intermediate quotient and without cancellation for nearby operands. Finite results are rendered to eleven significant decimal digits; modeled domain violations and arithmetic errors are explicit strings.","contract_signature":"a,b","evaluation_group":"s3-float-log-ratio","failed_approach":"The attempted local correction result=abs(math.log(a)-math.log(b)) still violates the explicit regression fixtures.","family":"s3-floating_point_arithmetic-log-ratio-log-order","id":"FA-17046","implementations":{"attempt":{"sha256":"d3fd28f26c25c1367afd469a541bc227e62a5f149fcfa79beae871fd39ec27bd","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(a,b):\n    try:\n        if a<=0 or b<=0: return 'domain'\n        if a==b: return '0'\n        r=(a-b)/b\n        if abs(r)<0.5:\n            result=math.log1p(r)\n        else:\n            result=abs(math.log(a)-math.log(b))\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('overflowing quotient', solve(N*1e300,1e-300), render(math.log(N*1e300)-math.log(1e-300)))\ncheck('underflowing quotient', solve(1e-300,N*1e300), render(math.log(1e-300)-math.log(N*1e300)))\ncheck('nearby moderate', solve(1.125,1.0), render(math.log(1.125)))\ncheck('nearby large', solve(math.nextafter(1e100,math.inf),1e100), render(math.log1p((math.nextafter(1e100,math.inf)-1e100)/1e100)))\ncheck('normal', solve(float(N+1),1.0), render(math.log(N+1)))\ncheck('reverse', solve(1.0,float(N+1)), render(-math.log(N+1)))\ncheck('equal', solve(float(N),float(N)), \"0\")\ncheck('invalid', solve(0.0,float(N)), \"domain\")\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":"c071ecec491fe3523546a35363fb9b701a3ad2ff235e432b2d6c5c28d15f4b2c","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(a,b):\n    try:\n        if a<=0 or b<=0: return 'domain'\n        if a==b: return '0'\n        r=(a-b)/b\n        if abs(r)<0.5:\n            result=math.log1p(r)\n        else:\n            result=math.log(b)-math.log(a)\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('overflowing quotient', solve(N*1e300,1e-300), render(math.log(N*1e300)-math.log(1e-300)))\ncheck('underflowing quotient', solve(1e-300,N*1e300), render(math.log(1e-300)-math.log(N*1e300)))\ncheck('nearby moderate', solve(1.125,1.0), render(math.log(1.125)))\ncheck('nearby large', solve(math.nextafter(1e100,math.inf),1e100), render(math.log1p((math.nextafter(1e100,math.inf)-1e100)/1e100)))\ncheck('normal', solve(float(N+1),1.0), render(math.log(N+1)))\ncheck('reverse', solve(1.0,float(N+1)), render(-math.log(N+1)))\ncheck('equal', solve(float(N),float(N)), \"0\")\ncheck('invalid', solve(0.0,float(N)), \"domain\")\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-log-ratio-log-order","generated_at":"2026-09-29T14:39:42.354580+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":"Log ratio reverses the distant logarithm difference. The faulty expression is result=math.log(b)-math.log(a).","sha256":"fb0e2702cc58c9c8d9afeac1b80d40b67b2adfaecb0db259ac14d9b268ac7138","title":"Log ratio reverses the distant logarithm difference · 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":41.603,"exit_code":1,"observations":[{"actual":"1381.5510558","check":"overflowing quotient","expected":"1381.5510558","passed":true},{"actual":"1381.5510558","check":"underflowing quotient","expected":"-1381.5510558","passed":false},{"actual":"0.11778303566","check":"nearby moderate","expected":"0.11778303566","passed":true},{"actual":"1.9426688922e-16","check":"nearby large","expected":"1.9426688922e-16","passed":true},{"actual":"0.69314718056","check":"normal","expected":"0.69314718056","passed":true},{"actual":"0.69314718056","check":"reverse","expected":"-0.69314718056","passed":false},{"actual":"0","check":"equal","expected":"0","passed":true},{"actual":"domain","check":"invalid","expected":"domain","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"overflowing quotient\", \"actual\": \"1381.5510558\", \"expected\": \"1381.5510558\", \"passed\": true}, {\"check\": \"underflowing quotient\", \"actual\": \"1381.5510558\", \"expected\": \"-1381.5510558\", \"passed\": false}, {\"check\": \"nearby moderate\", \"actual\": \"0.11778303566\", \"expected\": \"0.11778303566\", \"passed\": true}, {\"check\": \"nearby large\", \"actual\": \"1.9426688922e-16\", \"expected\": \"1.9426688922e-16\", \"passed\": true}, {\"check\": \"normal\", \"actual\": \"0.69314718056\", \"expected\": \"0.69314718056\", \"passed\": true}, {\"check\": \"reverse\", \"actual\": \"0.69314718056\", \"expected\": \"-0.69314718056\", \"passed\": false}, {\"check\": \"equal\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"invalid\", \"actual\": \"domain\", \"expected\": \"domain\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.039,"exit_code":1,"observations":[{"actual":"-1381.5510558","check":"overflowing quotient","expected":"1381.5510558","passed":false},{"actual":"1381.5510558","check":"underflowing quotient","expected":"-1381.5510558","passed":false},{"actual":"0.11778303566","check":"nearby moderate","expected":"0.11778303566","passed":true},{"actual":"1.9426688922e-16","check":"nearby large","expected":"1.9426688922e-16","passed":true},{"actual":"-0.69314718056","check":"normal","expected":"0.69314718056","passed":false},{"actual":"0.69314718056","check":"reverse","expected":"-0.69314718056","passed":false},{"actual":"0","check":"equal","expected":"0","passed":true},{"actual":"domain","check":"invalid","expected":"domain","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"overflowing quotient\", \"actual\": \"-1381.5510558\", \"expected\": \"1381.5510558\", \"passed\": false}, {\"check\": \"underflowing quotient\", \"actual\": \"1381.5510558\", \"expected\": \"-1381.5510558\", \"passed\": false}, {\"check\": \"nearby moderate\", \"actual\": \"0.11778303566\", \"expected\": \"0.11778303566\", \"passed\": true}, {\"check\": \"nearby large\", \"actual\": \"1.9426688922e-16\", \"expected\": \"1.9426688922e-16\", \"passed\": true}, {\"check\": \"normal\", \"actual\": \"-0.69314718056\", \"expected\": \"0.69314718056\", \"passed\": false}, {\"check\": \"reverse\", \"actual\": \"0.69314718056\", \"expected\": \"-0.69314718056\", \"passed\": false}, {\"check\": \"equal\", \"actual\": \"0\", \"expected\": \"0\", \"passed\": true}, {\"check\": \"invalid\", \"actual\": \"domain\", \"expected\": \"domain\", \"passed\": true}], \"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."}}