FA-58706 / Loan amortization schedules / Open access
Accelerated biweekly schedule: biweekly periodic rate · case 01
Biweekly interest is computed as if there were 24 periods a year.
ROOT CAUSE
The semi-monthly divisor is used for the biweekly rate.
VERIFIED REPAIR
Divide the annual rate by 26 periods.
Unsuccessful approach: Using 14/365 of a year is a different day-count basis than the 26-period contract.
Case contract
x = {'principal', 'rate_bp', 'months'}. The monthly payment is the exact annuity rounded half-up; the biweekly payment is round_half_up(monthly/2), paid 26 times a year. Periodic interest is round_half_up(balance*bp/260000). When balance + interest <= payment the loan pays off with that amount. Return {'payment', 'periods', 'final_payment', 'total_interest'}.
Why this case matters
Amortization engines drive borrower statements, payoff quotes and investor remittances; a misplaced rounding step, boundary or ordering rule compounds across hundreds of periods.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
from fractions import Fraction
N = 1
observations = []
def solve(x):
def rnd(n, d):
q, r = divmod(n, d)
return q + (1 if 2 * r >= d else 0)
def level(P, n):
if n <= 0 or P <= 0:
return 0
if bp == 0:
exact = Fraction(P, n)
else:
r = Fraction(bp, 120000)
exact = P * r / (1 - (1 + r) ** -n)
return math.floor(exact + Fraction(1, 2))
bp = x['rate_bp']
P = x['principal']
monthly = level(P, x['months'])
pay = rnd(monthly, 2)
bal = P
k = 0
total = 0
final = 0
while bal > 0 and k < 26 * x['months']:
k += 1
interest = rnd(bal * bp, 240000)
total += interest
if bal + interest <= pay:
final = bal + interest
bal = 0
else:
bal -= pay - interest
return {'payment': pay, 'periods': k, 'final_payment': final, 'total_interest': total}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: biweekly periodic rate', {'principal': 5000, 'rate_bp': 1200, 'months': 12}, {'payment': 222, 'periods': 24, 'final_payment': 187, 'total_interest': 293}], ['regression: biweekly periodic rate, partial-repair probe', {'principal': 5000, 'rate_bp': 725, 'months': 36}, {'payment': 78, 'periods': 71, 'final_payment': 58, 'total_interest': 518}], ['control 1', {'principal': 250000, 'rate_bp': 0, 'months': 7}, {'payment': 17857, 'periods': 15, 'final_payment': 2, 'total_interest': 0}], ['control 2', {'principal': 250000, 'rate_bp': 0, 'months': 36}, {'payment': 3472, 'periods': 73, 'final_payment': 16, 'total_interest': 0}], ['control 3', {'principal': 1000000, 'rate_bp': 0, 'months': 60}, {'payment': 8334, 'periods': 120, 'final_payment': 8254, 'total_interest': 0}], ['control 4', {'principal': 1000000, 'rate_bp': 0, 'months': 36}, {'payment': 13889, 'periods': 72, 'final_payment': 13881, 'total_interest': 0}], ['control 5', {'principal': 5000, 'rate_bp': 0, 'months': 7}, {'payment': 357, 'periods': 15, 'final_payment': 2, 'total_interest': 0}]], [['regression: biweekly periodic rate', {'principal': 250000, 'rate_bp': 725, 'months': 36}, {'payment': 3874, 'periods': 72, 'final_payment': 951, 'total_interest': 26005}], ['control 1', {'principal': 100000, 'rate_bp': 0, 'months': 7}, {'payment': 7143, 'periods': 14, 'final_payment': 7141, 'total_interest': 0}], ['control 2', {'principal': 250000, 'rate_bp': 0, 'months': 60}, {'payment': 2084, 'periods': 120, 'final_payment': 2004, 'total_interest': 0}], ['control 3', {'principal': 100000, 'rate_bp': 0, 'months': 36}, {'payment': 1389, 'periods': 72, 'final_payment': 1381, 'total_interest': 0}], ['control 4', {'principal': 100000, 'rate_bp': 0, 'months': 12}, {'payment': 4167, 'periods': 24, 'final_payment': 4159, 'total_interest': 0}], ['control 5', {'principal': 5000, 'rate_bp': 0, 'months': 36}, {'payment': 70, 'periods': 72, 'final_payment': 30, 'total_interest': 0}], ['control 6', {'principal': 5000, 'rate_bp': 0, 'months': 12}, {'payment': 209, 'periods': 24, 'final_payment': 193, 'total_interest': 0}]], [['regression: biweekly periodic rate', {'principal': 100000, 'rate_bp': 600, 'months': 36}, {'payment': 1521, 'periods': 72, 'final_payment': 590, 'total_interest': 8581}], ['control 1', {'principal': 100000, 'rate_bp': 0, 'months': 36}, {'payment': 1389, 'periods': 72, 'final_payment': 1381, 'total_interest': 0}], ['control 2', {'principal': 1000000, 'rate_bp': 0, 'months': 7}, {'payment': 71429, 'periods': 14, 'final_payment': 71423, 'total_interest': 0}], ['control 3', {'principal': 250000, 'rate_bp': 0, 'months': 7}, {'payment': 17857, 'periods': 15, 'final_payment': 2, 'total_interest': 0}], ['control 4', {'principal': 250000, 'rate_bp': 0, 'months': 12}, {'payment': 10417, 'periods': 24, 'final_payment': 10409, 'total_interest': 0}], ['control 5', {'principal': 250000, 'rate_bp': 0, 'months': 36}, {'payment': 3472, 'periods': 73, 'final_payment': 16, 'total_interest': 0}], ['control 6', {'principal': 100000, 'rate_bp': 0, 'months': 60}, {'payment': 834, 'periods': 120, 'final_payment': 754, 'total_interest': 0}]], [['regression: biweekly periodic rate', {'principal': 5000, 'rate_bp': 1200, 'months': 36}, {'payment': 83, 'periods': 71, 'final_payment': 64, 'total_interest': 874}], ['control 1', {'principal': 100000, 'rate_bp': 0, 'months': 7}, {'payment': 7143, 'periods': 14, 'final_payment': 7141, 'total_interest': 0}], ['control 2', {'principal': 250000, 'rate_bp': 0, 'months': 12}, {'payment': 10417, 'periods': 24, 'final_payment': 10409, 'total_interest': 0}], ['control 3', {'principal': 1000000, 'rate_bp': 0, 'months': 36}, {'payment': 13889, 'periods': 72, 'final_payment': 13881, 'total_interest': 0}], ['control 4', {'principal': 1000000, 'rate_bp': 0, 'months': 12}, {'payment': 41667, 'periods': 24, 'final_payment': 41659, 'total_interest': 0}], ['control 5', {'principal': 5000, 'rate_bp': 0, 'months': 12}, {'payment': 209, 'periods': 24, 'final_payment': 193, 'total_interest': 0}], ['control 6', {'principal': 5000, 'rate_bp': 0, 'months': 7}, {'payment': 357, 'periods': 15, 'final_payment': 2, 'total_interest': 0}]], [['regression: biweekly periodic rate', {'principal': 5000, 'rate_bp': 725, 'months': 60}, {'payment': 50, 'periods': 118, 'final_payment': 21, 'total_interest': 871}], ['control 1', {'principal': 100000, 'rate_bp': 0, 'months': 7}, {'payment': 7143, 'periods': 14, 'final_payment': 7141, 'total_interest': 0}], ['control 2', {'principal': 100000, 'rate_bp': 0, 'months': 36}, {'payment': 1389, 'periods': 72, 'final_payment': 1381, 'total_interest': 0}], ['control 3', {'principal': 5000, 'rate_bp': 0, 'months': 36}, {'payment': 70, 'periods': 72, 'final_payment': 30, 'total_interest': 0}], ['control 4', {'principal': 250000, 'rate_bp': 0, 'months': 60}, {'payment': 2084, 'periods': 120, 'final_payment': 2004, 'total_interest': 0}], ['control 5', {'principal': 250000, 'rate_bp': 0, 'months': 36}, {'payment': 3472, 'periods': 73, 'final_payment': 16, 'total_interest': 0}], ['control 6', {'principal': 1000000, 'rate_bp': 0, 'months': 12}, {'payment': 41667, 'periods': 24, 'final_payment': 41659, 'total_interest': 0}]]]
for label, args, expected in fixtures[N-1]:
try:
actual = solve(args)
except Exception as exc:
actual = 'raised ' + type(exc).__name__
check(label, actual, expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: biweekly periodic rate | {'final_payment': 213, 'payment': 222, 'periods': 24, 'total_interest': 319} | {'final_payment': 187, 'payment': 222, 'periods': 24, 'total_interest': 293} | Failed |
| regression: biweekly periodic rate, partial-repair probe | {'final_payment': 29, 'payment': 78, 'periods': 72, 'total_interest': 567} | {'final_payment': 58, 'payment': 78, 'periods': 71, 'total_interest': 518} | Failed |
| control 1 | {'final_payment': 2, 'payment': 17857, 'periods': 15, 'total_interest': 0} | {'final_payment': 2, 'payment': 17857, 'periods': 15, 'total_interest': 0} | Passed |
| control 2 | {'final_payment': 16, 'payment': 3472, 'periods': 73, 'total_interest': 0} | {'final_payment': 16, 'payment': 3472, 'periods': 73, 'total_interest': 0} | Passed |
| control 3 | {'final_payment': 8254, 'payment': 8334, 'periods': 120, 'total_interest': 0} | {'final_payment': 8254, 'payment': 8334, 'periods': 120, 'total_interest': 0} | Passed |
| control 4 | {'final_payment': 13881, 'payment': 13889, 'periods': 72, 'total_interest': 0} | {'final_payment': 13881, 'payment': 13889, 'periods': 72, 'total_interest': 0} | Passed |
| control 5 | {'final_payment': 2, 'payment': 357, 'periods': 15, 'total_interest': 0} | {'final_payment': 2, 'payment': 357, 'periods': 15, 'total_interest': 0} | Passed |
SHA-256 / fbee88ad7262bc40194e7f682193c8b403c9daeb46a74c1336feec72d809d295
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
from fractions import Fraction
N = 1
observations = []
def solve(x):
def rnd(n, d):
q, r = divmod(n, d)
return q + (1 if 2 * r >= d else 0)
def level(P, n):
if n <= 0 or P <= 0:
return 0
if bp == 0:
exact = Fraction(P, n)
else:
r = Fraction(bp, 120000)
exact = P * r / (1 - (1 + r) ** -n)
return math.floor(exact + Fraction(1, 2))
bp = x['rate_bp']
P = x['principal']
monthly = level(P, x['months'])
pay = rnd(monthly, 2)
bal = P
k = 0
total = 0
final = 0
while bal > 0 and k < 26 * x['months']:
k += 1
interest = rnd(bal * bp * 14, 3650000)
total += interest
if bal + interest <= pay:
final = bal + interest
bal = 0
else:
bal -= pay - interest
return {'payment': pay, 'periods': k, 'final_payment': final, 'total_interest': total}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: biweekly periodic rate', {'principal': 5000, 'rate_bp': 1200, 'months': 12}, {'payment': 222, 'periods': 24, 'final_payment': 187, 'total_interest': 293}], ['regression: biweekly periodic rate, partial-repair probe', {'principal': 5000, 'rate_bp': 725, 'months': 36}, {'payment': 78, 'periods': 71, 'final_payment': 58, 'total_interest': 518}], ['control 1', {'principal': 250000, 'rate_bp': 0, 'months': 7}, {'payment': 17857, 'periods': 15, 'final_payment': 2, 'total_interest': 0}], ['control 2', {'principal': 250000, 'rate_bp': 0, 'months': 36}, {'payment': 3472, 'periods': 73, 'final_payment': 16, 'total_interest': 0}], ['control 3', {'principal': 1000000, 'rate_bp': 0, 'months': 60}, {'payment': 8334, 'periods': 120, 'final_payment': 8254, 'total_interest': 0}], ['control 4', {'principal': 1000000, 'rate_bp': 0, 'months': 36}, {'payment': 13889, 'periods': 72, 'final_payment': 13881, 'total_interest': 0}], ['control 5', {'principal': 5000, 'rate_bp': 0, 'months': 7}, {'payment': 357, 'periods': 15, 'final_payment': 2, 'total_interest': 0}]], [['regression: biweekly periodic rate', {'principal': 250000, 'rate_bp': 725, 'months': 36}, {'payment': 3874, 'periods': 72, 'final_payment': 951, 'total_interest': 26005}], ['control 1', {'principal': 100000, 'rate_bp': 0, 'months': 7}, {'payment': 7143, 'periods': 14, 'final_payment': 7141, 'total_interest': 0}], ['control 2', {'principal': 250000, 'rate_bp': 0, 'months': 60}, {'payment': 2084, 'periods': 120, 'final_payment': 2004, 'total_interest': 0}], ['control 3', {'principal': 100000, 'rate_bp': 0, 'months': 36}, {'payment': 1389, 'periods': 72, 'final_payment': 1381, 'total_interest': 0}], ['control 4', {'principal': 100000, 'rate_bp': 0, 'months': 12}, {'payment': 4167, 'periods': 24, 'final_payment': 4159, 'total_interest': 0}], ['control 5', {'principal': 5000, 'rate_bp': 0, 'months': 36}, {'payment': 70, 'periods': 72, 'final_payment': 30, 'total_interest': 0}], ['control 6', {'principal': 5000, 'rate_bp': 0, 'months': 12}, {'payment': 209, 'periods': 24, 'final_payment': 193, 'total_interest': 0}]], [['regression: biweekly periodic rate', {'principal': 100000, 'rate_bp': 600, 'months': 36}, {'payment': 1521, 'periods': 72, 'final_payment': 590, 'total_interest': 8581}], ['control 1', {'principal': 100000, 'rate_bp': 0, 'months': 36}, {'payment': 1389, 'periods': 72, 'final_payment': 1381, 'total_interest': 0}], ['control 2', {'principal': 1000000, 'rate_bp': 0, 'months': 7}, {'payment': 71429, 'periods': 14, 'final_payment': 71423, 'total_interest': 0}], ['control 3', {'principal': 250000, 'rate_bp': 0, 'months': 7}, {'payment': 17857, 'periods': 15, 'final_payment': 2, 'total_interest': 0}], ['control 4', {'principal': 250000, 'rate_bp': 0, 'months': 12}, {'payment': 10417, 'periods': 24, 'final_payment': 10409, 'total_interest': 0}], ['control 5', {'principal': 250000, 'rate_bp': 0, 'months': 36}, {'payment': 3472, 'periods': 73, 'final_payment': 16, 'total_interest': 0}], ['control 6', {'principal': 100000, 'rate_bp': 0, 'months': 60}, {'payment': 834, 'periods': 120, 'final_payment': 754, 'total_interest': 0}]], [['regression: biweekly periodic rate', {'principal': 5000, 'rate_bp': 1200, 'months': 36}, {'payment': 83, 'periods': 71, 'final_payment': 64, 'total_interest': 874}], ['control 1', {'principal': 100000, 'rate_bp': 0, 'months': 7}, {'payment': 7143, 'periods': 14, 'final_payment': 7141, 'total_interest': 0}], ['control 2', {'principal': 250000, 'rate_bp': 0, 'months': 12}, {'payment': 10417, 'periods': 24, 'final_payment': 10409, 'total_interest': 0}], ['control 3', {'principal': 1000000, 'rate_bp': 0, 'months': 36}, {'payment': 13889, 'periods': 72, 'final_payment': 13881, 'total_interest': 0}], ['control 4', {'principal': 1000000, 'rate_bp': 0, 'months': 12}, {'payment': 41667, 'periods': 24, 'final_payment': 41659, 'total_interest': 0}], ['control 5', {'principal': 5000, 'rate_bp': 0, 'months': 12}, {'payment': 209, 'periods': 24, 'final_payment': 193, 'total_interest': 0}], ['control 6', {'principal': 5000, 'rate_bp': 0, 'months': 7}, {'payment': 357, 'periods': 15, 'final_payment': 2, 'total_interest': 0}]], [['regression: biweekly periodic rate', {'principal': 5000, 'rate_bp': 725, 'months': 60}, {'payment': 50, 'periods': 118, 'final_payment': 21, 'total_interest': 871}], ['control 1', {'principal': 100000, 'rate_bp': 0, 'months': 7}, {'payment': 7143, 'periods': 14, 'final_payment': 7141, 'total_interest': 0}], ['control 2', {'principal': 100000, 'rate_bp': 0, 'months': 36}, {'payment': 1389, 'periods': 72, 'final_payment': 1381, 'total_interest': 0}], ['control 3', {'principal': 5000, 'rate_bp': 0, 'months': 36}, {'payment': 70, 'periods': 72, 'final_payment': 30, 'total_interest': 0}], ['control 4', {'principal': 250000, 'rate_bp': 0, 'months': 60}, {'payment': 2084, 'periods': 120, 'final_payment': 2004, 'total_interest': 0}], ['control 5', {'principal': 250000, 'rate_bp': 0, 'months': 36}, {'payment': 3472, 'periods': 73, 'final_payment': 16, 'total_interest': 0}], ['control 6', {'principal': 1000000, 'rate_bp': 0, 'months': 12}, {'payment': 41667, 'periods': 24, 'final_payment': 41659, 'total_interest': 0}]]]
for label, args, expected in fixtures[N-1]:
try:
actual = solve(args)
except Exception as exc:
actual = 'raised ' + type(exc).__name__
check(label, actual, expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: biweekly periodic rate | {'final_payment': 187, 'payment': 222, 'periods': 24, 'total_interest': 293} | {'final_payment': 187, 'payment': 222, 'periods': 24, 'total_interest': 293} | Passed |
| regression: biweekly periodic rate, partial-repair probe | {'final_payment': 55, 'payment': 78, 'periods': 71, 'total_interest': 515} | {'final_payment': 58, 'payment': 78, 'periods': 71, 'total_interest': 518} | Failed |
| control 1 | {'final_payment': 2, 'payment': 17857, 'periods': 15, 'total_interest': 0} | {'final_payment': 2, 'payment': 17857, 'periods': 15, 'total_interest': 0} | Passed |
| control 2 | {'final_payment': 16, 'payment': 3472, 'periods': 73, 'total_interest': 0} | {'final_payment': 16, 'payment': 3472, 'periods': 73, 'total_interest': 0} | Passed |
| control 3 | {'final_payment': 8254, 'payment': 8334, 'periods': 120, 'total_interest': 0} | {'final_payment': 8254, 'payment': 8334, 'periods': 120, 'total_interest': 0} | Passed |
| control 4 | {'final_payment': 13881, 'payment': 13889, 'periods': 72, 'total_interest': 0} | {'final_payment': 13881, 'payment': 13889, 'periods': 72, 'total_interest': 0} | Passed |
| control 5 | {'final_payment': 2, 'payment': 357, 'periods': 15, 'total_interest': 0} | {'final_payment': 2, 'payment': 357, 'periods': 15, 'total_interest': 0} | Passed |
SHA-256 / 7ff26fa823e5cd8af1401c795b51ebdc6a156757b4425820b74721ce8c9a3147
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
from fractions import Fraction
N = 1
observations = []
def solve(x):
def rnd(n, d):
q, r = divmod(n, d)
return q + (1 if 2 * r >= d else 0)
def level(P, n):
if n <= 0 or P <= 0:
return 0
if bp == 0:
exact = Fraction(P, n)
else:
r = Fraction(bp, 120000)
exact = P * r / (1 - (1 + r) ** -n)
return math.floor(exact + Fraction(1, 2))
bp = x['rate_bp']
P = x['principal']
monthly = level(P, x['months'])
pay = rnd(monthly, 2)
bal = P
k = 0
total = 0
final = 0
while bal > 0 and k < 26 * x['months']:
k += 1
interest = rnd(bal * bp, 260000)
total += interest
if bal + interest <= pay:
final = bal + interest
bal = 0
else:
bal -= pay - interest
return {'payment': pay, 'periods': k, 'final_payment': final, 'total_interest': total}
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[['regression: biweekly periodic rate', {'principal': 5000, 'rate_bp': 1200, 'months': 12}, {'payment': 222, 'periods': 24, 'final_payment': 187, 'total_interest': 293}], ['regression: biweekly periodic rate, partial-repair probe', {'principal': 5000, 'rate_bp': 725, 'months': 36}, {'payment': 78, 'periods': 71, 'final_payment': 58, 'total_interest': 518}], ['control 1', {'principal': 250000, 'rate_bp': 0, 'months': 7}, {'payment': 17857, 'periods': 15, 'final_payment': 2, 'total_interest': 0}], ['control 2', {'principal': 250000, 'rate_bp': 0, 'months': 36}, {'payment': 3472, 'periods': 73, 'final_payment': 16, 'total_interest': 0}], ['control 3', {'principal': 1000000, 'rate_bp': 0, 'months': 60}, {'payment': 8334, 'periods': 120, 'final_payment': 8254, 'total_interest': 0}], ['control 4', {'principal': 1000000, 'rate_bp': 0, 'months': 36}, {'payment': 13889, 'periods': 72, 'final_payment': 13881, 'total_interest': 0}], ['control 5', {'principal': 5000, 'rate_bp': 0, 'months': 7}, {'payment': 357, 'periods': 15, 'final_payment': 2, 'total_interest': 0}]], [['regression: biweekly periodic rate', {'principal': 250000, 'rate_bp': 725, 'months': 36}, {'payment': 3874, 'periods': 72, 'final_payment': 951, 'total_interest': 26005}], ['control 1', {'principal': 100000, 'rate_bp': 0, 'months': 7}, {'payment': 7143, 'periods': 14, 'final_payment': 7141, 'total_interest': 0}], ['control 2', {'principal': 250000, 'rate_bp': 0, 'months': 60}, {'payment': 2084, 'periods': 120, 'final_payment': 2004, 'total_interest': 0}], ['control 3', {'principal': 100000, 'rate_bp': 0, 'months': 36}, {'payment': 1389, 'periods': 72, 'final_payment': 1381, 'total_interest': 0}], ['control 4', {'principal': 100000, 'rate_bp': 0, 'months': 12}, {'payment': 4167, 'periods': 24, 'final_payment': 4159, 'total_interest': 0}], ['control 5', {'principal': 5000, 'rate_bp': 0, 'months': 36}, {'payment': 70, 'periods': 72, 'final_payment': 30, 'total_interest': 0}], ['control 6', {'principal': 5000, 'rate_bp': 0, 'months': 12}, {'payment': 209, 'periods': 24, 'final_payment': 193, 'total_interest': 0}]], [['regression: biweekly periodic rate', {'principal': 100000, 'rate_bp': 600, 'months': 36}, {'payment': 1521, 'periods': 72, 'final_payment': 590, 'total_interest': 8581}], ['control 1', {'principal': 100000, 'rate_bp': 0, 'months': 36}, {'payment': 1389, 'periods': 72, 'final_payment': 1381, 'total_interest': 0}], ['control 2', {'principal': 1000000, 'rate_bp': 0, 'months': 7}, {'payment': 71429, 'periods': 14, 'final_payment': 71423, 'total_interest': 0}], ['control 3', {'principal': 250000, 'rate_bp': 0, 'months': 7}, {'payment': 17857, 'periods': 15, 'final_payment': 2, 'total_interest': 0}], ['control 4', {'principal': 250000, 'rate_bp': 0, 'months': 12}, {'payment': 10417, 'periods': 24, 'final_payment': 10409, 'total_interest': 0}], ['control 5', {'principal': 250000, 'rate_bp': 0, 'months': 36}, {'payment': 3472, 'periods': 73, 'final_payment': 16, 'total_interest': 0}], ['control 6', {'principal': 100000, 'rate_bp': 0, 'months': 60}, {'payment': 834, 'periods': 120, 'final_payment': 754, 'total_interest': 0}]], [['regression: biweekly periodic rate', {'principal': 5000, 'rate_bp': 1200, 'months': 36}, {'payment': 83, 'periods': 71, 'final_payment': 64, 'total_interest': 874}], ['control 1', {'principal': 100000, 'rate_bp': 0, 'months': 7}, {'payment': 7143, 'periods': 14, 'final_payment': 7141, 'total_interest': 0}], ['control 2', {'principal': 250000, 'rate_bp': 0, 'months': 12}, {'payment': 10417, 'periods': 24, 'final_payment': 10409, 'total_interest': 0}], ['control 3', {'principal': 1000000, 'rate_bp': 0, 'months': 36}, {'payment': 13889, 'periods': 72, 'final_payment': 13881, 'total_interest': 0}], ['control 4', {'principal': 1000000, 'rate_bp': 0, 'months': 12}, {'payment': 41667, 'periods': 24, 'final_payment': 41659, 'total_interest': 0}], ['control 5', {'principal': 5000, 'rate_bp': 0, 'months': 12}, {'payment': 209, 'periods': 24, 'final_payment': 193, 'total_interest': 0}], ['control 6', {'principal': 5000, 'rate_bp': 0, 'months': 7}, {'payment': 357, 'periods': 15, 'final_payment': 2, 'total_interest': 0}]], [['regression: biweekly periodic rate', {'principal': 5000, 'rate_bp': 725, 'months': 60}, {'payment': 50, 'periods': 118, 'final_payment': 21, 'total_interest': 871}], ['control 1', {'principal': 100000, 'rate_bp': 0, 'months': 7}, {'payment': 7143, 'periods': 14, 'final_payment': 7141, 'total_interest': 0}], ['control 2', {'principal': 100000, 'rate_bp': 0, 'months': 36}, {'payment': 1389, 'periods': 72, 'final_payment': 1381, 'total_interest': 0}], ['control 3', {'principal': 5000, 'rate_bp': 0, 'months': 36}, {'payment': 70, 'periods': 72, 'final_payment': 30, 'total_interest': 0}], ['control 4', {'principal': 250000, 'rate_bp': 0, 'months': 60}, {'payment': 2084, 'periods': 120, 'final_payment': 2004, 'total_interest': 0}], ['control 5', {'principal': 250000, 'rate_bp': 0, 'months': 36}, {'payment': 3472, 'periods': 73, 'final_payment': 16, 'total_interest': 0}], ['control 6', {'principal': 1000000, 'rate_bp': 0, 'months': 12}, {'payment': 41667, 'periods': 24, 'final_payment': 41659, 'total_interest': 0}]]]
for label, args, expected in fixtures[N-1]:
try:
actual = solve(args)
except Exception as exc:
actual = 'raised ' + type(exc).__name__
check(label, actual, expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression: biweekly periodic rate | {'final_payment': 187, 'payment': 222, 'periods': 24, 'total_interest': 293} | {'final_payment': 187, 'payment': 222, 'periods': 24, 'total_interest': 293} | Passed |
| regression: biweekly periodic rate, partial-repair probe | {'final_payment': 58, 'payment': 78, 'periods': 71, 'total_interest': 518} | {'final_payment': 58, 'payment': 78, 'periods': 71, 'total_interest': 518} | Passed |
| control 1 | {'final_payment': 2, 'payment': 17857, 'periods': 15, 'total_interest': 0} | {'final_payment': 2, 'payment': 17857, 'periods': 15, 'total_interest': 0} | Passed |
| control 2 | {'final_payment': 16, 'payment': 3472, 'periods': 73, 'total_interest': 0} | {'final_payment': 16, 'payment': 3472, 'periods': 73, 'total_interest': 0} | Passed |
| control 3 | {'final_payment': 8254, 'payment': 8334, 'periods': 120, 'total_interest': 0} | {'final_payment': 8254, 'payment': 8334, 'periods': 120, 'total_interest': 0} | Passed |
| control 4 | {'final_payment': 13881, 'payment': 13889, 'periods': 72, 'total_interest': 0} | {'final_payment': 13881, 'payment': 13889, 'periods': 72, 'total_interest': 0} | Passed |
| control 5 | {'final_payment': 2, 'payment': 357, 'periods': 15, 'total_interest': 0} | {'final_payment': 2, 'payment': 357, 'periods': 15, 'total_interest': 0} | Passed |
SHA-256 / 1001513379e271e49693b555c15a856ceab66dfacd3187925e4d85d6e32e0e68
Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-29T14:46:29.298455+00:00.
Case digest / f670777e71b90eb81c9533e4cc738a1a37c49b0b1529245a7266fe73b0f8645d