An algorithmic solution to the biological effective dose (BED) calculation from the Lea-Catcheside formula for a piecewise defined function is presented. Data from patients treated for metastatic thyroid cancer were used to illustrate the solution. The Lea-Catcheside formula for the G-factor of the BED is integrated numerically using a large number of small trapezoidal fits to each integral. The algorithmically calculated BED is compatible with an analytic calculation for a similarly valued exponentially fitted dose-rate plot and is the only resolution for piecewise defined dose-rate functions.