{"abstract":"Rebates are overstated for every payoff.","category":"Loan amortization schedules","checks":7,"contract":"x = {'term' n, 'paid' k, 'finance_charge', 'acq_fee' (fully earned up front), 'payment', 'min_rebate'}. Rebatable charge = finance_charge - acq_fee; remaining r = n - k; rebate = round_half_up(rebatable * r(r+1) / (n(n+1))), set to 0 when below min_rebate. Payoff = payment*r - rebate; earned = finance_charge - rebate. Return {'rebate', 'payoff', 'earned'}.","evaluation_group":"w2-loan-amortization-schedules-rule-of-78-rebate","failed_approach":"Halving the denominator without halving the numerator doubles the rebate.","family":"w2-loan-amortization-schedules-rule-of-78-rebate-total-digits-denominator","id":"FA-58621","implementations":{"attempt":{"sha256":"8a68eb3ca942dea416bd743dbb59884870d502cbadff9fe39cfb3d1e2830a184","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    def rnd(n, d):\n        q, r = divmod(n, d)\n        return q + (1 if 2 * r >= d else 0)\n    n = x['term']\n    k = x['paid']\n    fc = x['finance_charge'] - x['acq_fee']\n    rem = n - k\n    rebate = rnd(fc * rem * (rem + 1), n * (n + 1) // 2)\n    if rebate < x['min_rebate']:\n        rebate = 0\n    remaining = x['payment'] * rem\n    return {'rebate': rebate, 'payoff': remaining - rebate, 'earned': x['finance_charge'] - rebate}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: total digits denominator', {'term': 36, 'paid': 35, 'finance_charge': 120000, 'acq_fee': 0, 'payment': 10000, 'min_rebate': 100}, {'rebate': 180, 'payoff': 9820, 'earned': 119820}], ['control 1', {'term': 36, 'paid': 35, 'finance_charge': 50000, 'acq_fee': 7500, 'payment': 25000, 'min_rebate': 100}, {'rebate': 0, 'payoff': 25000, 'earned': 50000}], ['control 2', {'term': 24, 'paid': 23, 'finance_charge': 100, 'acq_fee': 0, 'payment': 25000, 'min_rebate': 100}, {'rebate': 0, 'payoff': 25000, 'earned': 100}], ['control 3', {'term': 12, 'paid': 3, 'finance_charge': 100, 'acq_fee': 0, 'payment': 4321, 'min_rebate': 100}, {'rebate': 0, 'payoff': 38889, 'earned': 100}], ['control 4', {'term': 6, 'paid': 0, 'finance_charge': 100, 'acq_fee': 2500, 'payment': 10000, 'min_rebate': 0}, {'rebate': 0, 'payoff': 60000, 'earned': 100}], ['control 5', {'term': 24, 'paid': 12, 'finance_charge': 7777, 'acq_fee': 7500, 'payment': 4321, 'min_rebate': 500}, {'rebate': 0, 'payoff': 51852, 'earned': 7777}], ['control 6', {'term': 6, 'paid': 6, 'finance_charge': 7777, 'acq_fee': 2500, 'payment': 10000, 'min_rebate': 0}, {'rebate': 0, 'payoff': 0, 'earned': 7777}]], [['regression: total digits denominator', {'term': 36, 'paid': 3, 'finance_charge': 7777, 'acq_fee': 2500, 'payment': 10000, 'min_rebate': 500}, {'rebate': 4445, 'payoff': 325555, 'earned': 3332}], ['control 1', {'term': 12, 'paid': 1, 'finance_charge': 100, 'acq_fee': 0, 'payment': 10000, 'min_rebate': 100}, {'rebate': 0, 'payoff': 110000, 'earned': 100}], ['control 2', {'term': 24, 'paid': 24, 'finance_charge': 120000, 'acq_fee': 0, 'payment': 10000, 'min_rebate': 100}, {'rebate': 0, 'payoff': 0, 'earned': 120000}], ['control 3', {'term': 36, 'paid': 0, 'finance_charge': 100, 'acq_fee': 7500, 'payment': 25000, 'min_rebate': 500}, {'rebate': 0, 'payoff': 900000, 'earned': 100}], ['control 4', {'term': 24, 'paid': 12, 'finance_charge': 100, 'acq_fee': 2500, 'payment': 10000, 'min_rebate': 500}, {'rebate': 0, 'payoff': 120000, 'earned': 100}], ['control 5', {'term': 24, 'paid': 23, 'finance_charge': 120000, 'acq_fee': 0, 'payment': 4321, 'min_rebate': 500}, {'rebate': 0, 'payoff': 4321, 'earned': 120000}], ['control 6', {'term': 36, 'paid': 35, 'finance_charge': 7777, 'acq_fee': 2500, 'payment': 4321, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 4321, 'earned': 7777}]], [['regression: total digits denominator', {'term': 24, 'paid': 3, 'finance_charge': 120000, 'acq_fee': 0, 'payment': 10000, 'min_rebate': 2000}, {'rebate': 92400, 'payoff': 117600, 'earned': 27600}], ['control 1', {'term': 6, 'paid': 5, 'finance_charge': 100, 'acq_fee': 0, 'payment': 25000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 25000, 'earned': 100}], ['control 2', {'term': 12, 'paid': 12, 'finance_charge': 7777, 'acq_fee': 7500, 'payment': 10000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 0, 'earned': 7777}], ['control 3', {'term': 12, 'paid': 1, 'finance_charge': 100, 'acq_fee': 2500, 'payment': 25000, 'min_rebate': 0}, {'rebate': 0, 'payoff': 275000, 'earned': 100}], ['control 4', {'term': 24, 'paid': 24, 'finance_charge': 7777, 'acq_fee': 7500, 'payment': 10000, 'min_rebate': 0}, {'rebate': 0, 'payoff': 0, 'earned': 7777}], ['control 5', {'term': 36, 'paid': 18, 'finance_charge': 100, 'acq_fee': 2500, 'payment': 4321, 'min_rebate': 500}, {'rebate': 0, 'payoff': 77778, 'earned': 100}], ['control 6', {'term': 12, 'paid': 12, 'finance_charge': 100, 'acq_fee': 0, 'payment': 10000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 0, 'earned': 100}]], [['regression: total digits denominator', {'term': 12, 'paid': 0, 'finance_charge': 7777, 'acq_fee': 0, 'payment': 4321, 'min_rebate': 2000}, {'rebate': 7777, 'payoff': 44075, 'earned': 0}], ['control 1', {'term': 36, 'paid': 0, 'finance_charge': 100, 'acq_fee': 7500, 'payment': 25000, 'min_rebate': 500}, {'rebate': 0, 'payoff': 900000, 'earned': 100}], ['control 2', {'term': 12, 'paid': 12, 'finance_charge': 50000, 'acq_fee': 2500, 'payment': 10000, 'min_rebate': 0}, {'rebate': 0, 'payoff': 0, 'earned': 50000}], ['control 3', {'term': 6, 'paid': 3, 'finance_charge': 100, 'acq_fee': 0, 'payment': 25000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 75000, 'earned': 100}], ['control 4', {'term': 36, 'paid': 18, 'finance_charge': 100, 'acq_fee': 0, 'payment': 25000, 'min_rebate': 0}, {'rebate': 26, 'payoff': 449974, 'earned': 74}], ['control 5', {'term': 12, 'paid': 12, 'finance_charge': 50000, 'acq_fee': 2500, 'payment': 10000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 0, 'earned': 50000}], ['control 6', {'term': 24, 'paid': 1, 'finance_charge': 100, 'acq_fee': 7500, 'payment': 4321, 'min_rebate': 0}, {'rebate': 0, 'payoff': 99383, 'earned': 100}]], [['regression: total digits denominator', {'term': 24, 'paid': 12, 'finance_charge': 120000, 'acq_fee': 7500, 'payment': 25000, 'min_rebate': 500}, {'rebate': 29250, 'payoff': 270750, 'earned': 90750}], ['control 1', {'term': 24, 'paid': 12, 'finance_charge': 100, 'acq_fee': 0, 'payment': 4321, 'min_rebate': 500}, {'rebate': 0, 'payoff': 51852, 'earned': 100}], ['control 2', {'term': 36, 'paid': 0, 'finance_charge': 7777, 'acq_fee': 7500, 'payment': 25000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 900000, 'earned': 7777}], ['control 3', {'term': 36, 'paid': 36, 'finance_charge': 100, 'acq_fee': 7500, 'payment': 4321, 'min_rebate': 0}, {'rebate': 0, 'payoff': 0, 'earned': 100}], ['control 4', {'term': 12, 'paid': 0, 'finance_charge': 100, 'acq_fee': 0, 'payment': 25000, 'min_rebate': 500}, {'rebate': 0, 'payoff': 300000, 'earned': 100}], ['control 5', {'term': 12, 'paid': 12, 'finance_charge': 7777, 'acq_fee': 0, 'payment': 10000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 0, 'earned': 7777}], ['control 6', {'term': 6, 'paid': 5, 'finance_charge': 100, 'acq_fee': 7500, 'payment': 4321, 'min_rebate': 100}, {'rebate': 0, 'payoff': 4321, 'earned': 100}]]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'raised ' + type(exc).__name__\n    check(label, actual, 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":"d86d52bc6e11e99267f7cd645872a1ac97887874a4d228e664316c8581b32615","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    def rnd(n, d):\n        q, r = divmod(n, d)\n        return q + (1 if 2 * r >= d else 0)\n    n = x['term']\n    k = x['paid']\n    fc = x['finance_charge'] - x['acq_fee']\n    rem = n - k\n    rebate = rnd(fc * rem * (rem + 1), n * n)\n    if rebate < x['min_rebate']:\n        rebate = 0\n    remaining = x['payment'] * rem\n    return {'rebate': rebate, 'payoff': remaining - rebate, 'earned': x['finance_charge'] - rebate}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: total digits denominator', {'term': 36, 'paid': 35, 'finance_charge': 120000, 'acq_fee': 0, 'payment': 10000, 'min_rebate': 100}, {'rebate': 180, 'payoff': 9820, 'earned': 119820}], ['control 1', {'term': 36, 'paid': 35, 'finance_charge': 50000, 'acq_fee': 7500, 'payment': 25000, 'min_rebate': 100}, {'rebate': 0, 'payoff': 25000, 'earned': 50000}], ['control 2', {'term': 24, 'paid': 23, 'finance_charge': 100, 'acq_fee': 0, 'payment': 25000, 'min_rebate': 100}, {'rebate': 0, 'payoff': 25000, 'earned': 100}], ['control 3', {'term': 12, 'paid': 3, 'finance_charge': 100, 'acq_fee': 0, 'payment': 4321, 'min_rebate': 100}, {'rebate': 0, 'payoff': 38889, 'earned': 100}], ['control 4', {'term': 6, 'paid': 0, 'finance_charge': 100, 'acq_fee': 2500, 'payment': 10000, 'min_rebate': 0}, {'rebate': 0, 'payoff': 60000, 'earned': 100}], ['control 5', {'term': 24, 'paid': 12, 'finance_charge': 7777, 'acq_fee': 7500, 'payment': 4321, 'min_rebate': 500}, {'rebate': 0, 'payoff': 51852, 'earned': 7777}], ['control 6', {'term': 6, 'paid': 6, 'finance_charge': 7777, 'acq_fee': 2500, 'payment': 10000, 'min_rebate': 0}, {'rebate': 0, 'payoff': 0, 'earned': 7777}]], [['regression: total digits denominator', {'term': 36, 'paid': 3, 'finance_charge': 7777, 'acq_fee': 2500, 'payment': 10000, 'min_rebate': 500}, {'rebate': 4445, 'payoff': 325555, 'earned': 3332}], ['control 1', {'term': 12, 'paid': 1, 'finance_charge': 100, 'acq_fee': 0, 'payment': 10000, 'min_rebate': 100}, {'rebate': 0, 'payoff': 110000, 'earned': 100}], ['control 2', {'term': 24, 'paid': 24, 'finance_charge': 120000, 'acq_fee': 0, 'payment': 10000, 'min_rebate': 100}, {'rebate': 0, 'payoff': 0, 'earned': 120000}], ['control 3', {'term': 36, 'paid': 0, 'finance_charge': 100, 'acq_fee': 7500, 'payment': 25000, 'min_rebate': 500}, {'rebate': 0, 'payoff': 900000, 'earned': 100}], ['control 4', {'term': 24, 'paid': 12, 'finance_charge': 100, 'acq_fee': 2500, 'payment': 10000, 'min_rebate': 500}, {'rebate': 0, 'payoff': 120000, 'earned': 100}], ['control 5', {'term': 24, 'paid': 23, 'finance_charge': 120000, 'acq_fee': 0, 'payment': 4321, 'min_rebate': 500}, {'rebate': 0, 'payoff': 4321, 'earned': 120000}], ['control 6', {'term': 36, 'paid': 35, 'finance_charge': 7777, 'acq_fee': 2500, 'payment': 4321, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 4321, 'earned': 7777}]], [['regression: total digits denominator', {'term': 24, 'paid': 3, 'finance_charge': 120000, 'acq_fee': 0, 'payment': 10000, 'min_rebate': 2000}, {'rebate': 92400, 'payoff': 117600, 'earned': 27600}], ['control 1', {'term': 6, 'paid': 5, 'finance_charge': 100, 'acq_fee': 0, 'payment': 25000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 25000, 'earned': 100}], ['control 2', {'term': 12, 'paid': 12, 'finance_charge': 7777, 'acq_fee': 7500, 'payment': 10000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 0, 'earned': 7777}], ['control 3', {'term': 12, 'paid': 1, 'finance_charge': 100, 'acq_fee': 2500, 'payment': 25000, 'min_rebate': 0}, {'rebate': 0, 'payoff': 275000, 'earned': 100}], ['control 4', {'term': 24, 'paid': 24, 'finance_charge': 7777, 'acq_fee': 7500, 'payment': 10000, 'min_rebate': 0}, {'rebate': 0, 'payoff': 0, 'earned': 7777}], ['control 5', {'term': 36, 'paid': 18, 'finance_charge': 100, 'acq_fee': 2500, 'payment': 4321, 'min_rebate': 500}, {'rebate': 0, 'payoff': 77778, 'earned': 100}], ['control 6', {'term': 12, 'paid': 12, 'finance_charge': 100, 'acq_fee': 0, 'payment': 10000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 0, 'earned': 100}]], [['regression: total digits denominator', {'term': 12, 'paid': 0, 'finance_charge': 7777, 'acq_fee': 0, 'payment': 4321, 'min_rebate': 2000}, {'rebate': 7777, 'payoff': 44075, 'earned': 0}], ['control 1', {'term': 36, 'paid': 0, 'finance_charge': 100, 'acq_fee': 7500, 'payment': 25000, 'min_rebate': 500}, {'rebate': 0, 'payoff': 900000, 'earned': 100}], ['control 2', {'term': 12, 'paid': 12, 'finance_charge': 50000, 'acq_fee': 2500, 'payment': 10000, 'min_rebate': 0}, {'rebate': 0, 'payoff': 0, 'earned': 50000}], ['control 3', {'term': 6, 'paid': 3, 'finance_charge': 100, 'acq_fee': 0, 'payment': 25000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 75000, 'earned': 100}], ['control 4', {'term': 36, 'paid': 18, 'finance_charge': 100, 'acq_fee': 0, 'payment': 25000, 'min_rebate': 0}, {'rebate': 26, 'payoff': 449974, 'earned': 74}], ['control 5', {'term': 12, 'paid': 12, 'finance_charge': 50000, 'acq_fee': 2500, 'payment': 10000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 0, 'earned': 50000}], ['control 6', {'term': 24, 'paid': 1, 'finance_charge': 100, 'acq_fee': 7500, 'payment': 4321, 'min_rebate': 0}, {'rebate': 0, 'payoff': 99383, 'earned': 100}]], [['regression: total digits denominator', {'term': 24, 'paid': 12, 'finance_charge': 120000, 'acq_fee': 7500, 'payment': 25000, 'min_rebate': 500}, {'rebate': 29250, 'payoff': 270750, 'earned': 90750}], ['control 1', {'term': 24, 'paid': 12, 'finance_charge': 100, 'acq_fee': 0, 'payment': 4321, 'min_rebate': 500}, {'rebate': 0, 'payoff': 51852, 'earned': 100}], ['control 2', {'term': 36, 'paid': 0, 'finance_charge': 7777, 'acq_fee': 7500, 'payment': 25000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 900000, 'earned': 7777}], ['control 3', {'term': 36, 'paid': 36, 'finance_charge': 100, 'acq_fee': 7500, 'payment': 4321, 'min_rebate': 0}, {'rebate': 0, 'payoff': 0, 'earned': 100}], ['control 4', {'term': 12, 'paid': 0, 'finance_charge': 100, 'acq_fee': 0, 'payment': 25000, 'min_rebate': 500}, {'rebate': 0, 'payoff': 300000, 'earned': 100}], ['control 5', {'term': 12, 'paid': 12, 'finance_charge': 7777, 'acq_fee': 0, 'payment': 10000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 0, 'earned': 7777}], ['control 6', {'term': 6, 'paid': 5, 'finance_charge': 100, 'acq_fee': 7500, 'payment': 4321, 'min_rebate': 100}, {'rebate': 0, 'payoff': 4321, 'earned': 100}]]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'raised ' + type(exc).__name__\n    check(label, actual, 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":"e0f9c4d912e67af3afe68a3d01b673e4d2798628fd44864b55e69c22101b5494","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    def rnd(n, d):\n        q, r = divmod(n, d)\n        return q + (1 if 2 * r >= d else 0)\n    n = x['term']\n    k = x['paid']\n    fc = x['finance_charge'] - x['acq_fee']\n    rem = n - k\n    rebate = rnd(fc * rem * (rem + 1), n * (n + 1))\n    if rebate < x['min_rebate']:\n        rebate = 0\n    remaining = x['payment'] * rem\n    return {'rebate': rebate, 'payoff': remaining - rebate, 'earned': x['finance_charge'] - rebate}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['regression: total digits denominator', {'term': 36, 'paid': 35, 'finance_charge': 120000, 'acq_fee': 0, 'payment': 10000, 'min_rebate': 100}, {'rebate': 180, 'payoff': 9820, 'earned': 119820}], ['control 1', {'term': 36, 'paid': 35, 'finance_charge': 50000, 'acq_fee': 7500, 'payment': 25000, 'min_rebate': 100}, {'rebate': 0, 'payoff': 25000, 'earned': 50000}], ['control 2', {'term': 24, 'paid': 23, 'finance_charge': 100, 'acq_fee': 0, 'payment': 25000, 'min_rebate': 100}, {'rebate': 0, 'payoff': 25000, 'earned': 100}], ['control 3', {'term': 12, 'paid': 3, 'finance_charge': 100, 'acq_fee': 0, 'payment': 4321, 'min_rebate': 100}, {'rebate': 0, 'payoff': 38889, 'earned': 100}], ['control 4', {'term': 6, 'paid': 0, 'finance_charge': 100, 'acq_fee': 2500, 'payment': 10000, 'min_rebate': 0}, {'rebate': 0, 'payoff': 60000, 'earned': 100}], ['control 5', {'term': 24, 'paid': 12, 'finance_charge': 7777, 'acq_fee': 7500, 'payment': 4321, 'min_rebate': 500}, {'rebate': 0, 'payoff': 51852, 'earned': 7777}], ['control 6', {'term': 6, 'paid': 6, 'finance_charge': 7777, 'acq_fee': 2500, 'payment': 10000, 'min_rebate': 0}, {'rebate': 0, 'payoff': 0, 'earned': 7777}]], [['regression: total digits denominator', {'term': 36, 'paid': 3, 'finance_charge': 7777, 'acq_fee': 2500, 'payment': 10000, 'min_rebate': 500}, {'rebate': 4445, 'payoff': 325555, 'earned': 3332}], ['control 1', {'term': 12, 'paid': 1, 'finance_charge': 100, 'acq_fee': 0, 'payment': 10000, 'min_rebate': 100}, {'rebate': 0, 'payoff': 110000, 'earned': 100}], ['control 2', {'term': 24, 'paid': 24, 'finance_charge': 120000, 'acq_fee': 0, 'payment': 10000, 'min_rebate': 100}, {'rebate': 0, 'payoff': 0, 'earned': 120000}], ['control 3', {'term': 36, 'paid': 0, 'finance_charge': 100, 'acq_fee': 7500, 'payment': 25000, 'min_rebate': 500}, {'rebate': 0, 'payoff': 900000, 'earned': 100}], ['control 4', {'term': 24, 'paid': 12, 'finance_charge': 100, 'acq_fee': 2500, 'payment': 10000, 'min_rebate': 500}, {'rebate': 0, 'payoff': 120000, 'earned': 100}], ['control 5', {'term': 24, 'paid': 23, 'finance_charge': 120000, 'acq_fee': 0, 'payment': 4321, 'min_rebate': 500}, {'rebate': 0, 'payoff': 4321, 'earned': 120000}], ['control 6', {'term': 36, 'paid': 35, 'finance_charge': 7777, 'acq_fee': 2500, 'payment': 4321, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 4321, 'earned': 7777}]], [['regression: total digits denominator', {'term': 24, 'paid': 3, 'finance_charge': 120000, 'acq_fee': 0, 'payment': 10000, 'min_rebate': 2000}, {'rebate': 92400, 'payoff': 117600, 'earned': 27600}], ['control 1', {'term': 6, 'paid': 5, 'finance_charge': 100, 'acq_fee': 0, 'payment': 25000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 25000, 'earned': 100}], ['control 2', {'term': 12, 'paid': 12, 'finance_charge': 7777, 'acq_fee': 7500, 'payment': 10000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 0, 'earned': 7777}], ['control 3', {'term': 12, 'paid': 1, 'finance_charge': 100, 'acq_fee': 2500, 'payment': 25000, 'min_rebate': 0}, {'rebate': 0, 'payoff': 275000, 'earned': 100}], ['control 4', {'term': 24, 'paid': 24, 'finance_charge': 7777, 'acq_fee': 7500, 'payment': 10000, 'min_rebate': 0}, {'rebate': 0, 'payoff': 0, 'earned': 7777}], ['control 5', {'term': 36, 'paid': 18, 'finance_charge': 100, 'acq_fee': 2500, 'payment': 4321, 'min_rebate': 500}, {'rebate': 0, 'payoff': 77778, 'earned': 100}], ['control 6', {'term': 12, 'paid': 12, 'finance_charge': 100, 'acq_fee': 0, 'payment': 10000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 0, 'earned': 100}]], [['regression: total digits denominator', {'term': 12, 'paid': 0, 'finance_charge': 7777, 'acq_fee': 0, 'payment': 4321, 'min_rebate': 2000}, {'rebate': 7777, 'payoff': 44075, 'earned': 0}], ['control 1', {'term': 36, 'paid': 0, 'finance_charge': 100, 'acq_fee': 7500, 'payment': 25000, 'min_rebate': 500}, {'rebate': 0, 'payoff': 900000, 'earned': 100}], ['control 2', {'term': 12, 'paid': 12, 'finance_charge': 50000, 'acq_fee': 2500, 'payment': 10000, 'min_rebate': 0}, {'rebate': 0, 'payoff': 0, 'earned': 50000}], ['control 3', {'term': 6, 'paid': 3, 'finance_charge': 100, 'acq_fee': 0, 'payment': 25000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 75000, 'earned': 100}], ['control 4', {'term': 36, 'paid': 18, 'finance_charge': 100, 'acq_fee': 0, 'payment': 25000, 'min_rebate': 0}, {'rebate': 26, 'payoff': 449974, 'earned': 74}], ['control 5', {'term': 12, 'paid': 12, 'finance_charge': 50000, 'acq_fee': 2500, 'payment': 10000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 0, 'earned': 50000}], ['control 6', {'term': 24, 'paid': 1, 'finance_charge': 100, 'acq_fee': 7500, 'payment': 4321, 'min_rebate': 0}, {'rebate': 0, 'payoff': 99383, 'earned': 100}]], [['regression: total digits denominator', {'term': 24, 'paid': 12, 'finance_charge': 120000, 'acq_fee': 7500, 'payment': 25000, 'min_rebate': 500}, {'rebate': 29250, 'payoff': 270750, 'earned': 90750}], ['control 1', {'term': 24, 'paid': 12, 'finance_charge': 100, 'acq_fee': 0, 'payment': 4321, 'min_rebate': 500}, {'rebate': 0, 'payoff': 51852, 'earned': 100}], ['control 2', {'term': 36, 'paid': 0, 'finance_charge': 7777, 'acq_fee': 7500, 'payment': 25000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 900000, 'earned': 7777}], ['control 3', {'term': 36, 'paid': 36, 'finance_charge': 100, 'acq_fee': 7500, 'payment': 4321, 'min_rebate': 0}, {'rebate': 0, 'payoff': 0, 'earned': 100}], ['control 4', {'term': 12, 'paid': 0, 'finance_charge': 100, 'acq_fee': 0, 'payment': 25000, 'min_rebate': 500}, {'rebate': 0, 'payoff': 300000, 'earned': 100}], ['control 5', {'term': 12, 'paid': 12, 'finance_charge': 7777, 'acq_fee': 0, 'payment': 10000, 'min_rebate': 2000}, {'rebate': 0, 'payoff': 0, 'earned': 7777}], ['control 6', {'term': 6, 'paid': 5, 'finance_charge': 100, 'acq_fee': 7500, 'payment': 4321, 'min_rebate': 100}, {'rebate': 0, 'payoff': 4321, 'earned': 100}]]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'raised ' + type(exc).__name__\n    check(label, actual, 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":"A deterministic bounded teaching model with stipulated toy lending rules stated in the contract; money is integer cents and rates are basis points; it makes no claim of conformance to any regulation, servicing standard or product. 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-loan-amortization-schedules-rule-of-78-rebate-total-digits-denominator","generated_at":"2026-09-29T14:46:28.490413+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Amortization engines drive borrower statements, payoff quotes and investor remittances; a misplaced rounding step, boundary or ordering rule compounds across hundreds of periods.","repair":"Divide by n(n+1).","root_cause":"The denominator uses n squared.","sha256":"710f3f5c625ad6a4bae9c815d927f2cf5d7fe4b3f6ab864856e95b115abeff96","title":"Rule of 78s early payoff rebate: total digits denominator · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":40.582,"exit_code":1,"observations":[{"actual":{"earned":119640,"payoff":9640,"rebate":360},"check":"regression: total digits denominator","expected":{"earned":119820,"payoff":9820,"rebate":180},"passed":false},{"actual":{"earned":49872,"payoff":24872,"rebate":128},"check":"control 1","expected":{"earned":50000,"payoff":25000,"rebate":0},"passed":false},{"actual":{"earned":100,"payoff":25000,"rebate":0},"check":"control 2","expected":{"earned":100,"payoff":25000,"rebate":0},"passed":true},{"actual":{"earned":-15,"payoff":38774,"rebate":115},"check":"control 3","expected":{"earned":100,"payoff":38889,"rebate":0},"passed":false},{"actual":{"earned":100,"payoff":60000,"rebate":0},"check":"control 4","expected":{"earned":100,"payoff":60000,"rebate":0},"passed":true},{"actual":{"earned":7777,"payoff":51852,"rebate":0},"check":"control 5","expected":{"earned":7777,"payoff":51852,"rebate":0},"passed":true},{"actual":{"earned":7777,"payoff":0,"rebate":0},"check":"control 6","expected":{"earned":7777,"payoff":0,"rebate":0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: total digits denominator\", \"actual\": {\"rebate\": 360, \"payoff\": 9640, \"earned\": 119640}, \"expected\": {\"rebate\": 180, \"payoff\": 9820, \"earned\": 119820}, \"passed\": false}, {\"check\": \"control 1\", \"actual\": {\"rebate\": 128, \"payoff\": 24872, \"earned\": 49872}, \"expected\": {\"rebate\": 0, \"payoff\": 25000, \"earned\": 50000}, \"passed\": false}, {\"check\": \"control 2\", \"actual\": {\"rebate\": 0, \"payoff\": 25000, \"earned\": 100}, \"expected\": {\"rebate\": 0, \"payoff\": 25000, \"earned\": 100}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"rebate\": 115, \"payoff\": 38774, \"earned\": -15}, \"expected\": {\"rebate\": 0, \"payoff\": 38889, \"earned\": 100}, \"passed\": false}, {\"check\": \"control 4\", \"actual\": {\"rebate\": 0, \"payoff\": 60000, \"earned\": 100}, \"expected\": {\"rebate\": 0, \"payoff\": 60000, \"earned\": 100}, \"passed\": true}, {\"check\": \"control 5\", \"actual\": {\"rebate\": 0, \"payoff\": 51852, \"earned\": 7777}, \"expected\": {\"rebate\": 0, \"payoff\": 51852, \"earned\": 7777}, \"passed\": true}, {\"check\": \"control 6\", \"actual\": {\"rebate\": 0, \"payoff\": 0, \"earned\": 7777}, \"expected\": {\"rebate\": 0, \"payoff\": 0, \"earned\": 7777}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.147,"exit_code":1,"observations":[{"actual":{"earned":119815,"payoff":9815,"rebate":185},"check":"regression: total digits denominator","expected":{"earned":119820,"payoff":9820,"rebate":180},"passed":false},{"actual":{"earned":50000,"payoff":25000,"rebate":0},"check":"control 1","expected":{"earned":50000,"payoff":25000,"rebate":0},"passed":true},{"actual":{"earned":100,"payoff":25000,"rebate":0},"check":"control 2","expected":{"earned":100,"payoff":25000,"rebate":0},"passed":true},{"actual":{"earned":100,"payoff":38889,"rebate":0},"check":"control 3","expected":{"earned":100,"payoff":38889,"rebate":0},"passed":true},{"actual":{"earned":100,"payoff":60000,"rebate":0},"check":"control 4","expected":{"earned":100,"payoff":60000,"rebate":0},"passed":true},{"actual":{"earned":7777,"payoff":51852,"rebate":0},"check":"control 5","expected":{"earned":7777,"payoff":51852,"rebate":0},"passed":true},{"actual":{"earned":7777,"payoff":0,"rebate":0},"check":"control 6","expected":{"earned":7777,"payoff":0,"rebate":0},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: total digits denominator\", \"actual\": {\"rebate\": 185, \"payoff\": 9815, \"earned\": 119815}, \"expected\": {\"rebate\": 180, \"payoff\": 9820, \"earned\": 119820}, \"passed\": false}, {\"check\": \"control 1\", \"actual\": {\"rebate\": 0, \"payoff\": 25000, \"earned\": 50000}, \"expected\": {\"rebate\": 0, \"payoff\": 25000, \"earned\": 50000}, \"passed\": true}, {\"check\": \"control 2\", \"actual\": {\"rebate\": 0, \"payoff\": 25000, \"earned\": 100}, \"expected\": {\"rebate\": 0, \"payoff\": 25000, \"earned\": 100}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"rebate\": 0, \"payoff\": 38889, \"earned\": 100}, \"expected\": {\"rebate\": 0, \"payoff\": 38889, \"earned\": 100}, \"passed\": true}, {\"check\": \"control 4\", \"actual\": {\"rebate\": 0, \"payoff\": 60000, \"earned\": 100}, \"expected\": {\"rebate\": 0, \"payoff\": 60000, \"earned\": 100}, \"passed\": true}, {\"check\": \"control 5\", \"actual\": {\"rebate\": 0, \"payoff\": 51852, \"earned\": 7777}, \"expected\": {\"rebate\": 0, \"payoff\": 51852, \"earned\": 7777}, \"passed\": true}, {\"check\": \"control 6\", \"actual\": {\"rebate\": 0, \"payoff\": 0, \"earned\": 7777}, \"expected\": {\"rebate\": 0, \"payoff\": 0, \"earned\": 7777}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.531,"exit_code":0,"observations":[{"actual":{"earned":119820,"payoff":9820,"rebate":180},"check":"regression: total digits denominator","expected":{"earned":119820,"payoff":9820,"rebate":180},"passed":true},{"actual":{"earned":50000,"payoff":25000,"rebate":0},"check":"control 1","expected":{"earned":50000,"payoff":25000,"rebate":0},"passed":true},{"actual":{"earned":100,"payoff":25000,"rebate":0},"check":"control 2","expected":{"earned":100,"payoff":25000,"rebate":0},"passed":true},{"actual":{"earned":100,"payoff":38889,"rebate":0},"check":"control 3","expected":{"earned":100,"payoff":38889,"rebate":0},"passed":true},{"actual":{"earned":100,"payoff":60000,"rebate":0},"check":"control 4","expected":{"earned":100,"payoff":60000,"rebate":0},"passed":true},{"actual":{"earned":7777,"payoff":51852,"rebate":0},"check":"control 5","expected":{"earned":7777,"payoff":51852,"rebate":0},"passed":true},{"actual":{"earned":7777,"payoff":0,"rebate":0},"check":"control 6","expected":{"earned":7777,"payoff":0,"rebate":0},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"regression: total digits denominator\", \"actual\": {\"rebate\": 180, \"payoff\": 9820, \"earned\": 119820}, \"expected\": {\"rebate\": 180, \"payoff\": 9820, \"earned\": 119820}, \"passed\": true}, {\"check\": \"control 1\", \"actual\": {\"rebate\": 0, \"payoff\": 25000, \"earned\": 50000}, \"expected\": {\"rebate\": 0, \"payoff\": 25000, \"earned\": 50000}, \"passed\": true}, {\"check\": \"control 2\", \"actual\": {\"rebate\": 0, \"payoff\": 25000, \"earned\": 100}, \"expected\": {\"rebate\": 0, \"payoff\": 25000, \"earned\": 100}, \"passed\": true}, {\"check\": \"control 3\", \"actual\": {\"rebate\": 0, \"payoff\": 38889, \"earned\": 100}, \"expected\": {\"rebate\": 0, \"payoff\": 38889, \"earned\": 100}, \"passed\": true}, {\"check\": \"control 4\", \"actual\": {\"rebate\": 0, \"payoff\": 60000, \"earned\": 100}, \"expected\": {\"rebate\": 0, \"payoff\": 60000, \"earned\": 100}, \"passed\": true}, {\"check\": \"control 5\", \"actual\": {\"rebate\": 0, \"payoff\": 51852, \"earned\": 7777}, \"expected\": {\"rebate\": 0, \"payoff\": 51852, \"earned\": 7777}, \"passed\": true}, {\"check\": \"control 6\", \"actual\": {\"rebate\": 0, \"payoff\": 0, \"earned\": 7777}, \"expected\": {\"rebate\": 0, \"payoff\": 0, \"earned\": 7777}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}