FA-61115 / Bond day-count conventions / Member archive
Discount-basis bill price and bond-equivalent yield: the 366-day basis is chosen by the settlement calendar year · case 05
Bills settling late in a leap year after 29 February, or before a coming leap day, get the wrong basis.
Case contract
Inputs settlement and maturity [y,m,d] (1 to 364 days apart) and discount rate d. t = days. Price = 100*(1 - d*t/360). Year basis B is 366 if a 29 February lies in (settle, settle+365 days], else 365. For t <= B/2, BEY = B*d/(360 - d*t); otherwise BEY solves the quadratic with a = t/(2B) - 0.25, b = t/B, c = (price-100)/price, taking (-b + sqrt(b^2 - 4ac))/(2a). Return [price rounded 6, BEY rounded 8].
Why this case matters
Bond accrual and pricing systems depend on exact day-count arithmetic; a single-day error changes settlement cash.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| regression leap basis window 1 | [97.977778, 0.08301202] | [97.977778, 0.08278521] | 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 ↗