FA-64153 / Medication dosing calculations / Member archive
Percentage taper schedule rounded to tablets: reduction day selection · case 03
The first reduction happens on day 0, so the starting dose is never given.
Case contract
Input {start_mg, step_pct, every_days, min_mg, tablet_mg, days}. Day 0 uses start_mg. On each day d > 0 with d % every_days == 0 (while the dose is non-zero), the dose becomes current*(100-step_pct)/100 rounded half-up to a tablet_mg multiple; if that does not lower the dose, it is lowered by one tablet_mg instead; a result below min_mg stops the taper (0). Return the list of daily doses for days days.
Why this case matters
Tapers compound percentage reductions with dispensing granularity; stepping day, rounding and stop rules are distinct decisions.
One recorded failure
Sample boundary fixtureThis sample comes from the broken implementation of a controlled reproducer.
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| weekly 25 percent taper | [45.0, 45.0, 45.0, 35.0, 35.0, 35.0, 25.0, 25.0, 25.0, 20.0, 20.0, 20.0, 15.0] | [60.0, 60.0, 60.0, 45.0, 45.0, 45.0, 35.0, 35.0, 35.0, 25.0, 25.0, 25.0, 20.0] | 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 ↗