FAILURE MAP
← Case archive

FA-63963 / Medication dosing calculations / Member archive

Tablet strength selection with scored halves: maximum tablet count · case 03

A 3.5-tablet regimen of a scored product is rejected.

Member previewVariant 3 · 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
three and a half tablets allowed{"status": "NO_MATCH"}{"dose_mg": 35.0, "status": "OK", "strength": 10, "tablets": 3.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 ↗