FAILURE MAP
← Case archive

FA-58407 / Loan amortization schedules / Member archive

Principal curtailment with recast or term shortening: recast remaining term · case 02

After a recast the payment drops as if the loan were brand new.

Member previewVariant 2 · 3 implementations · 7 checks per implementation

Case contract

x = {'principal', 'rate_bp', 'months', 'prepay': {'k': extra cents after payment k}, 'mode': 'shorten'|'recast'}. The level payment is the exact annuity rounded half-up. Each month: interest = round_half_up(balance*bp/120000); if balance + interest <= payment or it is month n, pay balance + interest and stop. Otherwise reduce the balance by payment - interest, then apply the extra (capped at the balance). In recast mode a nonzero extra that leaves a balance re-levels the payment over the n - k remaining months. An extra that clears the balance ends the loan with final payment = payment + extra. Return {'months_paid', 'total_interest', 'final_payment', 'payments': payment history}.

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.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression: recast remaining term{"final_payment": 27715, "months_paid": 24, "payments": [4707, 2646], "total_interest": 14183}{"final_payment": 4326, "months_paid": 24, "payments": [4707, 4323], "total_interest": 12595}Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗