FAILURE MAP
← Case archive

FA-61112 / 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 02

Bills settling late in a leap year after 29 February, or before a coming leap day, get the wrong basis.

Member previewVariant 2 · 3 implementations · 8 checks per implementation

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 fixture

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

Boundary fixtureActualExpectedOutcome
regression leap basis window 1[95.933333, 0.0847811][95.933333, 0.08453969]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 ↗