FAILURE MAP
← Case archive

FA-63954 / Medication dosing calculations / Member archive

Tablet strength selection with scored halves: half-tablet eligibility · case 04

Half of an unscored tablet is dispensed.

Member previewVariant 4 · 3 implementations · 9 checks per implementation

Case contract

Input {target_mg, strengths, scored (strengths that may be halved), tol_pct}. For each strength s: step = s/2 if s is scored else s; units = target/step rounded half-up (skip if 0); dose = units*step; tablets = dose/s (skip if more than 4 tablets); keep only |dose-target|*100 <= tol_pct*target. Prefer smallest absolute error, then fewest physical tablets (ceil of tablets), then the largest strength. Return {status OK, strength, tablets, dose_mg} or {status NO_MATCH}.

Why this case matters

Dispensing systems translate an ordered dose into real tablets; halving rules, tolerance, and ranking are separate decisions.

One recorded failure

Sample boundary fixture

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

Boundary fixtureActualExpectedOutcome
unscored tablet may not be halved{"dose_mg": 35.0, "status": "OK", "strength": 70, "tablets": 0.5}{"status": "NO_MATCH"}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 ↗