{"abstract":"A 2.25 price shows -1.25 instead of -0.80 in Malay format.","category":"Betting odds conversion","checks":9,"contract":"Convert a decimal price (> 1, else \"invalid\") to an Asian odds style. hk: d - 1. malay: d - 1 when d <= 2, else -1 / (d - 1). indo: d - 1 when d >= 2, else -1 / (d - 1). Other styles return \"invalid style\". Values are rounded half away from zero to two decimals and formatted with a leading \"-\" for negatives.","evaluation_group":"w2-odds-conversion-asian-odds-styles","failed_approach":"Using -1 / d confuses the Malay price with an implied probability.","family":"w2-odds-conversion-asian-odds-styles-malay-negative-formula","id":"FA-84456","implementations":{"attempt":{"sha256":"40b18f089acd16eb9f1388f78f950dc836f6f36864a218a3c82f3945ccdcfb4c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(decimal, style):\n    def fmt(x):\n        sign = '-' if x < 0 else ''\n        c = math.floor(abs(x) * 100 + Fraction(1, 2))\n        return sign + '%d.%02d' % (c // 100, c % 100)\n    d = Fraction(decimal)\n    if d <= 1:\n        return 'invalid'\n    if style == 'hk':\n        v = d - 1\n    elif style == 'malay':\n        v = d - 1 if d <= 2 else -1 / d\n    elif style == 'indo':\n        v = d - 1 if d >= 2 else -1 / (d - 1)\n    else:\n        return 'invalid style'\n    return fmt(v)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ndef run(args):\n    try:\n        return solve(*args)\n    except Exception as exc:\n        return 'raised ' + type(exc).__name__\ncases = [[('control hong kong', ('1.85', 'hk'), '0.85'),\n  ('control malay positive', ('1.80', 'malay'), '0.80'),\n  ('control malay negative', ('2.25', 'malay'), '-0.80'),\n  ('boundary malay evens', ('2.00', 'malay'), '1.00'),\n  ('control indo negative', ('1.80', 'indo'), '-1.25'),\n  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),\n  ('regression: malay negative formula', ('2.25', 'malay'), '-0.80'),\n  ('variant scenario 1', ('1.620', 'indo'), '-1.61'),\n  ('variant scenario 2', ('1.679', 'indo'), '-1.47')],\n [('control hong kong', ('1.85', 'hk'), '0.85'),\n  ('control malay positive', ('1.80', 'malay'), '0.80'),\n  ('control malay negative', ('2.25', 'malay'), '-0.80'),\n  ('boundary malay evens', ('2.00', 'malay'), '1.00'),\n  ('control indo negative', ('1.80', 'indo'), '-1.25'),\n  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),\n  ('regression: malay negative formula', ('2.40', 'malay'), '-0.71'),\n  ('variant scenario 1', ('1.00', 'us'), 'invalid'),\n  ('variant scenario 2', ('1.80', 'indo'), '-1.25')],\n [('control hong kong', ('1.85', 'hk'), '0.85'),\n  ('control malay positive', ('1.80', 'malay'), '0.80'),\n  ('control malay negative', ('2.25', 'malay'), '-0.80'),\n  ('boundary malay evens', ('2.00', 'malay'), '1.00'),\n  ('control indo negative', ('1.80', 'indo'), '-1.25'),\n  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),\n  ('regression: malay negative formula', ('9.00', 'malay'), '-0.13'),\n  ('variant scenario 1', ('9.00', 'us'), 'invalid style'),\n  ('variant scenario 2', ('9.00', 'indo'), '8.00')],\n [('control hong kong', ('1.85', 'hk'), '0.85'),\n  ('control malay positive', ('1.80', 'malay'), '0.80'),\n  ('control malay negative', ('2.25', 'malay'), '-0.80'),\n  ('boundary malay evens', ('2.00', 'malay'), '1.00'),\n  ('control indo negative', ('1.80', 'indo'), '-1.25'),\n  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),\n  ('regression: malay negative formula', ('2.25', 'malay'), '-0.80'),\n  ('variant scenario 1', ('9.00', 'indo'), '8.00'),\n  ('variant scenario 2', ('1.00', 'malay'), 'invalid')],\n [('control hong kong', ('1.85', 'hk'), '0.85'),\n  ('control malay positive', ('1.80', 'malay'), '0.80'),\n  ('control malay negative', ('2.25', 'malay'), '-0.80'),\n  ('boundary malay evens', ('2.00', 'malay'), '1.00'),\n  ('control indo negative', ('1.80', 'indo'), '-1.25'),\n  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),\n  ('regression: malay negative formula', ('2.399', 'malay'), '-0.71'),\n  ('variant scenario 1', ('1.80', 'indo'), '-1.25'),\n  ('variant scenario 2', ('1.80', 'malay'), '0.80')]]\nfor label, args, expected in cases[N - 1]:\n    check(label, run(args), expected)\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":"022d887c0ad4c75fc398a7058bd0ba24f1e52d9537a0ac5029dc01c1e0195e67","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(decimal, style):\n    def fmt(x):\n        sign = '-' if x < 0 else ''\n        c = math.floor(abs(x) * 100 + Fraction(1, 2))\n        return sign + '%d.%02d' % (c // 100, c % 100)\n    d = Fraction(decimal)\n    if d <= 1:\n        return 'invalid'\n    if style == 'hk':\n        v = d - 1\n    elif style == 'malay':\n        v = d - 1 if d <= 2 else -(d - 1)\n    elif style == 'indo':\n        v = d - 1 if d >= 2 else -1 / (d - 1)\n    else:\n        return 'invalid style'\n    return fmt(v)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ndef run(args):\n    try:\n        return solve(*args)\n    except Exception as exc:\n        return 'raised ' + type(exc).__name__\ncases = [[('control hong kong', ('1.85', 'hk'), '0.85'),\n  ('control malay positive', ('1.80', 'malay'), '0.80'),\n  ('control malay negative', ('2.25', 'malay'), '-0.80'),\n  ('boundary malay evens', ('2.00', 'malay'), '1.00'),\n  ('control indo negative', ('1.80', 'indo'), '-1.25'),\n  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),\n  ('regression: malay negative formula', ('2.25', 'malay'), '-0.80'),\n  ('variant scenario 1', ('1.620', 'indo'), '-1.61'),\n  ('variant scenario 2', ('1.679', 'indo'), '-1.47')],\n [('control hong kong', ('1.85', 'hk'), '0.85'),\n  ('control malay positive', ('1.80', 'malay'), '0.80'),\n  ('control malay negative', ('2.25', 'malay'), '-0.80'),\n  ('boundary malay evens', ('2.00', 'malay'), '1.00'),\n  ('control indo negative', ('1.80', 'indo'), '-1.25'),\n  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),\n  ('regression: malay negative formula', ('2.40', 'malay'), '-0.71'),\n  ('variant scenario 1', ('1.00', 'us'), 'invalid'),\n  ('variant scenario 2', ('1.80', 'indo'), '-1.25')],\n [('control hong kong', ('1.85', 'hk'), '0.85'),\n  ('control malay positive', ('1.80', 'malay'), '0.80'),\n  ('control malay negative', ('2.25', 'malay'), '-0.80'),\n  ('boundary malay evens', ('2.00', 'malay'), '1.00'),\n  ('control indo negative', ('1.80', 'indo'), '-1.25'),\n  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),\n  ('regression: malay negative formula', ('9.00', 'malay'), '-0.13'),\n  ('variant scenario 1', ('9.00', 'us'), 'invalid style'),\n  ('variant scenario 2', ('9.00', 'indo'), '8.00')],\n [('control hong kong', ('1.85', 'hk'), '0.85'),\n  ('control malay positive', ('1.80', 'malay'), '0.80'),\n  ('control malay negative', ('2.25', 'malay'), '-0.80'),\n  ('boundary malay evens', ('2.00', 'malay'), '1.00'),\n  ('control indo negative', ('1.80', 'indo'), '-1.25'),\n  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),\n  ('regression: malay negative formula', ('2.25', 'malay'), '-0.80'),\n  ('variant scenario 1', ('9.00', 'indo'), '8.00'),\n  ('variant scenario 2', ('1.00', 'malay'), 'invalid')],\n [('control hong kong', ('1.85', 'hk'), '0.85'),\n  ('control malay positive', ('1.80', 'malay'), '0.80'),\n  ('control malay negative', ('2.25', 'malay'), '-0.80'),\n  ('boundary malay evens', ('2.00', 'malay'), '1.00'),\n  ('control indo negative', ('1.80', 'indo'), '-1.25'),\n  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),\n  ('regression: malay negative formula', ('2.399', 'malay'), '-0.71'),\n  ('variant scenario 1', ('1.80', 'indo'), '-1.25'),\n  ('variant scenario 2', ('1.80', 'malay'), '0.80')]]\nfor label, args, expected in cases[N - 1]:\n    check(label, run(args), expected)\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":"46c5fd154fac5c6e44e2984f5d2276fe33261a72f8f35228d7ad1579d0793a13","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(decimal, style):\n    def fmt(x):\n        sign = '-' if x < 0 else ''\n        c = math.floor(abs(x) * 100 + Fraction(1, 2))\n        return sign + '%d.%02d' % (c // 100, c % 100)\n    d = Fraction(decimal)\n    if d <= 1:\n        return 'invalid'\n    if style == 'hk':\n        v = d - 1\n    elif style == 'malay':\n        v = d - 1 if d <= 2 else -1 / (d - 1)\n    elif style == 'indo':\n        v = d - 1 if d >= 2 else -1 / (d - 1)\n    else:\n        return 'invalid style'\n    return fmt(v)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ndef run(args):\n    try:\n        return solve(*args)\n    except Exception as exc:\n        return 'raised ' + type(exc).__name__\ncases = [[('control hong kong', ('1.85', 'hk'), '0.85'),\n  ('control malay positive', ('1.80', 'malay'), '0.80'),\n  ('control malay negative', ('2.25', 'malay'), '-0.80'),\n  ('boundary malay evens', ('2.00', 'malay'), '1.00'),\n  ('control indo negative', ('1.80', 'indo'), '-1.25'),\n  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),\n  ('regression: malay negative formula', ('2.25', 'malay'), '-0.80'),\n  ('variant scenario 1', ('1.620', 'indo'), '-1.61'),\n  ('variant scenario 2', ('1.679', 'indo'), '-1.47')],\n [('control hong kong', ('1.85', 'hk'), '0.85'),\n  ('control malay positive', ('1.80', 'malay'), '0.80'),\n  ('control malay negative', ('2.25', 'malay'), '-0.80'),\n  ('boundary malay evens', ('2.00', 'malay'), '1.00'),\n  ('control indo negative', ('1.80', 'indo'), '-1.25'),\n  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),\n  ('regression: malay negative formula', ('2.40', 'malay'), '-0.71'),\n  ('variant scenario 1', ('1.00', 'us'), 'invalid'),\n  ('variant scenario 2', ('1.80', 'indo'), '-1.25')],\n [('control hong kong', ('1.85', 'hk'), '0.85'),\n  ('control malay positive', ('1.80', 'malay'), '0.80'),\n  ('control malay negative', ('2.25', 'malay'), '-0.80'),\n  ('boundary malay evens', ('2.00', 'malay'), '1.00'),\n  ('control indo negative', ('1.80', 'indo'), '-1.25'),\n  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),\n  ('regression: malay negative formula', ('9.00', 'malay'), '-0.13'),\n  ('variant scenario 1', ('9.00', 'us'), 'invalid style'),\n  ('variant scenario 2', ('9.00', 'indo'), '8.00')],\n [('control hong kong', ('1.85', 'hk'), '0.85'),\n  ('control malay positive', ('1.80', 'malay'), '0.80'),\n  ('control malay negative', ('2.25', 'malay'), '-0.80'),\n  ('boundary malay evens', ('2.00', 'malay'), '1.00'),\n  ('control indo negative', ('1.80', 'indo'), '-1.25'),\n  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),\n  ('regression: malay negative formula', ('2.25', 'malay'), '-0.80'),\n  ('variant scenario 1', ('9.00', 'indo'), '8.00'),\n  ('variant scenario 2', ('1.00', 'malay'), 'invalid')],\n [('control hong kong', ('1.85', 'hk'), '0.85'),\n  ('control malay positive', ('1.80', 'malay'), '0.80'),\n  ('control malay negative', ('2.25', 'malay'), '-0.80'),\n  ('boundary malay evens', ('2.00', 'malay'), '1.00'),\n  ('control indo negative', ('1.80', 'indo'), '-1.25'),\n  ('boundary indo half rounds away', ('9.00', 'malay'), '-0.13'),\n  ('regression: malay negative formula', ('2.399', 'malay'), '-0.71'),\n  ('variant scenario 1', ('1.80', 'indo'), '-1.25'),\n  ('variant scenario 2', ('1.80', 'malay'), '0.80')]]\nfor label, args, expected in cases[N - 1]:\n    check(label, run(args), expected)\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":"Stipulated, bounded toy contract stated in the contract field; not a claim of conformance with any operator, exchange or regulator rule set. 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":"w2-odds-conversion-asian-odds-styles-malay-negative-formula","generated_at":"2026-09-29T14:50:31.098882+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Asian-facing sportsbooks show Hong Kong, Malay and Indonesian prices with sign conventions.","repair":"Use -1 / (d - 1) above evens.","root_cause":"The negative branch negates d - 1 instead of taking -1 / (d - 1).","sha256":"251c0e3f22d2de22eea00d24640159bb6ace3734346ea30d58e877739e49da37","title":"Negative Malay price computed as negated profit · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.281,"exit_code":1,"observations":[{"actual":"0.85","check":"control hong kong","expected":"0.85","passed":true},{"actual":"0.80","check":"control malay positive","expected":"0.80","passed":true},{"actual":"-0.44","check":"control malay negative","expected":"-0.80","passed":false},{"actual":"1.00","check":"boundary malay evens","expected":"1.00","passed":true},{"actual":"-1.25","check":"control indo negative","expected":"-1.25","passed":true},{"actual":"-0.11","check":"boundary indo half rounds away","expected":"-0.13","passed":false},{"actual":"-0.44","check":"regression: malay negative formula","expected":"-0.80","passed":false},{"actual":"-1.61","check":"variant scenario 1","expected":"-1.61","passed":true},{"actual":"-1.47","check":"variant scenario 2","expected":"-1.47","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control hong kong\", \"actual\": \"0.85\", \"expected\": \"0.85\", \"passed\": true}, {\"check\": \"control malay positive\", \"actual\": \"0.80\", \"expected\": \"0.80\", \"passed\": true}, {\"check\": \"control malay negative\", \"actual\": \"-0.44\", \"expected\": \"-0.80\", \"passed\": false}, {\"check\": \"boundary malay evens\", \"actual\": \"1.00\", \"expected\": \"1.00\", \"passed\": true}, {\"check\": \"control indo negative\", \"actual\": \"-1.25\", \"expected\": \"-1.25\", \"passed\": true}, {\"check\": \"boundary indo half rounds away\", \"actual\": \"-0.11\", \"expected\": \"-0.13\", \"passed\": false}, {\"check\": \"regression: malay negative formula\", \"actual\": \"-0.44\", \"expected\": \"-0.80\", \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": \"-1.61\", \"expected\": \"-1.61\", \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": \"-1.47\", \"expected\": \"-1.47\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.436,"exit_code":1,"observations":[{"actual":"0.85","check":"control hong kong","expected":"0.85","passed":true},{"actual":"0.80","check":"control malay positive","expected":"0.80","passed":true},{"actual":"-1.25","check":"control malay negative","expected":"-0.80","passed":false},{"actual":"1.00","check":"boundary malay evens","expected":"1.00","passed":true},{"actual":"-1.25","check":"control indo negative","expected":"-1.25","passed":true},{"actual":"-8.00","check":"boundary indo half rounds away","expected":"-0.13","passed":false},{"actual":"-1.25","check":"regression: malay negative formula","expected":"-0.80","passed":false},{"actual":"-1.61","check":"variant scenario 1","expected":"-1.61","passed":true},{"actual":"-1.47","check":"variant scenario 2","expected":"-1.47","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control hong kong\", \"actual\": \"0.85\", \"expected\": \"0.85\", \"passed\": true}, {\"check\": \"control malay positive\", \"actual\": \"0.80\", \"expected\": \"0.80\", \"passed\": true}, {\"check\": \"control malay negative\", \"actual\": \"-1.25\", \"expected\": \"-0.80\", \"passed\": false}, {\"check\": \"boundary malay evens\", \"actual\": \"1.00\", \"expected\": \"1.00\", \"passed\": true}, {\"check\": \"control indo negative\", \"actual\": \"-1.25\", \"expected\": \"-1.25\", \"passed\": true}, {\"check\": \"boundary indo half rounds away\", \"actual\": \"-8.00\", \"expected\": \"-0.13\", \"passed\": false}, {\"check\": \"regression: malay negative formula\", \"actual\": \"-1.25\", \"expected\": \"-0.80\", \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": \"-1.61\", \"expected\": \"-1.61\", \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": \"-1.47\", \"expected\": \"-1.47\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.617,"exit_code":0,"observations":[{"actual":"0.85","check":"control hong kong","expected":"0.85","passed":true},{"actual":"0.80","check":"control malay positive","expected":"0.80","passed":true},{"actual":"-0.80","check":"control malay negative","expected":"-0.80","passed":true},{"actual":"1.00","check":"boundary malay evens","expected":"1.00","passed":true},{"actual":"-1.25","check":"control indo negative","expected":"-1.25","passed":true},{"actual":"-0.13","check":"boundary indo half rounds away","expected":"-0.13","passed":true},{"actual":"-0.80","check":"regression: malay negative formula","expected":"-0.80","passed":true},{"actual":"-1.61","check":"variant scenario 1","expected":"-1.61","passed":true},{"actual":"-1.47","check":"variant scenario 2","expected":"-1.47","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control hong kong\", \"actual\": \"0.85\", \"expected\": \"0.85\", \"passed\": true}, {\"check\": \"control malay positive\", \"actual\": \"0.80\", \"expected\": \"0.80\", \"passed\": true}, {\"check\": \"control malay negative\", \"actual\": \"-0.80\", \"expected\": \"-0.80\", \"passed\": true}, {\"check\": \"boundary malay evens\", \"actual\": \"1.00\", \"expected\": \"1.00\", \"passed\": true}, {\"check\": \"control indo negative\", \"actual\": \"-1.25\", \"expected\": \"-1.25\", \"passed\": true}, {\"check\": \"boundary indo half rounds away\", \"actual\": \"-0.13\", \"expected\": \"-0.13\", \"passed\": true}, {\"check\": \"regression: malay negative formula\", \"actual\": \"-0.80\", \"expected\": \"-0.80\", \"passed\": true}, {\"check\": \"variant scenario 1\", \"actual\": \"-1.61\", \"expected\": \"-1.61\", \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": \"-1.47\", \"expected\": \"-1.47\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}