{"abstract":"Capped or floored retro premiums exceed the plan bounds by the tax multiplier.","category":"Insurance premium rating","checks":9,"contract":"Input standard premium, basic, lcf, tax (x1000), min and max (per mille of standard), loss_limit, claims (negative = recovery). max<min -> 'invalid bounds'. Limited losses = max(0, sum(min(claim, limit))). Retro = (standard*basic + limited*lcf)*tax, bounded by [standard*min, standard*max] (bounds already include tax), rounded half-up. Return [limited, retro].","evaluation_group":"w2-insurance_premium_rating-retro-rating","failed_approach":"Taxing the bounds too still moves them away from the filed minimum and maximum.","family":"w2-insurance_premium_rating-retro-rating-tax-and-bounds-order","id":"FA-63221","implementations":{"attempt":{"sha256":"84a336220c1e4a5c845028fbae9bf11e70e09e3108927e85f9c34784c30686e0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    sp=x['standard']\n    if x['max']<x['min']: return 'invalid bounds'\n    lim=max(0,sum(min(c,x['loss_limit']) for c in x['claims']))\n    basic=Fraction(sp*x['basic'],1000)\n    retro=(basic+Fraction(lim*x['lcf'],1000))*Fraction(x['tax'],1000)\n    lo=Fraction(sp*x['min'],1000)*Fraction(x['tax'],1000); hi=Fraction(sp*x['max'],1000)*Fraction(x['tax'],1000)\n    retro=max(lo,min(hi,retro))\n    return [lim, math.floor(retro+Fraction(1,2))]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['moderate losses between bounds', {'standard': 1208187, 'basic': 250, 'lcf': 1100, 'tax': 1030, 'min': 400, 'max': 2000, 'loss_limit': 5000000, 'claims': [65251, 117766, 199866, 72604]}, [455487, 827175]], ['large claim limited', {'standard': 1536795, 'basic': 250, 'lcf': 1100, 'tax': 1050, 'min': 600, 'max': 3000, 'loss_limit': 5000000, 'claims': [7899385, 85219]}, [5085219, 4610385]], ['maximum binds', {'standard': 576969, 'basic': 250, 'lcf': 1100, 'tax': 1030, 'min': 500, 'max': 1200, 'loss_limit': 5000000, 'claims': [3887820, 3676391, 3519603, 3011895]}, [14095709, 692363]], ['no losses minimum binds', {'standard': 783317, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 500, 'max': 1400, 'loss_limit': 5000000, 'claims': []}, [0, 391659]], ['subrogation recovery offsets', {'standard': 1402360, 'basic': 200, 'lcf': 1200, 'tax': 1050, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [299401, -71949]}, [227452, 581085]], ['net recovery floors at zero', {'standard': 1970882, 'basic': 200, 'lcf': 1150, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [-13900]}, [0, 591265]], ['inverted bounds rejected', {'standard': 857821, 'basic': 200, 'lcf': 1150, 'tax': 1030, 'min': 1300, 'max': 1200, 'loss_limit': 5000000, 'claims': [100000]}, 'invalid bounds'], ['flat plan with equal bounds', {'standard': 1032758, 'basic': 250, 'lcf': 1200, 'tax': 1030, 'min': 900, 'max': 900, 'loss_limit': 5000000, 'claims': [100000]}, [100000, 929482]], ['near-minimum losses', {'standard': 1037917, 'basic': 250, 'lcf': 1200, 'tax': 1030, 'min': 450, 'max': 1800, 'loss_limit': 5000000, 'claims': [196003]}, [196003, 509523]]], [['moderate losses between bounds', {'standard': 559811, 'basic': 250, 'lcf': 1150, 'tax': 1030, 'min': 400, 'max': 2000, 'loss_limit': 5000000, 'claims': [168808, 170340, 188681, 153930]}, [681759, 951695]], ['large claim limited', {'standard': 1398667, 'basic': 200, 'lcf': 1150, 'tax': 1030, 'min': 500, 'max': 3000, 'loss_limit': 5000000, 'claims': [8563900, 72244]}, [5072244, 4196001]], ['maximum binds', {'standard': 1860838, 'basic': 250, 'lcf': 1100, 'tax': 1050, 'min': 600, 'max': 1200, 'loss_limit': 5000000, 'claims': [3974702, 2021857, 3323996, 2741110]}, [12061665, 2233006]], ['no losses minimum binds', {'standard': 1054836, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 500, 'max': 1400, 'loss_limit': 5000000, 'claims': []}, [0, 527418]], ['subrogation recovery offsets', {'standard': 572933, 'basic': 250, 'lcf': 1150, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [215865, -67794]}, [148071, 322920]], ['net recovery floors at zero', {'standard': 1415569, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [-23951]}, [0, 424671]], ['inverted bounds rejected', {'standard': 1885857, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 1300, 'max': 1200, 'loss_limit': 5000000, 'claims': [100000]}, 'invalid bounds'], ['flat plan with equal bounds', {'standard': 1658903, 'basic': 200, 'lcf': 1200, 'tax': 1050, 'min': 900, 'max': 900, 'loss_limit': 5000000, 'claims': [100000]}, [100000, 1493013]], ['near-minimum losses', {'standard': 1831216, 'basic': 250, 'lcf': 1150, 'tax': 1030, 'min': 450, 'max': 1800, 'loss_limit': 5000000, 'claims': [255597]}, [255597, 824047]]], [['moderate losses between bounds', {'standard': 1953166, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 400, 'max': 2000, 'loss_limit': 5000000, 'claims': [130486, 146045, 106267, 80838]}, [463636, 970005]], ['large claim limited', {'standard': 1375996, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 600, 'max': 3000, 'loss_limit': 5000000, 'claims': [8850428, 26063]}, [5026063, 4127988]], ['maximum binds', {'standard': 1822101, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 600, 'max': 1200, 'loss_limit': 5000000, 'claims': [3010425, 2467545, 2177771, 3447891]}, [11103632, 2186521]], ['no losses minimum binds', {'standard': 1516833, 'basic': 200, 'lcf': 1100, 'tax': 1050, 'min': 500, 'max': 1400, 'loss_limit': 5000000, 'claims': []}, [0, 758417]], ['subrogation recovery offsets', {'standard': 714829, 'basic': 200, 'lcf': 1100, 'tax': 1050, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [292326, -101272]}, [191054, 370781]], ['net recovery floors at zero', {'standard': 1501098, 'basic': 200, 'lcf': 1100, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [-22616]}, [0, 450329]], ['inverted bounds rejected', {'standard': 696781, 'basic': 200, 'lcf': 1200, 'tax': 1050, 'min': 1300, 'max': 1200, 'loss_limit': 5000000, 'claims': [100000]}, 'invalid bounds'], ['flat plan with equal bounds', {'standard': 802028, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 900, 'max': 900, 'loss_limit': 5000000, 'claims': [100000]}, [100000, 721825]], ['near-minimum losses', {'standard': 715359, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 450, 'max': 1800, 'loss_limit': 5000000, 'claims': [161153]}, [161153, 346549]]], [['moderate losses between bounds', {'standard': 714988, 'basic': 200, 'lcf': 1200, 'tax': 1050, 'min': 400, 'max': 2000, 'loss_limit': 5000000, 'claims': [147807, 50783, 101639, 147624]}, [447853, 714442]], ['large claim limited', {'standard': 1075364, 'basic': 200, 'lcf': 1100, 'tax': 1050, 'min': 600, 'max': 3000, 'loss_limit': 5000000, 'claims': [6621396, 51697]}, [5051697, 3226092]], ['maximum binds', {'standard': 636493, 'basic': 250, 'lcf': 1200, 'tax': 1050, 'min': 500, 'max': 1200, 'loss_limit': 5000000, 'claims': [3206066, 2811387, 2370852, 2596520]}, [10984825, 763792]], ['no losses minimum binds', {'standard': 1974481, 'basic': 200, 'lcf': 1200, 'tax': 1050, 'min': 500, 'max': 1600, 'loss_limit': 5000000, 'claims': []}, [0, 987241]], ['subrogation recovery offsets', {'standard': 1092045, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [210597, -95806]}, [114791, 366843]], ['net recovery floors at zero', {'standard': 1088467, 'basic': 250, 'lcf': 1200, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [-13789]}, [0, 326540]], ['inverted bounds rejected', {'standard': 1508678, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 1300, 'max': 1200, 'loss_limit': 5000000, 'claims': [100000]}, 'invalid bounds'], ['flat plan with equal bounds', {'standard': 811592, 'basic': 250, 'lcf': 1200, 'tax': 1050, 'min': 900, 'max': 900, 'loss_limit': 5000000, 'claims': [100000]}, [100000, 730433]], ['near-minimum losses', {'standard': 1513685, 'basic': 200, 'lcf': 1100, 'tax': 1050, 'min': 450, 'max': 1800, 'loss_limit': 5000000, 'claims': [237641]}, [237641, 681158]]], [['moderate losses between bounds', {'standard': 1863348, 'basic': 250, 'lcf': 1200, 'tax': 1050, 'min': 400, 'max': 2000, 'loss_limit': 5000000, 'claims': [182396, 119506, 129126, 64521]}, [495549, 1113521]], ['large claim limited', {'standard': 1794820, 'basic': 200, 'lcf': 1100, 'tax': 1030, 'min': 500, 'max': 3000, 'loss_limit': 5000000, 'claims': [6997029, 30223]}, [5030223, 5384460]], ['maximum binds', {'standard': 1446879, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 500, 'max': 1200, 'loss_limit': 5000000, 'claims': [3226070, 2149089, 2381869, 2566788]}, [10323816, 1736255]], ['no losses minimum binds', {'standard': 1111989, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 500, 'max': 1400, 'loss_limit': 5000000, 'claims': []}, [0, 555995]], ['subrogation recovery offsets', {'standard': 930668, 'basic': 250, 'lcf': 1150, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [215001, -125166]}, [89835, 346057]], ['net recovery floors at zero', {'standard': 790663, 'basic': 200, 'lcf': 1100, 'tax': 1050, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [-24524]}, [0, 237199]], ['inverted bounds rejected', {'standard': 901935, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 1300, 'max': 1200, 'loss_limit': 5000000, 'claims': [100000]}, 'invalid bounds'], ['flat plan with equal bounds', {'standard': 802066, 'basic': 250, 'lcf': 1150, 'tax': 1050, 'min': 900, 'max': 900, 'loss_limit': 5000000, 'claims': [100000]}, [100000, 721859]], ['near-minimum losses', {'standard': 1352189, 'basic': 250, 'lcf': 1150, 'tax': 1050, 'min': 450, 'max': 1800, 'loss_limit': 5000000, 'claims': [178467]}, [178467, 608485]]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(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":"5f85e8d30f5510fcd4e141b0ea592bc97aa062eabcd3560fa618765e0f8a96c4","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    sp=x['standard']\n    if x['max']<x['min']: return 'invalid bounds'\n    lim=max(0,sum(min(c,x['loss_limit']) for c in x['claims']))\n    basic=Fraction(sp*x['basic'],1000)\n    retro=basic+Fraction(lim*x['lcf'],1000)\n    lo=Fraction(sp*x['min'],1000); hi=Fraction(sp*x['max'],1000)\n    retro=max(lo,min(hi,retro))*Fraction(x['tax'],1000)\n    return [lim, math.floor(retro+Fraction(1,2))]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['moderate losses between bounds', {'standard': 1208187, 'basic': 250, 'lcf': 1100, 'tax': 1030, 'min': 400, 'max': 2000, 'loss_limit': 5000000, 'claims': [65251, 117766, 199866, 72604]}, [455487, 827175]], ['large claim limited', {'standard': 1536795, 'basic': 250, 'lcf': 1100, 'tax': 1050, 'min': 600, 'max': 3000, 'loss_limit': 5000000, 'claims': [7899385, 85219]}, [5085219, 4610385]], ['maximum binds', {'standard': 576969, 'basic': 250, 'lcf': 1100, 'tax': 1030, 'min': 500, 'max': 1200, 'loss_limit': 5000000, 'claims': [3887820, 3676391, 3519603, 3011895]}, [14095709, 692363]], ['no losses minimum binds', {'standard': 783317, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 500, 'max': 1400, 'loss_limit': 5000000, 'claims': []}, [0, 391659]], ['subrogation recovery offsets', {'standard': 1402360, 'basic': 200, 'lcf': 1200, 'tax': 1050, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [299401, -71949]}, [227452, 581085]], ['net recovery floors at zero', {'standard': 1970882, 'basic': 200, 'lcf': 1150, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [-13900]}, [0, 591265]], ['inverted bounds rejected', {'standard': 857821, 'basic': 200, 'lcf': 1150, 'tax': 1030, 'min': 1300, 'max': 1200, 'loss_limit': 5000000, 'claims': [100000]}, 'invalid bounds'], ['flat plan with equal bounds', {'standard': 1032758, 'basic': 250, 'lcf': 1200, 'tax': 1030, 'min': 900, 'max': 900, 'loss_limit': 5000000, 'claims': [100000]}, [100000, 929482]], ['near-minimum losses', {'standard': 1037917, 'basic': 250, 'lcf': 1200, 'tax': 1030, 'min': 450, 'max': 1800, 'loss_limit': 5000000, 'claims': [196003]}, [196003, 509523]]], [['moderate losses between bounds', {'standard': 559811, 'basic': 250, 'lcf': 1150, 'tax': 1030, 'min': 400, 'max': 2000, 'loss_limit': 5000000, 'claims': [168808, 170340, 188681, 153930]}, [681759, 951695]], ['large claim limited', {'standard': 1398667, 'basic': 200, 'lcf': 1150, 'tax': 1030, 'min': 500, 'max': 3000, 'loss_limit': 5000000, 'claims': [8563900, 72244]}, [5072244, 4196001]], ['maximum binds', {'standard': 1860838, 'basic': 250, 'lcf': 1100, 'tax': 1050, 'min': 600, 'max': 1200, 'loss_limit': 5000000, 'claims': [3974702, 2021857, 3323996, 2741110]}, [12061665, 2233006]], ['no losses minimum binds', {'standard': 1054836, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 500, 'max': 1400, 'loss_limit': 5000000, 'claims': []}, [0, 527418]], ['subrogation recovery offsets', {'standard': 572933, 'basic': 250, 'lcf': 1150, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [215865, -67794]}, [148071, 322920]], ['net recovery floors at zero', {'standard': 1415569, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [-23951]}, [0, 424671]], ['inverted bounds rejected', {'standard': 1885857, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 1300, 'max': 1200, 'loss_limit': 5000000, 'claims': [100000]}, 'invalid bounds'], ['flat plan with equal bounds', {'standard': 1658903, 'basic': 200, 'lcf': 1200, 'tax': 1050, 'min': 900, 'max': 900, 'loss_limit': 5000000, 'claims': [100000]}, [100000, 1493013]], ['near-minimum losses', {'standard': 1831216, 'basic': 250, 'lcf': 1150, 'tax': 1030, 'min': 450, 'max': 1800, 'loss_limit': 5000000, 'claims': [255597]}, [255597, 824047]]], [['moderate losses between bounds', {'standard': 1953166, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 400, 'max': 2000, 'loss_limit': 5000000, 'claims': [130486, 146045, 106267, 80838]}, [463636, 970005]], ['large claim limited', {'standard': 1375996, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 600, 'max': 3000, 'loss_limit': 5000000, 'claims': [8850428, 26063]}, [5026063, 4127988]], ['maximum binds', {'standard': 1822101, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 600, 'max': 1200, 'loss_limit': 5000000, 'claims': [3010425, 2467545, 2177771, 3447891]}, [11103632, 2186521]], ['no losses minimum binds', {'standard': 1516833, 'basic': 200, 'lcf': 1100, 'tax': 1050, 'min': 500, 'max': 1400, 'loss_limit': 5000000, 'claims': []}, [0, 758417]], ['subrogation recovery offsets', {'standard': 714829, 'basic': 200, 'lcf': 1100, 'tax': 1050, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [292326, -101272]}, [191054, 370781]], ['net recovery floors at zero', {'standard': 1501098, 'basic': 200, 'lcf': 1100, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [-22616]}, [0, 450329]], ['inverted bounds rejected', {'standard': 696781, 'basic': 200, 'lcf': 1200, 'tax': 1050, 'min': 1300, 'max': 1200, 'loss_limit': 5000000, 'claims': [100000]}, 'invalid bounds'], ['flat plan with equal bounds', {'standard': 802028, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 900, 'max': 900, 'loss_limit': 5000000, 'claims': [100000]}, [100000, 721825]], ['near-minimum losses', {'standard': 715359, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 450, 'max': 1800, 'loss_limit': 5000000, 'claims': [161153]}, [161153, 346549]]], [['moderate losses between bounds', {'standard': 714988, 'basic': 200, 'lcf': 1200, 'tax': 1050, 'min': 400, 'max': 2000, 'loss_limit': 5000000, 'claims': [147807, 50783, 101639, 147624]}, [447853, 714442]], ['large claim limited', {'standard': 1075364, 'basic': 200, 'lcf': 1100, 'tax': 1050, 'min': 600, 'max': 3000, 'loss_limit': 5000000, 'claims': [6621396, 51697]}, [5051697, 3226092]], ['maximum binds', {'standard': 636493, 'basic': 250, 'lcf': 1200, 'tax': 1050, 'min': 500, 'max': 1200, 'loss_limit': 5000000, 'claims': [3206066, 2811387, 2370852, 2596520]}, [10984825, 763792]], ['no losses minimum binds', {'standard': 1974481, 'basic': 200, 'lcf': 1200, 'tax': 1050, 'min': 500, 'max': 1600, 'loss_limit': 5000000, 'claims': []}, [0, 987241]], ['subrogation recovery offsets', {'standard': 1092045, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [210597, -95806]}, [114791, 366843]], ['net recovery floors at zero', {'standard': 1088467, 'basic': 250, 'lcf': 1200, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [-13789]}, [0, 326540]], ['inverted bounds rejected', {'standard': 1508678, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 1300, 'max': 1200, 'loss_limit': 5000000, 'claims': [100000]}, 'invalid bounds'], ['flat plan with equal bounds', {'standard': 811592, 'basic': 250, 'lcf': 1200, 'tax': 1050, 'min': 900, 'max': 900, 'loss_limit': 5000000, 'claims': [100000]}, [100000, 730433]], ['near-minimum losses', {'standard': 1513685, 'basic': 200, 'lcf': 1100, 'tax': 1050, 'min': 450, 'max': 1800, 'loss_limit': 5000000, 'claims': [237641]}, [237641, 681158]]], [['moderate losses between bounds', {'standard': 1863348, 'basic': 250, 'lcf': 1200, 'tax': 1050, 'min': 400, 'max': 2000, 'loss_limit': 5000000, 'claims': [182396, 119506, 129126, 64521]}, [495549, 1113521]], ['large claim limited', {'standard': 1794820, 'basic': 200, 'lcf': 1100, 'tax': 1030, 'min': 500, 'max': 3000, 'loss_limit': 5000000, 'claims': [6997029, 30223]}, [5030223, 5384460]], ['maximum binds', {'standard': 1446879, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 500, 'max': 1200, 'loss_limit': 5000000, 'claims': [3226070, 2149089, 2381869, 2566788]}, [10323816, 1736255]], ['no losses minimum binds', {'standard': 1111989, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 500, 'max': 1400, 'loss_limit': 5000000, 'claims': []}, [0, 555995]], ['subrogation recovery offsets', {'standard': 930668, 'basic': 250, 'lcf': 1150, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [215001, -125166]}, [89835, 346057]], ['net recovery floors at zero', {'standard': 790663, 'basic': 200, 'lcf': 1100, 'tax': 1050, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [-24524]}, [0, 237199]], ['inverted bounds rejected', {'standard': 901935, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 1300, 'max': 1200, 'loss_limit': 5000000, 'claims': [100000]}, 'invalid bounds'], ['flat plan with equal bounds', {'standard': 802066, 'basic': 250, 'lcf': 1150, 'tax': 1050, 'min': 900, 'max': 900, 'loss_limit': 5000000, 'claims': [100000]}, [100000, 721859]], ['near-minimum losses', {'standard': 1352189, 'basic': 250, 'lcf': 1150, 'tax': 1050, 'min': 450, 'max': 1800, 'loss_limit': 5000000, 'claims': [178467]}, [178467, 608485]]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(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":"50ab36a8a2313497decc30cf1f6ce97e562ded9227f7081a2c916606fe9b4e4e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nfrom fractions import Fraction\nN = 1\nobservations = []\ndef solve(x):\n    sp=x['standard']\n    if x['max']<x['min']: return 'invalid bounds'\n    lim=max(0,sum(min(c,x['loss_limit']) for c in x['claims']))\n    basic=Fraction(sp*x['basic'],1000)\n    retro=(basic+Fraction(lim*x['lcf'],1000))*Fraction(x['tax'],1000)\n    lo=Fraction(sp*x['min'],1000); hi=Fraction(sp*x['max'],1000)\n    retro=max(lo,min(hi,retro))\n    return [lim, math.floor(retro+Fraction(1,2))]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[['moderate losses between bounds', {'standard': 1208187, 'basic': 250, 'lcf': 1100, 'tax': 1030, 'min': 400, 'max': 2000, 'loss_limit': 5000000, 'claims': [65251, 117766, 199866, 72604]}, [455487, 827175]], ['large claim limited', {'standard': 1536795, 'basic': 250, 'lcf': 1100, 'tax': 1050, 'min': 600, 'max': 3000, 'loss_limit': 5000000, 'claims': [7899385, 85219]}, [5085219, 4610385]], ['maximum binds', {'standard': 576969, 'basic': 250, 'lcf': 1100, 'tax': 1030, 'min': 500, 'max': 1200, 'loss_limit': 5000000, 'claims': [3887820, 3676391, 3519603, 3011895]}, [14095709, 692363]], ['no losses minimum binds', {'standard': 783317, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 500, 'max': 1400, 'loss_limit': 5000000, 'claims': []}, [0, 391659]], ['subrogation recovery offsets', {'standard': 1402360, 'basic': 200, 'lcf': 1200, 'tax': 1050, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [299401, -71949]}, [227452, 581085]], ['net recovery floors at zero', {'standard': 1970882, 'basic': 200, 'lcf': 1150, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [-13900]}, [0, 591265]], ['inverted bounds rejected', {'standard': 857821, 'basic': 200, 'lcf': 1150, 'tax': 1030, 'min': 1300, 'max': 1200, 'loss_limit': 5000000, 'claims': [100000]}, 'invalid bounds'], ['flat plan with equal bounds', {'standard': 1032758, 'basic': 250, 'lcf': 1200, 'tax': 1030, 'min': 900, 'max': 900, 'loss_limit': 5000000, 'claims': [100000]}, [100000, 929482]], ['near-minimum losses', {'standard': 1037917, 'basic': 250, 'lcf': 1200, 'tax': 1030, 'min': 450, 'max': 1800, 'loss_limit': 5000000, 'claims': [196003]}, [196003, 509523]]], [['moderate losses between bounds', {'standard': 559811, 'basic': 250, 'lcf': 1150, 'tax': 1030, 'min': 400, 'max': 2000, 'loss_limit': 5000000, 'claims': [168808, 170340, 188681, 153930]}, [681759, 951695]], ['large claim limited', {'standard': 1398667, 'basic': 200, 'lcf': 1150, 'tax': 1030, 'min': 500, 'max': 3000, 'loss_limit': 5000000, 'claims': [8563900, 72244]}, [5072244, 4196001]], ['maximum binds', {'standard': 1860838, 'basic': 250, 'lcf': 1100, 'tax': 1050, 'min': 600, 'max': 1200, 'loss_limit': 5000000, 'claims': [3974702, 2021857, 3323996, 2741110]}, [12061665, 2233006]], ['no losses minimum binds', {'standard': 1054836, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 500, 'max': 1400, 'loss_limit': 5000000, 'claims': []}, [0, 527418]], ['subrogation recovery offsets', {'standard': 572933, 'basic': 250, 'lcf': 1150, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [215865, -67794]}, [148071, 322920]], ['net recovery floors at zero', {'standard': 1415569, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [-23951]}, [0, 424671]], ['inverted bounds rejected', {'standard': 1885857, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 1300, 'max': 1200, 'loss_limit': 5000000, 'claims': [100000]}, 'invalid bounds'], ['flat plan with equal bounds', {'standard': 1658903, 'basic': 200, 'lcf': 1200, 'tax': 1050, 'min': 900, 'max': 900, 'loss_limit': 5000000, 'claims': [100000]}, [100000, 1493013]], ['near-minimum losses', {'standard': 1831216, 'basic': 250, 'lcf': 1150, 'tax': 1030, 'min': 450, 'max': 1800, 'loss_limit': 5000000, 'claims': [255597]}, [255597, 824047]]], [['moderate losses between bounds', {'standard': 1953166, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 400, 'max': 2000, 'loss_limit': 5000000, 'claims': [130486, 146045, 106267, 80838]}, [463636, 970005]], ['large claim limited', {'standard': 1375996, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 600, 'max': 3000, 'loss_limit': 5000000, 'claims': [8850428, 26063]}, [5026063, 4127988]], ['maximum binds', {'standard': 1822101, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 600, 'max': 1200, 'loss_limit': 5000000, 'claims': [3010425, 2467545, 2177771, 3447891]}, [11103632, 2186521]], ['no losses minimum binds', {'standard': 1516833, 'basic': 200, 'lcf': 1100, 'tax': 1050, 'min': 500, 'max': 1400, 'loss_limit': 5000000, 'claims': []}, [0, 758417]], ['subrogation recovery offsets', {'standard': 714829, 'basic': 200, 'lcf': 1100, 'tax': 1050, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [292326, -101272]}, [191054, 370781]], ['net recovery floors at zero', {'standard': 1501098, 'basic': 200, 'lcf': 1100, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [-22616]}, [0, 450329]], ['inverted bounds rejected', {'standard': 696781, 'basic': 200, 'lcf': 1200, 'tax': 1050, 'min': 1300, 'max': 1200, 'loss_limit': 5000000, 'claims': [100000]}, 'invalid bounds'], ['flat plan with equal bounds', {'standard': 802028, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 900, 'max': 900, 'loss_limit': 5000000, 'claims': [100000]}, [100000, 721825]], ['near-minimum losses', {'standard': 715359, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 450, 'max': 1800, 'loss_limit': 5000000, 'claims': [161153]}, [161153, 346549]]], [['moderate losses between bounds', {'standard': 714988, 'basic': 200, 'lcf': 1200, 'tax': 1050, 'min': 400, 'max': 2000, 'loss_limit': 5000000, 'claims': [147807, 50783, 101639, 147624]}, [447853, 714442]], ['large claim limited', {'standard': 1075364, 'basic': 200, 'lcf': 1100, 'tax': 1050, 'min': 600, 'max': 3000, 'loss_limit': 5000000, 'claims': [6621396, 51697]}, [5051697, 3226092]], ['maximum binds', {'standard': 636493, 'basic': 250, 'lcf': 1200, 'tax': 1050, 'min': 500, 'max': 1200, 'loss_limit': 5000000, 'claims': [3206066, 2811387, 2370852, 2596520]}, [10984825, 763792]], ['no losses minimum binds', {'standard': 1974481, 'basic': 200, 'lcf': 1200, 'tax': 1050, 'min': 500, 'max': 1600, 'loss_limit': 5000000, 'claims': []}, [0, 987241]], ['subrogation recovery offsets', {'standard': 1092045, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [210597, -95806]}, [114791, 366843]], ['net recovery floors at zero', {'standard': 1088467, 'basic': 250, 'lcf': 1200, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [-13789]}, [0, 326540]], ['inverted bounds rejected', {'standard': 1508678, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 1300, 'max': 1200, 'loss_limit': 5000000, 'claims': [100000]}, 'invalid bounds'], ['flat plan with equal bounds', {'standard': 811592, 'basic': 250, 'lcf': 1200, 'tax': 1050, 'min': 900, 'max': 900, 'loss_limit': 5000000, 'claims': [100000]}, [100000, 730433]], ['near-minimum losses', {'standard': 1513685, 'basic': 200, 'lcf': 1100, 'tax': 1050, 'min': 450, 'max': 1800, 'loss_limit': 5000000, 'claims': [237641]}, [237641, 681158]]], [['moderate losses between bounds', {'standard': 1863348, 'basic': 250, 'lcf': 1200, 'tax': 1050, 'min': 400, 'max': 2000, 'loss_limit': 5000000, 'claims': [182396, 119506, 129126, 64521]}, [495549, 1113521]], ['large claim limited', {'standard': 1794820, 'basic': 200, 'lcf': 1100, 'tax': 1030, 'min': 500, 'max': 3000, 'loss_limit': 5000000, 'claims': [6997029, 30223]}, [5030223, 5384460]], ['maximum binds', {'standard': 1446879, 'basic': 200, 'lcf': 1200, 'tax': 1030, 'min': 500, 'max': 1200, 'loss_limit': 5000000, 'claims': [3226070, 2149089, 2381869, 2566788]}, [10323816, 1736255]], ['no losses minimum binds', {'standard': 1111989, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 500, 'max': 1400, 'loss_limit': 5000000, 'claims': []}, [0, 555995]], ['subrogation recovery offsets', {'standard': 930668, 'basic': 250, 'lcf': 1150, 'tax': 1030, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [215001, -125166]}, [89835, 346057]], ['net recovery floors at zero', {'standard': 790663, 'basic': 200, 'lcf': 1100, 'tax': 1050, 'min': 300, 'max': 2500, 'loss_limit': 5000000, 'claims': [-24524]}, [0, 237199]], ['inverted bounds rejected', {'standard': 901935, 'basic': 200, 'lcf': 1150, 'tax': 1050, 'min': 1300, 'max': 1200, 'loss_limit': 5000000, 'claims': [100000]}, 'invalid bounds'], ['flat plan with equal bounds', {'standard': 802066, 'basic': 250, 'lcf': 1150, 'tax': 1050, 'min': 900, 'max': 900, 'loss_limit': 5000000, 'claims': [100000]}, [100000, 721859]], ['near-minimum losses', {'standard': 1352189, 'basic': 250, 'lcf': 1150, 'tax': 1050, 'min': 450, 'max': 1800, 'loss_limit': 5000000, 'claims': [178467]}, [178467, 608485]]]]\nfor label, args, expected in fixtures[N-1]:\n    check(label, solve(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":"A deterministic bounded teaching model of a stipulated toy rating contract. Amounts are integer cents and factors exact rationals; it makes no claim of conformance with any filed rating plan, bureau manual or jurisdiction. 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-insurance_premium_rating-retro-rating-tax-and-bounds-order","generated_at":"2026-09-29T14:47:12.238750+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Retrospective plans settle premium after losses, so each conversion factor and bound has to sit at the right step.","repair":"Tax the premium first, then clamp to bounds that already include tax.","root_cause":"The tax multiplier is applied after the min/max clamp.","sha256":"f06d74354c7ec9a3fc17bd4351551a0cf7cdd224aceb22371cffe0b40250fa41","title":"Retrospective rating adjustment: Bounds are enforced before the tax multiplier · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.857,"exit_code":1,"observations":[{"actual":[455487,827175],"check":"moderate losses between bounds","expected":[455487,827175],"passed":true},{"actual":[5085219,4840904],"check":"large claim limited","expected":[5085219,4610385],"passed":false},{"actual":[14095709,713134],"check":"maximum binds","expected":[14095709,692363],"passed":false},{"actual":[0,411241],"check":"no losses minimum binds","expected":[0,391659],"passed":false},{"actual":[227452,581085],"check":"subrogation recovery offsets","expected":[227452,581085],"passed":true},{"actual":[0,609003],"check":"net recovery floors at zero","expected":[0,591265],"passed":false},{"actual":"invalid bounds","check":"inverted bounds rejected","expected":"invalid bounds","passed":true},{"actual":[100000,957367],"check":"flat plan with equal bounds","expected":[100000,929482],"passed":false},{"actual":[196003,509523],"check":"near-minimum losses","expected":[196003,509523],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"moderate losses between bounds\", \"actual\": [455487, 827175], \"expected\": [455487, 827175], \"passed\": true}, {\"check\": \"large claim limited\", \"actual\": [5085219, 4840904], \"expected\": [5085219, 4610385], \"passed\": false}, {\"check\": \"maximum binds\", \"actual\": [14095709, 713134], \"expected\": [14095709, 692363], \"passed\": false}, {\"check\": \"no losses minimum binds\", \"actual\": [0, 411241], \"expected\": [0, 391659], \"passed\": false}, {\"check\": \"subrogation recovery offsets\", \"actual\": [227452, 581085], \"expected\": [227452, 581085], \"passed\": true}, {\"check\": \"net recovery floors at zero\", \"actual\": [0, 609003], \"expected\": [0, 591265], \"passed\": false}, {\"check\": \"inverted bounds rejected\", \"actual\": \"invalid bounds\", \"expected\": \"invalid bounds\", \"passed\": true}, {\"check\": \"flat plan with equal bounds\", \"actual\": [100000, 957367], \"expected\": [100000, 929482], \"passed\": false}, {\"check\": \"near-minimum losses\", \"actual\": [196003, 509523], \"expected\": [196003, 509523], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.075,"exit_code":1,"observations":[{"actual":[455487,827175],"check":"moderate losses between bounds","expected":[455487,827175],"passed":true},{"actual":[5085219,4840904],"check":"large claim limited","expected":[5085219,4610385],"passed":false},{"actual":[14095709,713134],"check":"maximum binds","expected":[14095709,692363],"passed":false},{"actual":[0,411241],"check":"no losses minimum binds","expected":[0,391659],"passed":false},{"actual":[227452,581085],"check":"subrogation recovery offsets","expected":[227452,581085],"passed":true},{"actual":[0,609003],"check":"net recovery floors at zero","expected":[0,591265],"passed":false},{"actual":"invalid bounds","check":"inverted bounds rejected","expected":"invalid bounds","passed":true},{"actual":[100000,957367],"check":"flat plan with equal bounds","expected":[100000,929482],"passed":false},{"actual":[196003,509523],"check":"near-minimum losses","expected":[196003,509523],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"moderate losses between bounds\", \"actual\": [455487, 827175], \"expected\": [455487, 827175], \"passed\": true}, {\"check\": \"large claim limited\", \"actual\": [5085219, 4840904], \"expected\": [5085219, 4610385], \"passed\": false}, {\"check\": \"maximum binds\", \"actual\": [14095709, 713134], \"expected\": [14095709, 692363], \"passed\": false}, {\"check\": \"no losses minimum binds\", \"actual\": [0, 411241], \"expected\": [0, 391659], \"passed\": false}, {\"check\": \"subrogation recovery offsets\", \"actual\": [227452, 581085], \"expected\": [227452, 581085], \"passed\": true}, {\"check\": \"net recovery floors at zero\", \"actual\": [0, 609003], \"expected\": [0, 591265], \"passed\": false}, {\"check\": \"inverted bounds rejected\", \"actual\": \"invalid bounds\", \"expected\": \"invalid bounds\", \"passed\": true}, {\"check\": \"flat plan with equal bounds\", \"actual\": [100000, 957367], \"expected\": [100000, 929482], \"passed\": false}, {\"check\": \"near-minimum losses\", \"actual\": [196003, 509523], \"expected\": [196003, 509523], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":43.779,"exit_code":0,"observations":[{"actual":[455487,827175],"check":"moderate losses between bounds","expected":[455487,827175],"passed":true},{"actual":[5085219,4610385],"check":"large claim limited","expected":[5085219,4610385],"passed":true},{"actual":[14095709,692363],"check":"maximum binds","expected":[14095709,692363],"passed":true},{"actual":[0,391659],"check":"no losses minimum binds","expected":[0,391659],"passed":true},{"actual":[227452,581085],"check":"subrogation recovery offsets","expected":[227452,581085],"passed":true},{"actual":[0,591265],"check":"net recovery floors at zero","expected":[0,591265],"passed":true},{"actual":"invalid bounds","check":"inverted bounds rejected","expected":"invalid bounds","passed":true},{"actual":[100000,929482],"check":"flat plan with equal bounds","expected":[100000,929482],"passed":true},{"actual":[196003,509523],"check":"near-minimum losses","expected":[196003,509523],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"moderate losses between bounds\", \"actual\": [455487, 827175], \"expected\": [455487, 827175], \"passed\": true}, {\"check\": \"large claim limited\", \"actual\": [5085219, 4610385], \"expected\": [5085219, 4610385], \"passed\": true}, {\"check\": \"maximum binds\", \"actual\": [14095709, 692363], \"expected\": [14095709, 692363], \"passed\": true}, {\"check\": \"no losses minimum binds\", \"actual\": [0, 391659], \"expected\": [0, 391659], \"passed\": true}, {\"check\": \"subrogation recovery offsets\", \"actual\": [227452, 581085], \"expected\": [227452, 581085], \"passed\": true}, {\"check\": \"net recovery floors at zero\", \"actual\": [0, 591265], \"expected\": [0, 591265], \"passed\": true}, {\"check\": \"inverted bounds rejected\", \"actual\": \"invalid bounds\", \"expected\": \"invalid bounds\", \"passed\": true}, {\"check\": \"flat plan with equal bounds\", \"actual\": [100000, 929482], \"expected\": [100000, 929482], \"passed\": true}, {\"check\": \"near-minimum losses\", \"actual\": [196003, 509523], \"expected\": [196003, 509523], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}