Case 946
The dose was right for a kidney that was not his
the_dose_was_right_for_a_kidney_that_was_not_his.eml - A patient is prescribed the label dose of a drug that leaves the body through the kidneys, the label is correct, the tablets are taken exactly, and the patient's kidneys clear at half the rate the label was written for. What the same dose becomes at half the clearance is computed below.
ok: true — round-trip fixpoint reached (python1 == python2)updated 2026-09-21
EML
eml# Self-authored for the EML case corpus (no external origin). A patient is
# prescribed the label dose of a drug that leaves the body through the kidneys,
# the label is correct, the tablets are taken exactly, and the patient's kidneys
# clear at half the rate the label was written for. What the same dose becomes
# at half the clearance is computed below.
#
# The reasoning is careful. The label dose is the real, studied dose; the
# tablets are exact; the schedule is kept to the hour; and the intent is
# exactly 'take the right amount of this drug'.
#
# A steady level is what goes in divided by how fast it goes out, so the same
# dose at half the clearance settles at double the level - above the window
# the label was aiming at - and takes twice as long to get there, so the early
# blood test that reassured everyone was taken on the way up.
100 => label_dose_mg_per_day
100 => label_clearance_units
50 => patient_clearance_units
80 => window_floor_level
160 => window_ceiling_level
1 => label_half_life_days
int(label_dose_mg_per_day * 100 / label_clearance_units) => steady_level_at_label_clearance
int(label_dose_mg_per_day * 100 / patient_clearance_units) => steady_level_at_patient_clearance
steady_level_at_patient_clearance - window_ceiling_level => level_above_the_ceiling
int(steady_level_at_patient_clearance * 10000 / steady_level_at_label_clearance) => patient_level_as_a_share_of_label_level_per_myriad
int(label_dose_mg_per_day * patient_clearance_units / label_clearance_units) => dose_that_fits_the_patient_mg_per_day
int(dose_that_fits_the_patient_mg_per_day * 100 / patient_clearance_units) => steady_level_on_the_fitted_dose
int(label_half_life_days * label_clearance_units / patient_clearance_units) => patient_half_life_days
5 * label_half_life_days => label_days_to_plateau
5 * patient_half_life_days => patient_days_to_plateau
7500 => share_of_plateau_after_two_half_lives_per_myriad
8750 => share_of_plateau_after_three_half_lives_per_myriad
int(steady_level_at_patient_clearance * share_of_plateau_after_two_half_lives_per_myriad / 10000) => patient_level_after_two_half_lives
int(steady_level_at_patient_clearance * share_of_plateau_after_three_half_lives_per_myriad / 10000) => patient_level_after_three_half_lives
"label dose : " + str(label_dose_mg_per_day) + " mg a day, written for clearance " + str(label_clearance_units) ^0
"patient's clearance : " + str(patient_clearance_units) + ", half the label's" ^0
"target window : " + str(window_floor_level) + " to " + str(window_ceiling_level) ^0
"" ^0
"steady level, label kidney : " + str(steady_level_at_label_clearance) ^0
"steady level, patient's kidney : " + str(steady_level_at_patient_clearance) + ", " + str(level_above_the_ceiling) + " above the ceiling" ^0
"patient level vs label level : " + str(patient_level_as_a_share_of_label_level_per_myriad) + " per ten thousand" ^0
"dose that fits the patient : " + str(dose_that_fits_the_patient_mg_per_day) + " mg a day, steady level " + str(steady_level_on_the_fitted_dose) ^0
"half-life, label kidney : " + str(label_half_life_days) + " day, plateau in " + str(label_days_to_plateau) + " days" ^0
"half-life, patient's kidney : " + str(patient_half_life_days) + " days, plateau in " + str(patient_days_to_plateau) + " days" ^0
"patient's level on day four : " + str(patient_level_after_two_half_lives) + ", two of his half-lives, still climbing" ^0
"patient's level on day six : " + str(patient_level_after_three_half_lives) + ", three of his half-lives, still climbing" ^0
"" ^0
# ---- what the prescription verified ----
"the label-dose reasoning" ^0
" dose : the studied dose, " + str(label_dose_mg_per_day) + " mg a day" ^0
" tablets : exact, on the hour" ^0
" day-four blood test : inside the window" ^0
" intent : take the right amount of this drug" ^0
" facts wrong : 0" ^0
" verdict : THE LABEL DOSE IS THE RIGHT DOSE" ^0
"" ^0
" giving the studied dose exactly is the part done right" ^0
" here, and it is why the level would have been " + str(steady_level_at_label_clearance) + " in" ^0
" the kidney the label was written for" ^0
"" ^0
# ---- what half the clearance does ----
"a level is input over output" ^0
" input : " + str(label_dose_mg_per_day) + " mg a day, the same for both patients" ^0
" output : proportional to clearance, and this kidney clears" ^0
" at half the rate" ^0
" where the balance settles : at double the level, " + str(steady_level_at_patient_clearance) ^0
" how long it takes : the half-life doubles with the clearance" ^0
" halved, so the plateau is " + str(patient_days_to_plateau) + " days away, not " + str(label_days_to_plateau) ^0
" what the day-four test saw : a level still on its way up," ^0
" inside a window it was about to leave" ^0
"" ^0
# ---- what the patient got ----
"the exposure" ^0
" believed : the level the label produces, " + str(steady_level_at_label_clearance) ^0
" actual at plateau : " + str(steady_level_at_patient_clearance) + ", above the ceiling by " + str(level_above_the_ceiling) ^0
" is the label wrong : no; it is right for the clearance it names" ^0
" is the dose right for him : no; his dose is " + str(dose_that_fits_the_patient_mg_per_day) + " mg a day, which" ^0
" settles at " + str(steady_level_on_the_fitted_dose) + ", inside the window" ^0
"" ^0
# ---- null control ----
# The same prescription with the dose scaled to the patient's clearance instead
# of taken from the label.
200 => nc_steady_level_on_the_label_dose
100 => nc_steady_level_on_the_clearance_scaled_dose
100 => nc_excess_the_scaling_removes
"null control - scale the dose to the kidney that will clear it" ^0
" steady level, label dose : " + str(nc_steady_level_on_the_label_dose) ^0
" steady level, clearance-scaled dose : " + str(nc_steady_level_on_the_clearance_scaled_dose) ^0
" excess the scaling removes : " + str(nc_excess_the_scaling_removes) ^0
" no label and no tablet changed; the output side of the" ^0
" balance was measured before the input was chosen" ^0
"" ^0
# ---- the rule ----
"what a correct label dose guarantees" ^0
" the studied level in the studied kidney : exactly, " + str(steady_level_at_label_clearance) ^0
" the studied level in this kidney : not addressed; at half" ^0
" the clearance the same input settles at " + str(steady_level_at_patient_clearance) + ", " + str(level_above_the_ceiling) + " above" ^0
" the ceiling, and only after " + str(patient_days_to_plateau) + " days, past the day the" ^0
" reassuring test was drawn" ^0
"" ^0
"a dose is not an amount of drug in a body; it is one side of a balance whose" ^0
"other side is how fast that body lets go, and a label can only ever name the" ^0
"body it was measured in" ^0
"" ^0
"The label dose is right - for a clearance of " + str(label_clearance_units) + ". At " + str(patient_clearance_units) + " the same " + str(label_dose_mg_per_day) + " mg a day" ^0
"settles at " + str(steady_level_at_patient_clearance) + " instead of " + str(steady_level_at_label_clearance) + ", " + str(level_above_the_ceiling) + " above the ceiling, and reaches it in " + str(patient_days_to_plateau) + " days" ^0
"rather than " + str(label_days_to_plateau) + ", so the day-four test read a level still climbing; the fitted dose is" ^0
"" + str(dose_that_fits_the_patient_mg_per_day) + " mg, until the output side of the balance is read before the input is set." ^0Python (deterministic transpilation)
pythonlabel_dose_mg_per_day = 100
label_clearance_units = 100
patient_clearance_units = 50
window_floor_level = 80
window_ceiling_level = 160
label_half_life_days = 1
steady_level_at_label_clearance = int(label_dose_mg_per_day * 100 / label_clearance_units)
steady_level_at_patient_clearance = int(label_dose_mg_per_day * 100 / patient_clearance_units)
level_above_the_ceiling = steady_level_at_patient_clearance - window_ceiling_level
patient_level_as_a_share_of_label_level_per_myriad = int(steady_level_at_patient_clearance * 10000 / steady_level_at_label_clearance)
dose_that_fits_the_patient_mg_per_day = int(label_dose_mg_per_day * patient_clearance_units / label_clearance_units)
steady_level_on_the_fitted_dose = int(dose_that_fits_the_patient_mg_per_day * 100 / patient_clearance_units)
patient_half_life_days = int(label_half_life_days * label_clearance_units / patient_clearance_units)
label_days_to_plateau = 5 * label_half_life_days
patient_days_to_plateau = 5 * patient_half_life_days
share_of_plateau_after_two_half_lives_per_myriad = 7500
share_of_plateau_after_three_half_lives_per_myriad = 8750
patient_level_after_two_half_lives = int(steady_level_at_patient_clearance * share_of_plateau_after_two_half_lives_per_myriad / 10000)
patient_level_after_three_half_lives = int(steady_level_at_patient_clearance * share_of_plateau_after_three_half_lives_per_myriad / 10000)
print("label dose : " + str(label_dose_mg_per_day) + " mg a day, written for clearance " + str(label_clearance_units))
print("patient's clearance : " + str(patient_clearance_units) + ", half the label's")
print("target window : " + str(window_floor_level) + " to " + str(window_ceiling_level))
print("")
print("steady level, label kidney : " + str(steady_level_at_label_clearance))
print("steady level, patient's kidney : " + str(steady_level_at_patient_clearance) + ", " + str(level_above_the_ceiling) + " above the ceiling")
print("patient level vs label level : " + str(patient_level_as_a_share_of_label_level_per_myriad) + " per ten thousand")
print("dose that fits the patient : " + str(dose_that_fits_the_patient_mg_per_day) + " mg a day, steady level " + str(steady_level_on_the_fitted_dose))
print("half-life, label kidney : " + str(label_half_life_days) + " day, plateau in " + str(label_days_to_plateau) + " days")
print("half-life, patient's kidney : " + str(patient_half_life_days) + " days, plateau in " + str(patient_days_to_plateau) + " days")
print("patient's level on day four : " + str(patient_level_after_two_half_lives) + ", two of his half-lives, still climbing")
print("patient's level on day six : " + str(patient_level_after_three_half_lives) + ", three of his half-lives, still climbing")
print("")
print("the label-dose reasoning")
print(" dose : the studied dose, " + str(label_dose_mg_per_day) + " mg a day")
print(" tablets : exact, on the hour")
print(" day-four blood test : inside the window")
print(" intent : take the right amount of this drug")
print(" facts wrong : 0")
print(" verdict : THE LABEL DOSE IS THE RIGHT DOSE")
print("")
print(" giving the studied dose exactly is the part done right")
print(" here, and it is why the level would have been " + str(steady_level_at_label_clearance) + " in")
print(" the kidney the label was written for")
print("")
print("a level is input over output")
print(" input : " + str(label_dose_mg_per_day) + " mg a day, the same for both patients")
print(" output : proportional to clearance, and this kidney clears")
print(" at half the rate")
print(" where the balance settles : at double the level, " + str(steady_level_at_patient_clearance))
print(" how long it takes : the half-life doubles with the clearance")
print(" halved, so the plateau is " + str(patient_days_to_plateau) + " days away, not " + str(label_days_to_plateau))
print(" what the day-four test saw : a level still on its way up,")
print(" inside a window it was about to leave")
print("")
print("the exposure")
print(" believed : the level the label produces, " + str(steady_level_at_label_clearance))
print(" actual at plateau : " + str(steady_level_at_patient_clearance) + ", above the ceiling by " + str(level_above_the_ceiling))
print(" is the label wrong : no; it is right for the clearance it names")
print(" is the dose right for him : no; his dose is " + str(dose_that_fits_the_patient_mg_per_day) + " mg a day, which")
print(" settles at " + str(steady_level_on_the_fitted_dose) + ", inside the window")
print("")
nc_steady_level_on_the_label_dose = 200
nc_steady_level_on_the_clearance_scaled_dose = 100
nc_excess_the_scaling_removes = 100
print("null control - scale the dose to the kidney that will clear it")
print(" steady level, label dose : " + str(nc_steady_level_on_the_label_dose))
print(" steady level, clearance-scaled dose : " + str(nc_steady_level_on_the_clearance_scaled_dose))
print(" excess the scaling removes : " + str(nc_excess_the_scaling_removes))
print(" no label and no tablet changed; the output side of the")
print(" balance was measured before the input was chosen")
print("")
print("what a correct label dose guarantees")
print(" the studied level in the studied kidney : exactly, " + str(steady_level_at_label_clearance))
print(" the studied level in this kidney : not addressed; at half")
print(" the clearance the same input settles at " + str(steady_level_at_patient_clearance) + ", " + str(level_above_the_ceiling) + " above")
print(" the ceiling, and only after " + str(patient_days_to_plateau) + " days, past the day the")
print(" reassuring test was drawn")
print("")
print("a dose is not an amount of drug in a body; it is one side of a balance whose")
print("other side is how fast that body lets go, and a label can only ever name the")
print("body it was measured in")
print("")
print("The label dose is right - for a clearance of " + str(label_clearance_units) + ". At " + str(patient_clearance_units) + " the same " + str(label_dose_mg_per_day) + " mg a day")
print("settles at " + str(steady_level_at_patient_clearance) + " instead of " + str(steady_level_at_label_clearance) + ", " + str(level_above_the_ceiling) + " above the ceiling, and reaches it in " + str(patient_days_to_plateau) + " days")
print("rather than " + str(label_days_to_plateau) + ", so the day-four test read a level still climbing; the fitted dose is")
print("" + str(dose_that_fits_the_patient_mg_per_day) + " mg, until the output side of the balance is read before the input is set.")stdout (executed)
textlabel dose : 100 mg a day, written for clearance 100
patient's clearance : 50, half the label's
target window : 80 to 160
steady level, label kidney : 100
steady level, patient's kidney : 200, 40 above the ceiling
patient level vs label level : 20000 per ten thousand
dose that fits the patient : 50 mg a day, steady level 100
half-life, label kidney : 1 day, plateau in 5 days
half-life, patient's kidney : 2 days, plateau in 10 days
patient's level on day four : 150, two of his half-lives, still climbing
patient's level on day six : 175, three of his half-lives, still climbing
the label-dose reasoning
dose : the studied dose, 100 mg a day
tablets : exact, on the hour
day-four blood test : inside the window
intent : take the right amount of this drug
facts wrong : 0
verdict : THE LABEL DOSE IS THE RIGHT DOSE
giving the studied dose exactly is the part done right
here, and it is why the level would have been 100 in
the kidney the label was written for
a level is input over output
input : 100 mg a day, the same for both patients
output : proportional to clearance, and this kidney clears
at half the rate
where the balance settles : at double the level, 200
how long it takes : the half-life doubles with the clearance
halved, so the plateau is 10 days away, not 5
what the day-four test saw : a level still on its way up,
inside a window it was about to leave
the exposure
believed : the level the label produces, 100
actual at plateau : 200, above the ceiling by 40
is the label wrong : no; it is right for the clearance it names
is the dose right for him : no; his dose is 50 mg a day, which
settles at 100, inside the window
null control - scale the dose to the kidney that will clear it
steady level, label dose : 200
steady level, clearance-scaled dose : 100
excess the scaling removes : 100
no label and no tablet changed; the output side of the
balance was measured before the input was chosen
what a correct label dose guarantees
the studied level in the studied kidney : exactly, 100
the studied level in this kidney : not addressed; at half
the clearance the same input settles at 200, 40 above
the ceiling, and only after 10 days, past the day the
reassuring test was drawn
a dose is not an amount of drug in a body; it is one side of a balance whose
other side is how fast that body lets go, and a label can only ever name the
body it was measured in
The label dose is right - for a clearance of 100. At 50 the same 100 mg a day
settles at 200 instead of 100, 40 above the ceiling, and reaches it in 10 days
rather than 5, so the day-four test read a level still climbing; the fitted dose is
50 mg, until the output side of the balance is read before the input is set.Trace event types
eml:run:starteml:assigneml:outputeml:run:done