FA-64168 / Medication dosing calculations / Member archive
Percentage taper schedule rounded to tablets: rounding stall guard · case 03
The taper stalls at 10 mg because 10% rounds back to the same dose.
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 |
|---|---|---|---|
| rounding stall forces one tablet step | [10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0, 10.0] | [10.0, 10.0, 7.5, 7.5, 5.0, 5.0, 2.5, 2.5] | 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 ↗