{"abstract":"A 2.005 price shows +100 instead of +101.","category":"Betting odds conversion","checks":10,"contract":"Convert a decimal price string to an American moneyline string. Prices at or below 1 return \"invalid\". For d >= 2 the line is \"+\" followed by 100 * (d - 1); for d < 2 it is \"-\" followed by 100 / (d - 1). The magnitude is computed exactly from the decimal text and rounded half up to an integer. Evens (2.00) is \"+100\".","contract_signature":"decimal","evaluation_group":"w2-odds-conversion-decimal-to-american","failed_approach":"Python's round() on the exact Fraction rounds exact halves to even.","family":"w2-odds-conversion-decimal-to-american-magnitude-rounding","id":"FA-84346","implementations":{"attempt":{"sha256":"882e3e13725d57eb2462beea6a490d0e583b322f1dd745dc92937dab62f8dcec","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(decimal):\n    d = Fraction(decimal)\n    if d <= 1:\n        return 'invalid'\n    if d >= 2:\n        v = (d - 1) * 100\n        sign = '+'\n    else:\n        v = 100 / (d - 1)\n        sign = '-'\n    n = round(v)\n    return sign + str(n)\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 underdog', ('2.50',), '+150'),\n  ('control favourite', ('1.50',), '-200'),\n  ('boundary evens', ('2.00',), '+100'),\n  ('boundary half-cent rounds up', ('2.005',), '+101'),\n  ('boundary no-profit price', ('1.00',), 'invalid'),\n  ('control short favourite', ('1.08',), '-1250'),\n  ('regression: magnitude rounding', ('2.217',), '+122'),\n  ('regression: magnitude rounding', ('2.005',), '+101'),\n  ('variant scenario 1', ('11.70',), '+1070'),\n  ('variant scenario 2', ('2.00',), '+100')],\n [('control underdog', ('2.50',), '+150'),\n  ('control favourite', ('1.50',), '-200'),\n  ('boundary evens', ('2.00',), '+100'),\n  ('boundary half-cent rounds up', ('2.005',), '+101'),\n  ('boundary no-profit price', ('1.00',), 'invalid'),\n  ('control short favourite', ('1.08',), '-1250'),\n  ('regression: magnitude rounding', ('2.005',), '+101'),\n  ('variant scenario 1', ('1.078',), '-1282'),\n  ('variant scenario 2', ('11.34',), '+1034')],\n [('control underdog', ('2.50',), '+150'),\n  ('control favourite', ('1.50',), '-200'),\n  ('boundary evens', ('2.00',), '+100'),\n  ('boundary half-cent rounds up', ('2.005',), '+101'),\n  ('boundary no-profit price', ('1.00',), 'invalid'),\n  ('control short favourite', ('1.08',), '-1250'),\n  ('regression: magnitude rounding', ('2.125',), '+113'),\n  ('variant scenario 1', ('7.99',), '+699'),\n  ('variant scenario 2', ('9.28',), '+828')],\n [('control underdog', ('2.50',), '+150'),\n  ('control favourite', ('1.50',), '-200'),\n  ('boundary evens', ('2.00',), '+100'),\n  ('boundary half-cent rounds up', ('2.005',), '+101'),\n  ('boundary no-profit price', ('1.00',), 'invalid'),\n  ('control short favourite', ('1.08',), '-1250'),\n  ('regression: magnitude rounding', ('3.125',), '+213'),\n  ('variant scenario 1', ('7.98',), '+698'),\n  ('variant scenario 2', ('2.77',), '+177')],\n [('control underdog', ('2.50',), '+150'),\n  ('control favourite', ('1.50',), '-200'),\n  ('boundary evens', ('2.00',), '+100'),\n  ('boundary half-cent rounds up', ('2.005',), '+101'),\n  ('boundary no-profit price', ('1.00',), 'invalid'),\n  ('control short favourite', ('1.08',), '-1250'),\n  ('regression: magnitude rounding', ('1.538',), '-186'),\n  ('regression: magnitude rounding', ('2.125',), '+113'),\n  ('variant scenario 1', ('2.490',), '+149'),\n  ('variant scenario 2', ('1.074',), '-1351')]]\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":"e6a22faba0b9804620b776a30f4c968c587afab5fe6f055c64a3e0981afd985f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom fractions import Fraction\nimport math\nN = 1\nobservations = []\ndef solve(decimal):\n    d = Fraction(decimal)\n    if d <= 1:\n        return 'invalid'\n    if d >= 2:\n        v = (d - 1) * 100\n        sign = '+'\n    else:\n        v = 100 / (d - 1)\n        sign = '-'\n    n = int(v)\n    return sign + str(n)\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 underdog', ('2.50',), '+150'),\n  ('control favourite', ('1.50',), '-200'),\n  ('boundary evens', ('2.00',), '+100'),\n  ('boundary half-cent rounds up', ('2.005',), '+101'),\n  ('boundary no-profit price', ('1.00',), 'invalid'),\n  ('control short favourite', ('1.08',), '-1250'),\n  ('regression: magnitude rounding', ('2.217',), '+122'),\n  ('regression: magnitude rounding', ('2.005',), '+101'),\n  ('variant scenario 1', ('11.70',), '+1070'),\n  ('variant scenario 2', ('2.00',), '+100')],\n [('control underdog', ('2.50',), '+150'),\n  ('control favourite', ('1.50',), '-200'),\n  ('boundary evens', ('2.00',), '+100'),\n  ('boundary half-cent rounds up', ('2.005',), '+101'),\n  ('boundary no-profit price', ('1.00',), 'invalid'),\n  ('control short favourite', ('1.08',), '-1250'),\n  ('regression: magnitude rounding', ('2.005',), '+101'),\n  ('variant scenario 1', ('1.078',), '-1282'),\n  ('variant scenario 2', ('11.34',), '+1034')],\n [('control underdog', ('2.50',), '+150'),\n  ('control favourite', ('1.50',), '-200'),\n  ('boundary evens', ('2.00',), '+100'),\n  ('boundary half-cent rounds up', ('2.005',), '+101'),\n  ('boundary no-profit price', ('1.00',), 'invalid'),\n  ('control short favourite', ('1.08',), '-1250'),\n  ('regression: magnitude rounding', ('2.125',), '+113'),\n  ('variant scenario 1', ('7.99',), '+699'),\n  ('variant scenario 2', ('9.28',), '+828')],\n [('control underdog', ('2.50',), '+150'),\n  ('control favourite', ('1.50',), '-200'),\n  ('boundary evens', ('2.00',), '+100'),\n  ('boundary half-cent rounds up', ('2.005',), '+101'),\n  ('boundary no-profit price', ('1.00',), 'invalid'),\n  ('control short favourite', ('1.08',), '-1250'),\n  ('regression: magnitude rounding', ('3.125',), '+213'),\n  ('variant scenario 1', ('7.98',), '+698'),\n  ('variant scenario 2', ('2.77',), '+177')],\n [('control underdog', ('2.50',), '+150'),\n  ('control favourite', ('1.50',), '-200'),\n  ('boundary evens', ('2.00',), '+100'),\n  ('boundary half-cent rounds up', ('2.005',), '+101'),\n  ('boundary no-profit price', ('1.00',), 'invalid'),\n  ('control short favourite', ('1.08',), '-1250'),\n  ('regression: magnitude rounding', ('1.538',), '-186'),\n  ('regression: magnitude rounding', ('2.125',), '+113'),\n  ('variant scenario 1', ('2.490',), '+149'),\n  ('variant scenario 2', ('1.074',), '-1351')]]\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-decimal-to-american-magnitude-rounding","generated_at":"2026-09-29T14:50:29.873678+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Sportsbooks display the same price in decimal and American formats and must agree at every boundary.","root_cause":"The magnitude is truncated toward zero.","sha256":"6fa00e3619b4701d94bb8da5af45796c02efdcaca29930197b64c6b081ff6b25","title":"Moneyline magnitude truncated or banker-rounded · 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":42.848,"exit_code":1,"observations":[{"actual":"+150","check":"control underdog","expected":"+150","passed":true},{"actual":"-200","check":"control favourite","expected":"-200","passed":true},{"actual":"+100","check":"boundary evens","expected":"+100","passed":true},{"actual":"+100","check":"boundary half-cent rounds up","expected":"+101","passed":false},{"actual":"invalid","check":"boundary no-profit price","expected":"invalid","passed":true},{"actual":"-1250","check":"control short favourite","expected":"-1250","passed":true},{"actual":"+122","check":"regression: magnitude rounding","expected":"+122","passed":true},{"actual":"+100","check":"regression: magnitude rounding","expected":"+101","passed":false},{"actual":"+1070","check":"variant scenario 1","expected":"+1070","passed":true},{"actual":"+100","check":"variant scenario 2","expected":"+100","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control underdog\", \"actual\": \"+150\", \"expected\": \"+150\", \"passed\": true}, {\"check\": \"control favourite\", \"actual\": \"-200\", \"expected\": \"-200\", \"passed\": true}, {\"check\": \"boundary evens\", \"actual\": \"+100\", \"expected\": \"+100\", \"passed\": true}, {\"check\": \"boundary half-cent rounds up\", \"actual\": \"+100\", \"expected\": \"+101\", \"passed\": false}, {\"check\": \"boundary no-profit price\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"control short favourite\", \"actual\": \"-1250\", \"expected\": \"-1250\", \"passed\": true}, {\"check\": \"regression: magnitude rounding\", \"actual\": \"+122\", \"expected\": \"+122\", \"passed\": true}, {\"check\": \"regression: magnitude rounding\", \"actual\": \"+100\", \"expected\": \"+101\", \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": \"+1070\", \"expected\": \"+1070\", \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": \"+100\", \"expected\": \"+100\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.736,"exit_code":1,"observations":[{"actual":"+150","check":"control underdog","expected":"+150","passed":true},{"actual":"-200","check":"control favourite","expected":"-200","passed":true},{"actual":"+100","check":"boundary evens","expected":"+100","passed":true},{"actual":"+100","check":"boundary half-cent rounds up","expected":"+101","passed":false},{"actual":"invalid","check":"boundary no-profit price","expected":"invalid","passed":true},{"actual":"-1250","check":"control short favourite","expected":"-1250","passed":true},{"actual":"+121","check":"regression: magnitude rounding","expected":"+122","passed":false},{"actual":"+100","check":"regression: magnitude rounding","expected":"+101","passed":false},{"actual":"+1070","check":"variant scenario 1","expected":"+1070","passed":true},{"actual":"+100","check":"variant scenario 2","expected":"+100","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"control underdog\", \"actual\": \"+150\", \"expected\": \"+150\", \"passed\": true}, {\"check\": \"control favourite\", \"actual\": \"-200\", \"expected\": \"-200\", \"passed\": true}, {\"check\": \"boundary evens\", \"actual\": \"+100\", \"expected\": \"+100\", \"passed\": true}, {\"check\": \"boundary half-cent rounds up\", \"actual\": \"+100\", \"expected\": \"+101\", \"passed\": false}, {\"check\": \"boundary no-profit price\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"control short favourite\", \"actual\": \"-1250\", \"expected\": \"-1250\", \"passed\": true}, {\"check\": \"regression: magnitude rounding\", \"actual\": \"+121\", \"expected\": \"+122\", \"passed\": false}, {\"check\": \"regression: magnitude rounding\", \"actual\": \"+100\", \"expected\": \"+101\", \"passed\": false}, {\"check\": \"variant scenario 1\", \"actual\": \"+1070\", \"expected\": \"+1070\", \"passed\": true}, {\"check\": \"variant scenario 2\", \"actual\": \"+100\", \"expected\": \"+100\", \"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."}}