Bulmash initializePoisson

Percentage Accurate: 100.0% → 100.0%
Time: 14.0s
Alternatives: 22
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \end{array} \]
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
 :precision binary64
 (+
  (/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT))))
  (/ NaChar (+ 1.0 (exp (/ (+ (+ (+ Ev Vef) EAccept) (- mu)) KbT))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
	return (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) + -mu) / KbT))));
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
    real(8), intent (in) :: ndchar
    real(8), intent (in) :: ec
    real(8), intent (in) :: vef
    real(8), intent (in) :: edonor
    real(8), intent (in) :: mu
    real(8), intent (in) :: kbt
    real(8), intent (in) :: nachar
    real(8), intent (in) :: ev
    real(8), intent (in) :: eaccept
    code = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + (nachar / (1.0d0 + exp(((((ev + vef) + eaccept) + -mu) / kbt))))
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
	return (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) + -mu) / KbT))));
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
	return (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) + -mu) / KbT))))
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	return Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) + Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) + Float64(-mu)) / KbT)))))
end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	tmp = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) + -mu) / KbT))));
end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(N[(NdChar / N[(1.0 + N[Exp[N[((-N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision]) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] + (-mu)), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 22 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \end{array} \]
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
 :precision binary64
 (+
  (/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT))))
  (/ NaChar (+ 1.0 (exp (/ (+ (+ (+ Ev Vef) EAccept) (- mu)) KbT))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
	return (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) + -mu) / KbT))));
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
    real(8), intent (in) :: ndchar
    real(8), intent (in) :: ec
    real(8), intent (in) :: vef
    real(8), intent (in) :: edonor
    real(8), intent (in) :: mu
    real(8), intent (in) :: kbt
    real(8), intent (in) :: nachar
    real(8), intent (in) :: ev
    real(8), intent (in) :: eaccept
    code = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + (nachar / (1.0d0 + exp(((((ev + vef) + eaccept) + -mu) / kbt))))
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
	return (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) + -mu) / KbT))));
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
	return (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) + -mu) / KbT))))
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	return Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) + Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) + Float64(-mu)) / KbT)))))
end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	tmp = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) + -mu) / KbT))));
end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(N[(NdChar / N[(1.0 + N[Exp[N[((-N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision]) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] + (-mu)), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}}
\end{array}

Alternative 1: 100.0% accurate, 0.7× speedup?

\[\begin{array}{l} \\ \frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} - \frac{NdChar}{-1 - {\left(e^{-1}\right)}^{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}} \end{array} \]
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
 :precision binary64
 (-
  (/ NaChar (+ 1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT))))
  (/ NdChar (- -1.0 (pow (exp -1.0) (/ (- (- (- Ec Vef) EDonor) mu) KbT))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
	return (NaChar / (1.0 + exp((((EAccept + (Ev + Vef)) - mu) / KbT)))) - (NdChar / (-1.0 - pow(exp(-1.0), ((((Ec - Vef) - EDonor) - mu) / KbT))));
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
    real(8), intent (in) :: ndchar
    real(8), intent (in) :: ec
    real(8), intent (in) :: vef
    real(8), intent (in) :: edonor
    real(8), intent (in) :: mu
    real(8), intent (in) :: kbt
    real(8), intent (in) :: nachar
    real(8), intent (in) :: ev
    real(8), intent (in) :: eaccept
    code = (nachar / (1.0d0 + exp((((eaccept + (ev + vef)) - mu) / kbt)))) - (ndchar / ((-1.0d0) - (exp((-1.0d0)) ** ((((ec - vef) - edonor) - mu) / kbt))))
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
	return (NaChar / (1.0 + Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT)))) - (NdChar / (-1.0 - Math.pow(Math.exp(-1.0), ((((Ec - Vef) - EDonor) - mu) / KbT))));
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
	return (NaChar / (1.0 + math.exp((((EAccept + (Ev + Vef)) - mu) / KbT)))) - (NdChar / (-1.0 - math.pow(math.exp(-1.0), ((((Ec - Vef) - EDonor) - mu) / KbT))))
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	return Float64(Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)))) - Float64(NdChar / Float64(-1.0 - (exp(-1.0) ^ Float64(Float64(Float64(Float64(Ec - Vef) - EDonor) - mu) / KbT)))))
end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	tmp = (NaChar / (1.0 + exp((((EAccept + (Ev + Vef)) - mu) / KbT)))) - (NdChar / (-1.0 - (exp(-1.0) ^ ((((Ec - Vef) - EDonor) - mu) / KbT))));
end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - N[Power[N[Exp[-1.0], $MachinePrecision], N[(N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} - \frac{NdChar}{-1 - {\left(e^{-1}\right)}^{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}}
\end{array}
Derivation
  1. Initial program 100.0%

    \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-exp.f64N/A

      \[\leadsto \frac{NdChar}{1 + \color{blue}{e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
    2. lift-/.f64N/A

      \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
    3. lift-neg.f64N/A

      \[\leadsto \frac{NdChar}{1 + e^{\frac{\color{blue}{\mathsf{neg}\left(\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)\right)}}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
    4. distribute-frac-negN/A

      \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\mathsf{neg}\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
    5. neg-mul-1N/A

      \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{-1 \cdot \frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
    6. exp-prodN/A

      \[\leadsto \frac{NdChar}{1 + \color{blue}{{\left(e^{-1}\right)}^{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
    7. lower-pow.f64N/A

      \[\leadsto \frac{NdChar}{1 + \color{blue}{{\left(e^{-1}\right)}^{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
    8. lower-exp.f64N/A

      \[\leadsto \frac{NdChar}{1 + {\color{blue}{\left(e^{-1}\right)}}^{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
    9. lower-/.f64100.0

      \[\leadsto \frac{NdChar}{1 + {\left(e^{-1}\right)}^{\color{blue}{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
  4. Applied rewrites100.0%

    \[\leadsto \frac{NdChar}{1 + \color{blue}{{\left(e^{-1}\right)}^{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
  5. Final simplification100.0%

    \[\leadsto \frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} - \frac{NdChar}{-1 - {\left(e^{-1}\right)}^{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}} \]
  6. Add Preprocessing

Alternative 2: 77.0% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}\\ t_1 := \frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} - \frac{NdChar}{-1 - t\_0}\\ t_2 := e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}\\ t_3 := \frac{NdChar}{1 + t\_0} - \frac{NaChar}{-1 - t\_2}\\ \mathbf{if}\;t\_3 \leq -2 \cdot 10^{-250}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-78}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\ \mathbf{elif}\;t\_3 \leq 10^{-12}:\\ \;\;\;\;\frac{NaChar}{1 + t\_2}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
 :precision binary64
 (let* ((t_0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))
        (t_1
         (- (/ NaChar (+ 1.0 (exp (/ EAccept KbT)))) (/ NdChar (- -1.0 t_0))))
        (t_2 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))
        (t_3 (- (/ NdChar (+ 1.0 t_0)) (/ NaChar (- -1.0 t_2)))))
   (if (<= t_3 -2e-250)
     t_1
     (if (<= t_3 5e-78)
       (/ NdChar (+ 1.0 (exp (/ (- (+ (+ mu Vef) EDonor) Ec) KbT))))
       (if (<= t_3 1e-12) (/ NaChar (+ 1.0 t_2)) t_1)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
	double t_0 = exp(((mu - ((Ec - Vef) - EDonor)) / KbT));
	double t_1 = (NaChar / (1.0 + exp((EAccept / KbT)))) - (NdChar / (-1.0 - t_0));
	double t_2 = exp((((EAccept + (Ev + Vef)) - mu) / KbT));
	double t_3 = (NdChar / (1.0 + t_0)) - (NaChar / (-1.0 - t_2));
	double tmp;
	if (t_3 <= -2e-250) {
		tmp = t_1;
	} else if (t_3 <= 5e-78) {
		tmp = NdChar / (1.0 + exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
	} else if (t_3 <= 1e-12) {
		tmp = NaChar / (1.0 + t_2);
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
    real(8), intent (in) :: ndchar
    real(8), intent (in) :: ec
    real(8), intent (in) :: vef
    real(8), intent (in) :: edonor
    real(8), intent (in) :: mu
    real(8), intent (in) :: kbt
    real(8), intent (in) :: nachar
    real(8), intent (in) :: ev
    real(8), intent (in) :: eaccept
    real(8) :: t_0
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: t_3
    real(8) :: tmp
    t_0 = exp(((mu - ((ec - vef) - edonor)) / kbt))
    t_1 = (nachar / (1.0d0 + exp((eaccept / kbt)))) - (ndchar / ((-1.0d0) - t_0))
    t_2 = exp((((eaccept + (ev + vef)) - mu) / kbt))
    t_3 = (ndchar / (1.0d0 + t_0)) - (nachar / ((-1.0d0) - t_2))
    if (t_3 <= (-2d-250)) then
        tmp = t_1
    else if (t_3 <= 5d-78) then
        tmp = ndchar / (1.0d0 + exp(((((mu + vef) + edonor) - ec) / kbt)))
    else if (t_3 <= 1d-12) then
        tmp = nachar / (1.0d0 + t_2)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
	double t_0 = Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT));
	double t_1 = (NaChar / (1.0 + Math.exp((EAccept / KbT)))) - (NdChar / (-1.0 - t_0));
	double t_2 = Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT));
	double t_3 = (NdChar / (1.0 + t_0)) - (NaChar / (-1.0 - t_2));
	double tmp;
	if (t_3 <= -2e-250) {
		tmp = t_1;
	} else if (t_3 <= 5e-78) {
		tmp = NdChar / (1.0 + Math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
	} else if (t_3 <= 1e-12) {
		tmp = NaChar / (1.0 + t_2);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
	t_0 = math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))
	t_1 = (NaChar / (1.0 + math.exp((EAccept / KbT)))) - (NdChar / (-1.0 - t_0))
	t_2 = math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))
	t_3 = (NdChar / (1.0 + t_0)) - (NaChar / (-1.0 - t_2))
	tmp = 0
	if t_3 <= -2e-250:
		tmp = t_1
	elif t_3 <= 5e-78:
		tmp = NdChar / (1.0 + math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)))
	elif t_3 <= 1e-12:
		tmp = NaChar / (1.0 + t_2)
	else:
		tmp = t_1
	return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	t_0 = exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT))
	t_1 = Float64(Float64(NaChar / Float64(1.0 + exp(Float64(EAccept / KbT)))) - Float64(NdChar / Float64(-1.0 - t_0)))
	t_2 = exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT))
	t_3 = Float64(Float64(NdChar / Float64(1.0 + t_0)) - Float64(NaChar / Float64(-1.0 - t_2)))
	tmp = 0.0
	if (t_3 <= -2e-250)
		tmp = t_1;
	elseif (t_3 <= 5e-78)
		tmp = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT))));
	elseif (t_3 <= 1e-12)
		tmp = Float64(NaChar / Float64(1.0 + t_2));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	t_0 = exp(((mu - ((Ec - Vef) - EDonor)) / KbT));
	t_1 = (NaChar / (1.0 + exp((EAccept / KbT)))) - (NdChar / (-1.0 - t_0));
	t_2 = exp((((EAccept + (Ev + Vef)) - mu) / KbT));
	t_3 = (NdChar / (1.0 + t_0)) - (NaChar / (-1.0 - t_2));
	tmp = 0.0;
	if (t_3 <= -2e-250)
		tmp = t_1;
	elseif (t_3 <= 5e-78)
		tmp = NdChar / (1.0 + exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
	elseif (t_3 <= 1e-12)
		tmp = NaChar / (1.0 + t_2);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(NaChar / N[(1.0 + N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(N[(NdChar / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -2e-250], t$95$1, If[LessEqual[t$95$3, 5e-78], N[(NdChar / N[(1.0 + N[Exp[N[(N[(N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e-12], N[(NaChar / N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}\\
t_1 := \frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} - \frac{NdChar}{-1 - t\_0}\\
t_2 := e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}\\
t_3 := \frac{NdChar}{1 + t\_0} - \frac{NaChar}{-1 - t\_2}\\
\mathbf{if}\;t\_3 \leq -2 \cdot 10^{-250}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-78}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\

\mathbf{elif}\;t\_3 \leq 10^{-12}:\\
\;\;\;\;\frac{NaChar}{1 + t\_2}\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -2.0000000000000001e-250 or 9.9999999999999998e-13 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT)))))

    1. Initial program 100.0%

      \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
    2. Add Preprocessing
    3. Taylor expanded in EAccept around inf

      \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
    4. Step-by-step derivation
      1. lower-/.f6480.9

        \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
    5. Applied rewrites80.9%

      \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]

    if -2.0000000000000001e-250 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.9999999999999996e-78

    1. Initial program 100.0%

      \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
    2. Add Preprocessing
    3. Taylor expanded in KbT around inf

      \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
    4. Step-by-step derivation
      1. +-commutativeN/A

        \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
      2. distribute-lft-outN/A

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
      4. lower-+.f646.8

        \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
    5. Applied rewrites6.8%

      \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
    6. Taylor expanded in NdChar around 0

      \[\leadsto \frac{1}{2} \cdot \color{blue}{NaChar} \]
    7. Step-by-step derivation
      1. Applied rewrites7.1%

        \[\leadsto 0.5 \cdot \color{blue}{NaChar} \]
      2. Taylor expanded in NdChar around inf

        \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
      3. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
        2. +-commutativeN/A

          \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}} + 1}} \]
        3. lower-+.f64N/A

          \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}} + 1}} \]
        4. lower-exp.f64N/A

          \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}} + 1} \]
        5. lower-/.f64N/A

          \[\leadsto \frac{NdChar}{e^{\color{blue}{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}} + 1} \]
        6. lower--.f64N/A

          \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(EDonor + \left(Vef + mu\right)\right) - Ec}}{KbT}} + 1} \]
        7. +-commutativeN/A

          \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(\left(Vef + mu\right) + EDonor\right)} - Ec}{KbT}} + 1} \]
        8. lower-+.f64N/A

          \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(\left(Vef + mu\right) + EDonor\right)} - Ec}{KbT}} + 1} \]
        9. +-commutativeN/A

          \[\leadsto \frac{NdChar}{e^{\frac{\left(\color{blue}{\left(mu + Vef\right)} + EDonor\right) - Ec}{KbT}} + 1} \]
        10. lower-+.f6486.8

          \[\leadsto \frac{NdChar}{e^{\frac{\left(\color{blue}{\left(mu + Vef\right)} + EDonor\right) - Ec}{KbT}} + 1} \]
      4. Applied rewrites86.8%

        \[\leadsto \color{blue}{\frac{NdChar}{e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}} + 1}} \]

      if 4.9999999999999996e-78 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 9.9999999999999998e-13

      1. Initial program 100.0%

        \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
      2. Add Preprocessing
      3. Taylor expanded in NdChar around 0

        \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}} \]
      4. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}} \]
        2. +-commutativeN/A

          \[\leadsto \frac{NaChar}{\color{blue}{e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}} + 1}} \]
        3. lower-+.f64N/A

          \[\leadsto \frac{NaChar}{\color{blue}{e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}} + 1}} \]
        4. lower-exp.f64N/A

          \[\leadsto \frac{NaChar}{\color{blue}{e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} + 1} \]
        5. lower-/.f64N/A

          \[\leadsto \frac{NaChar}{e^{\color{blue}{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} + 1} \]
        6. lower--.f64N/A

          \[\leadsto \frac{NaChar}{e^{\frac{\color{blue}{\left(EAccept + \left(Ev + Vef\right)\right) - mu}}{KbT}} + 1} \]
        7. +-commutativeN/A

          \[\leadsto \frac{NaChar}{e^{\frac{\color{blue}{\left(\left(Ev + Vef\right) + EAccept\right)} - mu}{KbT}} + 1} \]
        8. lower-+.f64N/A

          \[\leadsto \frac{NaChar}{e^{\frac{\color{blue}{\left(\left(Ev + Vef\right) + EAccept\right)} - mu}{KbT}} + 1} \]
        9. lower-+.f6480.8

          \[\leadsto \frac{NaChar}{e^{\frac{\left(\color{blue}{\left(Ev + Vef\right)} + EAccept\right) - mu}{KbT}} + 1} \]
      5. Applied rewrites80.8%

        \[\leadsto \color{blue}{\frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} + 1}} \]
    8. Recombined 3 regimes into one program.
    9. Final simplification82.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq -2 \cdot 10^{-250}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 5 \cdot 10^{-78}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 10^{-12}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\ \end{array} \]
    10. Add Preprocessing

    Alternative 3: 67.7% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\ t_1 := \frac{NaChar}{2} + t\_0\\ t_2 := e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}\\ t_3 := t\_0 - \frac{NaChar}{-1 - t\_2}\\ \mathbf{if}\;t\_3 \leq -4 \cdot 10^{-228}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-78}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\ \mathbf{elif}\;t\_3 \leq 10^{-12}:\\ \;\;\;\;\frac{NaChar}{1 + t\_2}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
     :precision binary64
     (let* ((t_0 (/ NdChar (+ 1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))))
            (t_1 (+ (/ NaChar 2.0) t_0))
            (t_2 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))
            (t_3 (- t_0 (/ NaChar (- -1.0 t_2)))))
       (if (<= t_3 -4e-228)
         t_1
         (if (<= t_3 5e-78)
           (/ NdChar (+ 1.0 (exp (/ (- (+ (+ mu Vef) EDonor) Ec) KbT))))
           (if (<= t_3 1e-12) (/ NaChar (+ 1.0 t_2)) t_1)))))
    double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
    	double t_0 = NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)));
    	double t_1 = (NaChar / 2.0) + t_0;
    	double t_2 = exp((((EAccept + (Ev + Vef)) - mu) / KbT));
    	double t_3 = t_0 - (NaChar / (-1.0 - t_2));
    	double tmp;
    	if (t_3 <= -4e-228) {
    		tmp = t_1;
    	} else if (t_3 <= 5e-78) {
    		tmp = NdChar / (1.0 + exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
    	} else if (t_3 <= 1e-12) {
    		tmp = NaChar / (1.0 + t_2);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
        real(8), intent (in) :: ndchar
        real(8), intent (in) :: ec
        real(8), intent (in) :: vef
        real(8), intent (in) :: edonor
        real(8), intent (in) :: mu
        real(8), intent (in) :: kbt
        real(8), intent (in) :: nachar
        real(8), intent (in) :: ev
        real(8), intent (in) :: eaccept
        real(8) :: t_0
        real(8) :: t_1
        real(8) :: t_2
        real(8) :: t_3
        real(8) :: tmp
        t_0 = ndchar / (1.0d0 + exp(((mu - ((ec - vef) - edonor)) / kbt)))
        t_1 = (nachar / 2.0d0) + t_0
        t_2 = exp((((eaccept + (ev + vef)) - mu) / kbt))
        t_3 = t_0 - (nachar / ((-1.0d0) - t_2))
        if (t_3 <= (-4d-228)) then
            tmp = t_1
        else if (t_3 <= 5d-78) then
            tmp = ndchar / (1.0d0 + exp(((((mu + vef) + edonor) - ec) / kbt)))
        else if (t_3 <= 1d-12) then
            tmp = nachar / (1.0d0 + t_2)
        else
            tmp = t_1
        end if
        code = tmp
    end function
    
    public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
    	double t_0 = NdChar / (1.0 + Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)));
    	double t_1 = (NaChar / 2.0) + t_0;
    	double t_2 = Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT));
    	double t_3 = t_0 - (NaChar / (-1.0 - t_2));
    	double tmp;
    	if (t_3 <= -4e-228) {
    		tmp = t_1;
    	} else if (t_3 <= 5e-78) {
    		tmp = NdChar / (1.0 + Math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
    	} else if (t_3 <= 1e-12) {
    		tmp = NaChar / (1.0 + t_2);
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
    	t_0 = NdChar / (1.0 + math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))
    	t_1 = (NaChar / 2.0) + t_0
    	t_2 = math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))
    	t_3 = t_0 - (NaChar / (-1.0 - t_2))
    	tmp = 0
    	if t_3 <= -4e-228:
    		tmp = t_1
    	elif t_3 <= 5e-78:
    		tmp = NdChar / (1.0 + math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)))
    	elif t_3 <= 1e-12:
    		tmp = NaChar / (1.0 + t_2)
    	else:
    		tmp = t_1
    	return tmp
    
    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT))))
    	t_1 = Float64(Float64(NaChar / 2.0) + t_0)
    	t_2 = exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT))
    	t_3 = Float64(t_0 - Float64(NaChar / Float64(-1.0 - t_2)))
    	tmp = 0.0
    	if (t_3 <= -4e-228)
    		tmp = t_1;
    	elseif (t_3 <= 5e-78)
    		tmp = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT))));
    	elseif (t_3 <= 1e-12)
    		tmp = Float64(NaChar / Float64(1.0 + t_2));
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)));
    	t_1 = (NaChar / 2.0) + t_0;
    	t_2 = exp((((EAccept + (Ev + Vef)) - mu) / KbT));
    	t_3 = t_0 - (NaChar / (-1.0 - t_2));
    	tmp = 0.0;
    	if (t_3 <= -4e-228)
    		tmp = t_1;
    	elseif (t_3 <= 5e-78)
    		tmp = NdChar / (1.0 + exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
    	elseif (t_3 <= 1e-12)
    		tmp = NaChar / (1.0 + t_2);
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(1.0 + N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NaChar / 2.0), $MachinePrecision] + t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[(t$95$0 - N[(NaChar / N[(-1.0 - t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -4e-228], t$95$1, If[LessEqual[t$95$3, 5e-78], N[(NdChar / N[(1.0 + N[Exp[N[(N[(N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 1e-12], N[(NaChar / N[(1.0 + t$95$2), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\
    t_1 := \frac{NaChar}{2} + t\_0\\
    t_2 := e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}\\
    t_3 := t\_0 - \frac{NaChar}{-1 - t\_2}\\
    \mathbf{if}\;t\_3 \leq -4 \cdot 10^{-228}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-78}:\\
    \;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\
    
    \mathbf{elif}\;t\_3 \leq 10^{-12}:\\
    \;\;\;\;\frac{NaChar}{1 + t\_2}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -4.00000000000000013e-228 or 9.9999999999999998e-13 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT)))))

      1. Initial program 100.0%

        \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
      2. Add Preprocessing
      3. Taylor expanded in KbT around inf

        \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{\color{blue}{\left(2 + \left(\frac{EAccept}{KbT} + \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right)\right) - \frac{mu}{KbT}}} \]
      4. Step-by-step derivation
        1. lower--.f64N/A

          \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{\color{blue}{\left(2 + \left(\frac{EAccept}{KbT} + \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right)\right) - \frac{mu}{KbT}}} \]
        2. associate-+r+N/A

          \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{\color{blue}{\left(\left(2 + \frac{EAccept}{KbT}\right) + \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right)} - \frac{mu}{KbT}} \]
        3. lower-+.f64N/A

          \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{\color{blue}{\left(\left(2 + \frac{EAccept}{KbT}\right) + \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right)} - \frac{mu}{KbT}} \]
        4. lower-+.f64N/A

          \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{\left(\color{blue}{\left(2 + \frac{EAccept}{KbT}\right)} + \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right) - \frac{mu}{KbT}} \]
        5. lower-/.f64N/A

          \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{\left(\left(2 + \color{blue}{\frac{EAccept}{KbT}}\right) + \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right) - \frac{mu}{KbT}} \]
        6. +-commutativeN/A

          \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{\left(\left(2 + \frac{EAccept}{KbT}\right) + \color{blue}{\left(\frac{Vef}{KbT} + \frac{Ev}{KbT}\right)}\right) - \frac{mu}{KbT}} \]
        7. lower-+.f64N/A

          \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{\left(\left(2 + \frac{EAccept}{KbT}\right) + \color{blue}{\left(\frac{Vef}{KbT} + \frac{Ev}{KbT}\right)}\right) - \frac{mu}{KbT}} \]
        8. lower-/.f64N/A

          \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{\left(\left(2 + \frac{EAccept}{KbT}\right) + \left(\color{blue}{\frac{Vef}{KbT}} + \frac{Ev}{KbT}\right)\right) - \frac{mu}{KbT}} \]
        9. lower-/.f64N/A

          \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{\left(\left(2 + \frac{EAccept}{KbT}\right) + \left(\frac{Vef}{KbT} + \color{blue}{\frac{Ev}{KbT}}\right)\right) - \frac{mu}{KbT}} \]
        10. lower-/.f6464.6

          \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{\left(\left(2 + \frac{EAccept}{KbT}\right) + \left(\frac{Vef}{KbT} + \frac{Ev}{KbT}\right)\right) - \color{blue}{\frac{mu}{KbT}}} \]
      5. Applied rewrites64.6%

        \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{\color{blue}{\left(\left(2 + \frac{EAccept}{KbT}\right) + \left(\frac{Vef}{KbT} + \frac{Ev}{KbT}\right)\right) - \frac{mu}{KbT}}} \]
      6. Taylor expanded in KbT around inf

        \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{2} \]
      7. Step-by-step derivation
        1. Applied rewrites67.7%

          \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{2} \]

        if -4.00000000000000013e-228 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.9999999999999996e-78

        1. Initial program 100.0%

          \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
        2. Add Preprocessing
        3. Taylor expanded in KbT around inf

          \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
        4. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
          2. distribute-lft-outN/A

            \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
          3. lower-*.f64N/A

            \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
          4. lower-+.f646.6

            \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
        5. Applied rewrites6.6%

          \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
        6. Taylor expanded in NdChar around 0

          \[\leadsto \frac{1}{2} \cdot \color{blue}{NaChar} \]
        7. Step-by-step derivation
          1. Applied rewrites7.4%

            \[\leadsto 0.5 \cdot \color{blue}{NaChar} \]
          2. Taylor expanded in NdChar around inf

            \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
          3. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
            2. +-commutativeN/A

              \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}} + 1}} \]
            3. lower-+.f64N/A

              \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}} + 1}} \]
            4. lower-exp.f64N/A

              \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}} + 1} \]
            5. lower-/.f64N/A

              \[\leadsto \frac{NdChar}{e^{\color{blue}{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}} + 1} \]
            6. lower--.f64N/A

              \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(EDonor + \left(Vef + mu\right)\right) - Ec}}{KbT}} + 1} \]
            7. +-commutativeN/A

              \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(\left(Vef + mu\right) + EDonor\right)} - Ec}{KbT}} + 1} \]
            8. lower-+.f64N/A

              \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(\left(Vef + mu\right) + EDonor\right)} - Ec}{KbT}} + 1} \]
            9. +-commutativeN/A

              \[\leadsto \frac{NdChar}{e^{\frac{\left(\color{blue}{\left(mu + Vef\right)} + EDonor\right) - Ec}{KbT}} + 1} \]
            10. lower-+.f6485.1

              \[\leadsto \frac{NdChar}{e^{\frac{\left(\color{blue}{\left(mu + Vef\right)} + EDonor\right) - Ec}{KbT}} + 1} \]
          4. Applied rewrites85.1%

            \[\leadsto \color{blue}{\frac{NdChar}{e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}} + 1}} \]

          if 4.9999999999999996e-78 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 9.9999999999999998e-13

          1. Initial program 100.0%

            \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
          2. Add Preprocessing
          3. Taylor expanded in NdChar around 0

            \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}} \]
          4. Step-by-step derivation
            1. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}} \]
            2. +-commutativeN/A

              \[\leadsto \frac{NaChar}{\color{blue}{e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}} + 1}} \]
            3. lower-+.f64N/A

              \[\leadsto \frac{NaChar}{\color{blue}{e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}} + 1}} \]
            4. lower-exp.f64N/A

              \[\leadsto \frac{NaChar}{\color{blue}{e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} + 1} \]
            5. lower-/.f64N/A

              \[\leadsto \frac{NaChar}{e^{\color{blue}{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} + 1} \]
            6. lower--.f64N/A

              \[\leadsto \frac{NaChar}{e^{\frac{\color{blue}{\left(EAccept + \left(Ev + Vef\right)\right) - mu}}{KbT}} + 1} \]
            7. +-commutativeN/A

              \[\leadsto \frac{NaChar}{e^{\frac{\color{blue}{\left(\left(Ev + Vef\right) + EAccept\right)} - mu}{KbT}} + 1} \]
            8. lower-+.f64N/A

              \[\leadsto \frac{NaChar}{e^{\frac{\color{blue}{\left(\left(Ev + Vef\right) + EAccept\right)} - mu}{KbT}} + 1} \]
            9. lower-+.f6480.8

              \[\leadsto \frac{NaChar}{e^{\frac{\left(\color{blue}{\left(Ev + Vef\right)} + EAccept\right) - mu}{KbT}} + 1} \]
          5. Applied rewrites80.8%

            \[\leadsto \color{blue}{\frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} + 1}} \]
        8. Recombined 3 regimes into one program.
        9. Final simplification74.5%

          \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq -4 \cdot 10^{-228}:\\ \;\;\;\;\frac{NaChar}{2} + \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 5 \cdot 10^{-78}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 10^{-12}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{2} + \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\ \end{array} \]
        10. Add Preprocessing

        Alternative 4: 35.3% accurate, 0.3× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\ t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-214}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{1}{\frac{1 + \frac{\frac{NdChar \cdot NdChar}{NaChar} - NdChar}{NaChar}}{NaChar}} \cdot 0.5\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-103}:\\ \;\;\;\;0.5 \cdot NdChar\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
        (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
         :precision binary64
         (let* ((t_0 (* (+ NaChar NdChar) 0.5))
                (t_1
                 (-
                  (/ NdChar (+ 1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT))))
                  (/ NaChar (- -1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))))))
           (if (<= t_1 -1e-214)
             t_0
             (if (<= t_1 0.0)
               (*
                (/
                 1.0
                 (/ (+ 1.0 (/ (- (/ (* NdChar NdChar) NaChar) NdChar) NaChar)) NaChar))
                0.5)
               (if (<= t_1 5e-103) (* 0.5 NdChar) t_0)))))
        double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
        	double t_0 = (NaChar + NdChar) * 0.5;
        	double t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
        	double tmp;
        	if (t_1 <= -1e-214) {
        		tmp = t_0;
        	} else if (t_1 <= 0.0) {
        		tmp = (1.0 / ((1.0 + ((((NdChar * NdChar) / NaChar) - NdChar) / NaChar)) / NaChar)) * 0.5;
        	} else if (t_1 <= 5e-103) {
        		tmp = 0.5 * NdChar;
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
            real(8), intent (in) :: ndchar
            real(8), intent (in) :: ec
            real(8), intent (in) :: vef
            real(8), intent (in) :: edonor
            real(8), intent (in) :: mu
            real(8), intent (in) :: kbt
            real(8), intent (in) :: nachar
            real(8), intent (in) :: ev
            real(8), intent (in) :: eaccept
            real(8) :: t_0
            real(8) :: t_1
            real(8) :: tmp
            t_0 = (nachar + ndchar) * 0.5d0
            t_1 = (ndchar / (1.0d0 + exp(((mu - ((ec - vef) - edonor)) / kbt)))) - (nachar / ((-1.0d0) - exp((((eaccept + (ev + vef)) - mu) / kbt))))
            if (t_1 <= (-1d-214)) then
                tmp = t_0
            else if (t_1 <= 0.0d0) then
                tmp = (1.0d0 / ((1.0d0 + ((((ndchar * ndchar) / nachar) - ndchar) / nachar)) / nachar)) * 0.5d0
            else if (t_1 <= 5d-103) then
                tmp = 0.5d0 * ndchar
            else
                tmp = t_0
            end if
            code = tmp
        end function
        
        public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
        	double t_0 = (NaChar + NdChar) * 0.5;
        	double t_1 = (NdChar / (1.0 + Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
        	double tmp;
        	if (t_1 <= -1e-214) {
        		tmp = t_0;
        	} else if (t_1 <= 0.0) {
        		tmp = (1.0 / ((1.0 + ((((NdChar * NdChar) / NaChar) - NdChar) / NaChar)) / NaChar)) * 0.5;
        	} else if (t_1 <= 5e-103) {
        		tmp = 0.5 * NdChar;
        	} else {
        		tmp = t_0;
        	}
        	return tmp;
        }
        
        def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
        	t_0 = (NaChar + NdChar) * 0.5
        	t_1 = (NdChar / (1.0 + math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))))
        	tmp = 0
        	if t_1 <= -1e-214:
        		tmp = t_0
        	elif t_1 <= 0.0:
        		tmp = (1.0 / ((1.0 + ((((NdChar * NdChar) / NaChar) - NdChar) / NaChar)) / NaChar)) * 0.5
        	elif t_1 <= 5e-103:
        		tmp = 0.5 * NdChar
        	else:
        		tmp = t_0
        	return tmp
        
        function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
        	t_0 = Float64(Float64(NaChar + NdChar) * 0.5)
        	t_1 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)))))
        	tmp = 0.0
        	if (t_1 <= -1e-214)
        		tmp = t_0;
        	elseif (t_1 <= 0.0)
        		tmp = Float64(Float64(1.0 / Float64(Float64(1.0 + Float64(Float64(Float64(Float64(NdChar * NdChar) / NaChar) - NdChar) / NaChar)) / NaChar)) * 0.5);
        	elseif (t_1 <= 5e-103)
        		tmp = Float64(0.5 * NdChar);
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
        	t_0 = (NaChar + NdChar) * 0.5;
        	t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
        	tmp = 0.0;
        	if (t_1 <= -1e-214)
        		tmp = t_0;
        	elseif (t_1 <= 0.0)
        		tmp = (1.0 / ((1.0 + ((((NdChar * NdChar) / NaChar) - NdChar) / NaChar)) / NaChar)) * 0.5;
        	elseif (t_1 <= 5e-103)
        		tmp = 0.5 * NdChar;
        	else
        		tmp = t_0;
        	end
        	tmp_2 = tmp;
        end
        
        code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-214], t$95$0, If[LessEqual[t$95$1, 0.0], N[(N[(1.0 / N[(N[(1.0 + N[(N[(N[(N[(NdChar * NdChar), $MachinePrecision] / NaChar), $MachinePrecision] - NdChar), $MachinePrecision] / NaChar), $MachinePrecision]), $MachinePrecision] / NaChar), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[t$95$1, 5e-103], N[(0.5 * NdChar), $MachinePrecision], t$95$0]]]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
        t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\
        \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-214}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;t\_1 \leq 0:\\
        \;\;\;\;\frac{1}{\frac{1 + \frac{\frac{NdChar \cdot NdChar}{NaChar} - NdChar}{NaChar}}{NaChar}} \cdot 0.5\\
        
        \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-103}:\\
        \;\;\;\;0.5 \cdot NdChar\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 3 regimes
        2. if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -9.99999999999999913e-215 or 4.99999999999999966e-103 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT)))))

          1. Initial program 100.0%

            \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
          2. Add Preprocessing
          3. Taylor expanded in KbT around inf

            \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
          4. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
            2. distribute-lft-outN/A

              \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
            3. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
            4. lower-+.f6438.7

              \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
          5. Applied rewrites38.7%

            \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]

          if -9.99999999999999913e-215 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 0.0

          1. Initial program 100.0%

            \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
          2. Add Preprocessing
          3. Taylor expanded in KbT around inf

            \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
          4. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
            2. distribute-lft-outN/A

              \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
            3. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
            4. lower-+.f642.5

              \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
          5. Applied rewrites2.5%

            \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
          6. Step-by-step derivation
            1. Applied rewrites3.9%

              \[\leadsto 0.5 \cdot \frac{1}{\color{blue}{\frac{NdChar - NaChar}{\left(NaChar + NdChar\right) \cdot \left(NdChar - NaChar\right)}}} \]
            2. Taylor expanded in NdChar around inf

              \[\leadsto \frac{1}{2} \cdot \frac{1}{\frac{1}{\color{blue}{NdChar}}} \]
            3. Step-by-step derivation
              1. Applied rewrites4.0%

                \[\leadsto 0.5 \cdot \frac{1}{\frac{1}{\color{blue}{NdChar}}} \]
              2. Taylor expanded in NaChar around -inf

                \[\leadsto \frac{1}{2} \cdot \frac{1}{-1 \cdot \color{blue}{\frac{-1 \cdot \frac{\frac{{NdChar}^{2}}{NaChar} - NdChar}{NaChar} - 1}{NaChar}}} \]
              3. Step-by-step derivation
                1. Applied rewrites39.4%

                  \[\leadsto 0.5 \cdot \frac{1}{\frac{\frac{\frac{NdChar \cdot NdChar}{NaChar} - NdChar}{NaChar} + 1}{\color{blue}{NaChar}}} \]

                if 0.0 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.99999999999999966e-103

                1. Initial program 100.0%

                  \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                2. Add Preprocessing
                3. Taylor expanded in KbT around inf

                  \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                4. Step-by-step derivation
                  1. +-commutativeN/A

                    \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                  2. distribute-lft-outN/A

                    \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                  3. lower-*.f64N/A

                    \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                  4. lower-+.f649.1

                    \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                5. Applied rewrites9.1%

                  \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                6. Taylor expanded in NdChar around 0

                  \[\leadsto \frac{1}{2} \cdot \color{blue}{NaChar} \]
                7. Step-by-step derivation
                  1. Applied rewrites13.0%

                    \[\leadsto 0.5 \cdot \color{blue}{NaChar} \]
                  2. Taylor expanded in NdChar around inf

                    \[\leadsto \frac{1}{2} \cdot \color{blue}{NdChar} \]
                  3. Step-by-step derivation
                    1. Applied rewrites27.2%

                      \[\leadsto 0.5 \cdot \color{blue}{NdChar} \]
                  4. Recombined 3 regimes into one program.
                  5. Final simplification37.8%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq -1 \cdot 10^{-214}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 0:\\ \;\;\;\;\frac{1}{\frac{1 + \frac{\frac{NdChar \cdot NdChar}{NaChar} - NdChar}{NaChar}}{NaChar}} \cdot 0.5\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 5 \cdot 10^{-103}:\\ \;\;\;\;0.5 \cdot NdChar\\ \mathbf{else}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \end{array} \]
                  6. Add Preprocessing

                  Alternative 5: 33.8% accurate, 0.3× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\ t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-214}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{1}{\frac{\frac{\mathsf{fma}\left(-NaChar, NdChar, NdChar \cdot NdChar\right)}{NaChar \cdot NaChar}}{NaChar}} \cdot 0.5\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-103}:\\ \;\;\;\;0.5 \cdot NdChar\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                  (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                   :precision binary64
                   (let* ((t_0 (* (+ NaChar NdChar) 0.5))
                          (t_1
                           (-
                            (/ NdChar (+ 1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT))))
                            (/ NaChar (- -1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))))))
                     (if (<= t_1 -1e-214)
                       t_0
                       (if (<= t_1 0.0)
                         (*
                          (/
                           1.0
                           (/
                            (/ (fma (- NaChar) NdChar (* NdChar NdChar)) (* NaChar NaChar))
                            NaChar))
                          0.5)
                         (if (<= t_1 5e-103) (* 0.5 NdChar) t_0)))))
                  double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                  	double t_0 = (NaChar + NdChar) * 0.5;
                  	double t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                  	double tmp;
                  	if (t_1 <= -1e-214) {
                  		tmp = t_0;
                  	} else if (t_1 <= 0.0) {
                  		tmp = (1.0 / ((fma(-NaChar, NdChar, (NdChar * NdChar)) / (NaChar * NaChar)) / NaChar)) * 0.5;
                  	} else if (t_1 <= 5e-103) {
                  		tmp = 0.5 * NdChar;
                  	} else {
                  		tmp = t_0;
                  	}
                  	return tmp;
                  }
                  
                  function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                  	t_0 = Float64(Float64(NaChar + NdChar) * 0.5)
                  	t_1 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)))))
                  	tmp = 0.0
                  	if (t_1 <= -1e-214)
                  		tmp = t_0;
                  	elseif (t_1 <= 0.0)
                  		tmp = Float64(Float64(1.0 / Float64(Float64(fma(Float64(-NaChar), NdChar, Float64(NdChar * NdChar)) / Float64(NaChar * NaChar)) / NaChar)) * 0.5);
                  	elseif (t_1 <= 5e-103)
                  		tmp = Float64(0.5 * NdChar);
                  	else
                  		tmp = t_0;
                  	end
                  	return tmp
                  end
                  
                  code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-214], t$95$0, If[LessEqual[t$95$1, 0.0], N[(N[(1.0 / N[(N[(N[((-NaChar) * NdChar + N[(NdChar * NdChar), $MachinePrecision]), $MachinePrecision] / N[(NaChar * NaChar), $MachinePrecision]), $MachinePrecision] / NaChar), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[t$95$1, 5e-103], N[(0.5 * NdChar), $MachinePrecision], t$95$0]]]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
                  t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\
                  \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-214}:\\
                  \;\;\;\;t\_0\\
                  
                  \mathbf{elif}\;t\_1 \leq 0:\\
                  \;\;\;\;\frac{1}{\frac{\frac{\mathsf{fma}\left(-NaChar, NdChar, NdChar \cdot NdChar\right)}{NaChar \cdot NaChar}}{NaChar}} \cdot 0.5\\
                  
                  \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-103}:\\
                  \;\;\;\;0.5 \cdot NdChar\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;t\_0\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -9.99999999999999913e-215 or 4.99999999999999966e-103 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT)))))

                    1. Initial program 100.0%

                      \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                    2. Add Preprocessing
                    3. Taylor expanded in KbT around inf

                      \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                      2. distribute-lft-outN/A

                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                      3. lower-*.f64N/A

                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                      4. lower-+.f6438.7

                        \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                    5. Applied rewrites38.7%

                      \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]

                    if -9.99999999999999913e-215 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 0.0

                    1. Initial program 100.0%

                      \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                    2. Add Preprocessing
                    3. Taylor expanded in KbT around inf

                      \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                    4. Step-by-step derivation
                      1. +-commutativeN/A

                        \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                      2. distribute-lft-outN/A

                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                      3. lower-*.f64N/A

                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                      4. lower-+.f642.5

                        \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                    5. Applied rewrites2.5%

                      \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                    6. Step-by-step derivation
                      1. Applied rewrites3.9%

                        \[\leadsto 0.5 \cdot \frac{1}{\color{blue}{\frac{NdChar - NaChar}{\left(NaChar + NdChar\right) \cdot \left(NdChar - NaChar\right)}}} \]
                      2. Taylor expanded in NaChar around inf

                        \[\leadsto \frac{1}{2} \cdot \frac{1}{\frac{\left(1 + \frac{{NdChar}^{2}}{{NaChar}^{2}}\right) - \frac{NdChar}{NaChar}}{\color{blue}{NaChar}}} \]
                      3. Step-by-step derivation
                        1. Applied rewrites23.1%

                          \[\leadsto 0.5 \cdot \frac{1}{\frac{\mathsf{fma}\left(\frac{NdChar}{NaChar}, \frac{NdChar}{NaChar}, 1\right) - \frac{NdChar}{NaChar}}{\color{blue}{NaChar}}} \]
                        2. Taylor expanded in NaChar around 0

                          \[\leadsto \frac{1}{2} \cdot \frac{1}{\frac{\frac{-1 \cdot \left(NaChar \cdot NdChar\right) + {NdChar}^{2}}{{NaChar}^{2}}}{NaChar}} \]
                        3. Step-by-step derivation
                          1. Applied rewrites34.0%

                            \[\leadsto 0.5 \cdot \frac{1}{\frac{\frac{\mathsf{fma}\left(-NaChar, NdChar, NdChar \cdot NdChar\right)}{NaChar \cdot NaChar}}{NaChar}} \]

                          if 0.0 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.99999999999999966e-103

                          1. Initial program 100.0%

                            \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                          2. Add Preprocessing
                          3. Taylor expanded in KbT around inf

                            \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                          4. Step-by-step derivation
                            1. +-commutativeN/A

                              \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                            2. distribute-lft-outN/A

                              \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                            3. lower-*.f64N/A

                              \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                            4. lower-+.f649.1

                              \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                          5. Applied rewrites9.1%

                            \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                          6. Taylor expanded in NdChar around 0

                            \[\leadsto \frac{1}{2} \cdot \color{blue}{NaChar} \]
                          7. Step-by-step derivation
                            1. Applied rewrites13.0%

                              \[\leadsto 0.5 \cdot \color{blue}{NaChar} \]
                            2. Taylor expanded in NdChar around inf

                              \[\leadsto \frac{1}{2} \cdot \color{blue}{NdChar} \]
                            3. Step-by-step derivation
                              1. Applied rewrites27.2%

                                \[\leadsto 0.5 \cdot \color{blue}{NdChar} \]
                            4. Recombined 3 regimes into one program.
                            5. Final simplification36.5%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq -1 \cdot 10^{-214}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 0:\\ \;\;\;\;\frac{1}{\frac{\frac{\mathsf{fma}\left(-NaChar, NdChar, NdChar \cdot NdChar\right)}{NaChar \cdot NaChar}}{NaChar}} \cdot 0.5\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 5 \cdot 10^{-103}:\\ \;\;\;\;0.5 \cdot NdChar\\ \mathbf{else}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \end{array} \]
                            6. Add Preprocessing

                            Alternative 6: 33.5% accurate, 0.3× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\ t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-214}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{1}{\frac{\frac{NdChar}{NaChar} \cdot \frac{NdChar}{NaChar}}{NaChar}} \cdot 0.5\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-103}:\\ \;\;\;\;0.5 \cdot NdChar\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                            (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                             :precision binary64
                             (let* ((t_0 (* (+ NaChar NdChar) 0.5))
                                    (t_1
                                     (-
                                      (/ NdChar (+ 1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT))))
                                      (/ NaChar (- -1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))))))
                               (if (<= t_1 -1e-214)
                                 t_0
                                 (if (<= t_1 0.0)
                                   (* (/ 1.0 (/ (* (/ NdChar NaChar) (/ NdChar NaChar)) NaChar)) 0.5)
                                   (if (<= t_1 5e-103) (* 0.5 NdChar) t_0)))))
                            double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                            	double t_0 = (NaChar + NdChar) * 0.5;
                            	double t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                            	double tmp;
                            	if (t_1 <= -1e-214) {
                            		tmp = t_0;
                            	} else if (t_1 <= 0.0) {
                            		tmp = (1.0 / (((NdChar / NaChar) * (NdChar / NaChar)) / NaChar)) * 0.5;
                            	} else if (t_1 <= 5e-103) {
                            		tmp = 0.5 * NdChar;
                            	} else {
                            		tmp = t_0;
                            	}
                            	return tmp;
                            }
                            
                            real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                                real(8), intent (in) :: ndchar
                                real(8), intent (in) :: ec
                                real(8), intent (in) :: vef
                                real(8), intent (in) :: edonor
                                real(8), intent (in) :: mu
                                real(8), intent (in) :: kbt
                                real(8), intent (in) :: nachar
                                real(8), intent (in) :: ev
                                real(8), intent (in) :: eaccept
                                real(8) :: t_0
                                real(8) :: t_1
                                real(8) :: tmp
                                t_0 = (nachar + ndchar) * 0.5d0
                                t_1 = (ndchar / (1.0d0 + exp(((mu - ((ec - vef) - edonor)) / kbt)))) - (nachar / ((-1.0d0) - exp((((eaccept + (ev + vef)) - mu) / kbt))))
                                if (t_1 <= (-1d-214)) then
                                    tmp = t_0
                                else if (t_1 <= 0.0d0) then
                                    tmp = (1.0d0 / (((ndchar / nachar) * (ndchar / nachar)) / nachar)) * 0.5d0
                                else if (t_1 <= 5d-103) then
                                    tmp = 0.5d0 * ndchar
                                else
                                    tmp = t_0
                                end if
                                code = tmp
                            end function
                            
                            public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                            	double t_0 = (NaChar + NdChar) * 0.5;
                            	double t_1 = (NdChar / (1.0 + Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                            	double tmp;
                            	if (t_1 <= -1e-214) {
                            		tmp = t_0;
                            	} else if (t_1 <= 0.0) {
                            		tmp = (1.0 / (((NdChar / NaChar) * (NdChar / NaChar)) / NaChar)) * 0.5;
                            	} else if (t_1 <= 5e-103) {
                            		tmp = 0.5 * NdChar;
                            	} else {
                            		tmp = t_0;
                            	}
                            	return tmp;
                            }
                            
                            def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                            	t_0 = (NaChar + NdChar) * 0.5
                            	t_1 = (NdChar / (1.0 + math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))))
                            	tmp = 0
                            	if t_1 <= -1e-214:
                            		tmp = t_0
                            	elif t_1 <= 0.0:
                            		tmp = (1.0 / (((NdChar / NaChar) * (NdChar / NaChar)) / NaChar)) * 0.5
                            	elif t_1 <= 5e-103:
                            		tmp = 0.5 * NdChar
                            	else:
                            		tmp = t_0
                            	return tmp
                            
                            function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                            	t_0 = Float64(Float64(NaChar + NdChar) * 0.5)
                            	t_1 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)))))
                            	tmp = 0.0
                            	if (t_1 <= -1e-214)
                            		tmp = t_0;
                            	elseif (t_1 <= 0.0)
                            		tmp = Float64(Float64(1.0 / Float64(Float64(Float64(NdChar / NaChar) * Float64(NdChar / NaChar)) / NaChar)) * 0.5);
                            	elseif (t_1 <= 5e-103)
                            		tmp = Float64(0.5 * NdChar);
                            	else
                            		tmp = t_0;
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                            	t_0 = (NaChar + NdChar) * 0.5;
                            	t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                            	tmp = 0.0;
                            	if (t_1 <= -1e-214)
                            		tmp = t_0;
                            	elseif (t_1 <= 0.0)
                            		tmp = (1.0 / (((NdChar / NaChar) * (NdChar / NaChar)) / NaChar)) * 0.5;
                            	elseif (t_1 <= 5e-103)
                            		tmp = 0.5 * NdChar;
                            	else
                            		tmp = t_0;
                            	end
                            	tmp_2 = tmp;
                            end
                            
                            code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-214], t$95$0, If[LessEqual[t$95$1, 0.0], N[(N[(1.0 / N[(N[(N[(NdChar / NaChar), $MachinePrecision] * N[(NdChar / NaChar), $MachinePrecision]), $MachinePrecision] / NaChar), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[t$95$1, 5e-103], N[(0.5 * NdChar), $MachinePrecision], t$95$0]]]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
                            t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\
                            \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-214}:\\
                            \;\;\;\;t\_0\\
                            
                            \mathbf{elif}\;t\_1 \leq 0:\\
                            \;\;\;\;\frac{1}{\frac{\frac{NdChar}{NaChar} \cdot \frac{NdChar}{NaChar}}{NaChar}} \cdot 0.5\\
                            
                            \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-103}:\\
                            \;\;\;\;0.5 \cdot NdChar\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;t\_0\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -9.99999999999999913e-215 or 4.99999999999999966e-103 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT)))))

                              1. Initial program 100.0%

                                \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                              2. Add Preprocessing
                              3. Taylor expanded in KbT around inf

                                \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                              4. Step-by-step derivation
                                1. +-commutativeN/A

                                  \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                2. distribute-lft-outN/A

                                  \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                3. lower-*.f64N/A

                                  \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                4. lower-+.f6438.7

                                  \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                              5. Applied rewrites38.7%

                                \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]

                              if -9.99999999999999913e-215 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 0.0

                              1. Initial program 100.0%

                                \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                              2. Add Preprocessing
                              3. Taylor expanded in KbT around inf

                                \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                              4. Step-by-step derivation
                                1. +-commutativeN/A

                                  \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                2. distribute-lft-outN/A

                                  \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                3. lower-*.f64N/A

                                  \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                4. lower-+.f642.5

                                  \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                              5. Applied rewrites2.5%

                                \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                              6. Step-by-step derivation
                                1. Applied rewrites3.9%

                                  \[\leadsto 0.5 \cdot \frac{1}{\color{blue}{\frac{NdChar - NaChar}{\left(NaChar + NdChar\right) \cdot \left(NdChar - NaChar\right)}}} \]
                                2. Taylor expanded in NaChar around inf

                                  \[\leadsto \frac{1}{2} \cdot \frac{1}{\frac{\left(1 + \frac{{NdChar}^{2}}{{NaChar}^{2}}\right) - \frac{NdChar}{NaChar}}{\color{blue}{NaChar}}} \]
                                3. Step-by-step derivation
                                  1. Applied rewrites23.1%

                                    \[\leadsto 0.5 \cdot \frac{1}{\frac{\mathsf{fma}\left(\frac{NdChar}{NaChar}, \frac{NdChar}{NaChar}, 1\right) - \frac{NdChar}{NaChar}}{\color{blue}{NaChar}}} \]
                                  2. Taylor expanded in NdChar around inf

                                    \[\leadsto \frac{1}{2} \cdot \frac{1}{\frac{\frac{{NdChar}^{2}}{{NaChar}^{2}}}{NaChar}} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites32.7%

                                      \[\leadsto 0.5 \cdot \frac{1}{\frac{\frac{NdChar}{NaChar} \cdot \frac{NdChar}{NaChar}}{NaChar}} \]

                                    if 0.0 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.99999999999999966e-103

                                    1. Initial program 100.0%

                                      \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                    2. Add Preprocessing
                                    3. Taylor expanded in KbT around inf

                                      \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                    4. Step-by-step derivation
                                      1. +-commutativeN/A

                                        \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                      2. distribute-lft-outN/A

                                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                      3. lower-*.f64N/A

                                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                      4. lower-+.f649.1

                                        \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                    5. Applied rewrites9.1%

                                      \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                                    6. Taylor expanded in NdChar around 0

                                      \[\leadsto \frac{1}{2} \cdot \color{blue}{NaChar} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites13.0%

                                        \[\leadsto 0.5 \cdot \color{blue}{NaChar} \]
                                      2. Taylor expanded in NdChar around inf

                                        \[\leadsto \frac{1}{2} \cdot \color{blue}{NdChar} \]
                                      3. Step-by-step derivation
                                        1. Applied rewrites27.2%

                                          \[\leadsto 0.5 \cdot \color{blue}{NdChar} \]
                                      4. Recombined 3 regimes into one program.
                                      5. Final simplification36.1%

                                        \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq -1 \cdot 10^{-214}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 0:\\ \;\;\;\;\frac{1}{\frac{\frac{NdChar}{NaChar} \cdot \frac{NdChar}{NaChar}}{NaChar}} \cdot 0.5\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 5 \cdot 10^{-103}:\\ \;\;\;\;0.5 \cdot NdChar\\ \mathbf{else}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \end{array} \]
                                      6. Add Preprocessing

                                      Alternative 7: 32.9% accurate, 0.3× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\ t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-214}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{1}{\frac{1}{NaChar} - \frac{NdChar}{NaChar \cdot NaChar}} \cdot 0.5\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-103}:\\ \;\;\;\;0.5 \cdot NdChar\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                      (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                       :precision binary64
                                       (let* ((t_0 (* (+ NaChar NdChar) 0.5))
                                              (t_1
                                               (-
                                                (/ NdChar (+ 1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT))))
                                                (/ NaChar (- -1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))))))
                                         (if (<= t_1 -1e-214)
                                           t_0
                                           (if (<= t_1 0.0)
                                             (* (/ 1.0 (- (/ 1.0 NaChar) (/ NdChar (* NaChar NaChar)))) 0.5)
                                             (if (<= t_1 5e-103) (* 0.5 NdChar) t_0)))))
                                      double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                      	double t_0 = (NaChar + NdChar) * 0.5;
                                      	double t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                      	double tmp;
                                      	if (t_1 <= -1e-214) {
                                      		tmp = t_0;
                                      	} else if (t_1 <= 0.0) {
                                      		tmp = (1.0 / ((1.0 / NaChar) - (NdChar / (NaChar * NaChar)))) * 0.5;
                                      	} else if (t_1 <= 5e-103) {
                                      		tmp = 0.5 * NdChar;
                                      	} else {
                                      		tmp = t_0;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                                          real(8), intent (in) :: ndchar
                                          real(8), intent (in) :: ec
                                          real(8), intent (in) :: vef
                                          real(8), intent (in) :: edonor
                                          real(8), intent (in) :: mu
                                          real(8), intent (in) :: kbt
                                          real(8), intent (in) :: nachar
                                          real(8), intent (in) :: ev
                                          real(8), intent (in) :: eaccept
                                          real(8) :: t_0
                                          real(8) :: t_1
                                          real(8) :: tmp
                                          t_0 = (nachar + ndchar) * 0.5d0
                                          t_1 = (ndchar / (1.0d0 + exp(((mu - ((ec - vef) - edonor)) / kbt)))) - (nachar / ((-1.0d0) - exp((((eaccept + (ev + vef)) - mu) / kbt))))
                                          if (t_1 <= (-1d-214)) then
                                              tmp = t_0
                                          else if (t_1 <= 0.0d0) then
                                              tmp = (1.0d0 / ((1.0d0 / nachar) - (ndchar / (nachar * nachar)))) * 0.5d0
                                          else if (t_1 <= 5d-103) then
                                              tmp = 0.5d0 * ndchar
                                          else
                                              tmp = t_0
                                          end if
                                          code = tmp
                                      end function
                                      
                                      public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                      	double t_0 = (NaChar + NdChar) * 0.5;
                                      	double t_1 = (NdChar / (1.0 + Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                      	double tmp;
                                      	if (t_1 <= -1e-214) {
                                      		tmp = t_0;
                                      	} else if (t_1 <= 0.0) {
                                      		tmp = (1.0 / ((1.0 / NaChar) - (NdChar / (NaChar * NaChar)))) * 0.5;
                                      	} else if (t_1 <= 5e-103) {
                                      		tmp = 0.5 * NdChar;
                                      	} else {
                                      		tmp = t_0;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                      	t_0 = (NaChar + NdChar) * 0.5
                                      	t_1 = (NdChar / (1.0 + math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))))
                                      	tmp = 0
                                      	if t_1 <= -1e-214:
                                      		tmp = t_0
                                      	elif t_1 <= 0.0:
                                      		tmp = (1.0 / ((1.0 / NaChar) - (NdChar / (NaChar * NaChar)))) * 0.5
                                      	elif t_1 <= 5e-103:
                                      		tmp = 0.5 * NdChar
                                      	else:
                                      		tmp = t_0
                                      	return tmp
                                      
                                      function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                      	t_0 = Float64(Float64(NaChar + NdChar) * 0.5)
                                      	t_1 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)))))
                                      	tmp = 0.0
                                      	if (t_1 <= -1e-214)
                                      		tmp = t_0;
                                      	elseif (t_1 <= 0.0)
                                      		tmp = Float64(Float64(1.0 / Float64(Float64(1.0 / NaChar) - Float64(NdChar / Float64(NaChar * NaChar)))) * 0.5);
                                      	elseif (t_1 <= 5e-103)
                                      		tmp = Float64(0.5 * NdChar);
                                      	else
                                      		tmp = t_0;
                                      	end
                                      	return tmp
                                      end
                                      
                                      function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                      	t_0 = (NaChar + NdChar) * 0.5;
                                      	t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                      	tmp = 0.0;
                                      	if (t_1 <= -1e-214)
                                      		tmp = t_0;
                                      	elseif (t_1 <= 0.0)
                                      		tmp = (1.0 / ((1.0 / NaChar) - (NdChar / (NaChar * NaChar)))) * 0.5;
                                      	elseif (t_1 <= 5e-103)
                                      		tmp = 0.5 * NdChar;
                                      	else
                                      		tmp = t_0;
                                      	end
                                      	tmp_2 = tmp;
                                      end
                                      
                                      code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-214], t$95$0, If[LessEqual[t$95$1, 0.0], N[(N[(1.0 / N[(N[(1.0 / NaChar), $MachinePrecision] - N[(NdChar / N[(NaChar * NaChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[t$95$1, 5e-103], N[(0.5 * NdChar), $MachinePrecision], t$95$0]]]]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
                                      t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\
                                      \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-214}:\\
                                      \;\;\;\;t\_0\\
                                      
                                      \mathbf{elif}\;t\_1 \leq 0:\\
                                      \;\;\;\;\frac{1}{\frac{1}{NaChar} - \frac{NdChar}{NaChar \cdot NaChar}} \cdot 0.5\\
                                      
                                      \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-103}:\\
                                      \;\;\;\;0.5 \cdot NdChar\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;t\_0\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 3 regimes
                                      2. if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -9.99999999999999913e-215 or 4.99999999999999966e-103 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT)))))

                                        1. Initial program 100.0%

                                          \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                        2. Add Preprocessing
                                        3. Taylor expanded in KbT around inf

                                          \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                        4. Step-by-step derivation
                                          1. +-commutativeN/A

                                            \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                          2. distribute-lft-outN/A

                                            \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                          3. lower-*.f64N/A

                                            \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                          4. lower-+.f6438.7

                                            \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                        5. Applied rewrites38.7%

                                          \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]

                                        if -9.99999999999999913e-215 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 0.0

                                        1. Initial program 100.0%

                                          \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                        2. Add Preprocessing
                                        3. Taylor expanded in KbT around inf

                                          \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                        4. Step-by-step derivation
                                          1. +-commutativeN/A

                                            \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                          2. distribute-lft-outN/A

                                            \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                          3. lower-*.f64N/A

                                            \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                          4. lower-+.f642.5

                                            \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                        5. Applied rewrites2.5%

                                          \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                                        6. Step-by-step derivation
                                          1. Applied rewrites3.9%

                                            \[\leadsto 0.5 \cdot \frac{1}{\color{blue}{\frac{NdChar - NaChar}{\left(NaChar + NdChar\right) \cdot \left(NdChar - NaChar\right)}}} \]
                                          2. Taylor expanded in NdChar around 0

                                            \[\leadsto \frac{1}{2} \cdot \frac{1}{-1 \cdot \frac{NdChar}{{NaChar}^{2}} + \color{blue}{\frac{1}{NaChar}}} \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites28.5%

                                              \[\leadsto 0.5 \cdot \frac{1}{\frac{1}{NaChar} - \color{blue}{\frac{NdChar}{NaChar \cdot NaChar}}} \]

                                            if 0.0 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.99999999999999966e-103

                                            1. Initial program 100.0%

                                              \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                            2. Add Preprocessing
                                            3. Taylor expanded in KbT around inf

                                              \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                            4. Step-by-step derivation
                                              1. +-commutativeN/A

                                                \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                              2. distribute-lft-outN/A

                                                \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                              3. lower-*.f64N/A

                                                \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                              4. lower-+.f649.1

                                                \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                            5. Applied rewrites9.1%

                                              \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                                            6. Taylor expanded in NdChar around 0

                                              \[\leadsto \frac{1}{2} \cdot \color{blue}{NaChar} \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites13.0%

                                                \[\leadsto 0.5 \cdot \color{blue}{NaChar} \]
                                              2. Taylor expanded in NdChar around inf

                                                \[\leadsto \frac{1}{2} \cdot \color{blue}{NdChar} \]
                                              3. Step-by-step derivation
                                                1. Applied rewrites27.2%

                                                  \[\leadsto 0.5 \cdot \color{blue}{NdChar} \]
                                              4. Recombined 3 regimes into one program.
                                              5. Final simplification35.1%

                                                \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq -1 \cdot 10^{-214}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 0:\\ \;\;\;\;\frac{1}{\frac{1}{NaChar} - \frac{NdChar}{NaChar \cdot NaChar}} \cdot 0.5\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 5 \cdot 10^{-103}:\\ \;\;\;\;0.5 \cdot NdChar\\ \mathbf{else}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \end{array} \]
                                              6. Add Preprocessing

                                              Alternative 8: 32.0% accurate, 0.3× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\ t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-214}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{1}{\frac{1 - \frac{NdChar}{NaChar}}{NaChar}} \cdot 0.5\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-103}:\\ \;\;\;\;0.5 \cdot NdChar\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                              (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                               :precision binary64
                                               (let* ((t_0 (* (+ NaChar NdChar) 0.5))
                                                      (t_1
                                                       (-
                                                        (/ NdChar (+ 1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT))))
                                                        (/ NaChar (- -1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))))))
                                                 (if (<= t_1 -1e-214)
                                                   t_0
                                                   (if (<= t_1 0.0)
                                                     (* (/ 1.0 (/ (- 1.0 (/ NdChar NaChar)) NaChar)) 0.5)
                                                     (if (<= t_1 5e-103) (* 0.5 NdChar) t_0)))))
                                              double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                              	double t_0 = (NaChar + NdChar) * 0.5;
                                              	double t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                              	double tmp;
                                              	if (t_1 <= -1e-214) {
                                              		tmp = t_0;
                                              	} else if (t_1 <= 0.0) {
                                              		tmp = (1.0 / ((1.0 - (NdChar / NaChar)) / NaChar)) * 0.5;
                                              	} else if (t_1 <= 5e-103) {
                                              		tmp = 0.5 * NdChar;
                                              	} else {
                                              		tmp = t_0;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                                                  real(8), intent (in) :: ndchar
                                                  real(8), intent (in) :: ec
                                                  real(8), intent (in) :: vef
                                                  real(8), intent (in) :: edonor
                                                  real(8), intent (in) :: mu
                                                  real(8), intent (in) :: kbt
                                                  real(8), intent (in) :: nachar
                                                  real(8), intent (in) :: ev
                                                  real(8), intent (in) :: eaccept
                                                  real(8) :: t_0
                                                  real(8) :: t_1
                                                  real(8) :: tmp
                                                  t_0 = (nachar + ndchar) * 0.5d0
                                                  t_1 = (ndchar / (1.0d0 + exp(((mu - ((ec - vef) - edonor)) / kbt)))) - (nachar / ((-1.0d0) - exp((((eaccept + (ev + vef)) - mu) / kbt))))
                                                  if (t_1 <= (-1d-214)) then
                                                      tmp = t_0
                                                  else if (t_1 <= 0.0d0) then
                                                      tmp = (1.0d0 / ((1.0d0 - (ndchar / nachar)) / nachar)) * 0.5d0
                                                  else if (t_1 <= 5d-103) then
                                                      tmp = 0.5d0 * ndchar
                                                  else
                                                      tmp = t_0
                                                  end if
                                                  code = tmp
                                              end function
                                              
                                              public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                              	double t_0 = (NaChar + NdChar) * 0.5;
                                              	double t_1 = (NdChar / (1.0 + Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                              	double tmp;
                                              	if (t_1 <= -1e-214) {
                                              		tmp = t_0;
                                              	} else if (t_1 <= 0.0) {
                                              		tmp = (1.0 / ((1.0 - (NdChar / NaChar)) / NaChar)) * 0.5;
                                              	} else if (t_1 <= 5e-103) {
                                              		tmp = 0.5 * NdChar;
                                              	} else {
                                              		tmp = t_0;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                              	t_0 = (NaChar + NdChar) * 0.5
                                              	t_1 = (NdChar / (1.0 + math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))))
                                              	tmp = 0
                                              	if t_1 <= -1e-214:
                                              		tmp = t_0
                                              	elif t_1 <= 0.0:
                                              		tmp = (1.0 / ((1.0 - (NdChar / NaChar)) / NaChar)) * 0.5
                                              	elif t_1 <= 5e-103:
                                              		tmp = 0.5 * NdChar
                                              	else:
                                              		tmp = t_0
                                              	return tmp
                                              
                                              function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                              	t_0 = Float64(Float64(NaChar + NdChar) * 0.5)
                                              	t_1 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)))))
                                              	tmp = 0.0
                                              	if (t_1 <= -1e-214)
                                              		tmp = t_0;
                                              	elseif (t_1 <= 0.0)
                                              		tmp = Float64(Float64(1.0 / Float64(Float64(1.0 - Float64(NdChar / NaChar)) / NaChar)) * 0.5);
                                              	elseif (t_1 <= 5e-103)
                                              		tmp = Float64(0.5 * NdChar);
                                              	else
                                              		tmp = t_0;
                                              	end
                                              	return tmp
                                              end
                                              
                                              function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                              	t_0 = (NaChar + NdChar) * 0.5;
                                              	t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                              	tmp = 0.0;
                                              	if (t_1 <= -1e-214)
                                              		tmp = t_0;
                                              	elseif (t_1 <= 0.0)
                                              		tmp = (1.0 / ((1.0 - (NdChar / NaChar)) / NaChar)) * 0.5;
                                              	elseif (t_1 <= 5e-103)
                                              		tmp = 0.5 * NdChar;
                                              	else
                                              		tmp = t_0;
                                              	end
                                              	tmp_2 = tmp;
                                              end
                                              
                                              code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-214], t$95$0, If[LessEqual[t$95$1, 0.0], N[(N[(1.0 / N[(N[(1.0 - N[(NdChar / NaChar), $MachinePrecision]), $MachinePrecision] / NaChar), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[t$95$1, 5e-103], N[(0.5 * NdChar), $MachinePrecision], t$95$0]]]]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
                                              t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\
                                              \mathbf{if}\;t\_1 \leq -1 \cdot 10^{-214}:\\
                                              \;\;\;\;t\_0\\
                                              
                                              \mathbf{elif}\;t\_1 \leq 0:\\
                                              \;\;\;\;\frac{1}{\frac{1 - \frac{NdChar}{NaChar}}{NaChar}} \cdot 0.5\\
                                              
                                              \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-103}:\\
                                              \;\;\;\;0.5 \cdot NdChar\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;t\_0\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 3 regimes
                                              2. if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -9.99999999999999913e-215 or 4.99999999999999966e-103 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT)))))

                                                1. Initial program 100.0%

                                                  \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                2. Add Preprocessing
                                                3. Taylor expanded in KbT around inf

                                                  \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                4. Step-by-step derivation
                                                  1. +-commutativeN/A

                                                    \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                  2. distribute-lft-outN/A

                                                    \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                  3. lower-*.f64N/A

                                                    \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                  4. lower-+.f6438.7

                                                    \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                5. Applied rewrites38.7%

                                                  \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]

                                                if -9.99999999999999913e-215 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 0.0

                                                1. Initial program 100.0%

                                                  \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                2. Add Preprocessing
                                                3. Taylor expanded in KbT around inf

                                                  \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                4. Step-by-step derivation
                                                  1. +-commutativeN/A

                                                    \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                  2. distribute-lft-outN/A

                                                    \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                  3. lower-*.f64N/A

                                                    \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                  4. lower-+.f642.5

                                                    \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                5. Applied rewrites2.5%

                                                  \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                                                6. Step-by-step derivation
                                                  1. Applied rewrites3.9%

                                                    \[\leadsto 0.5 \cdot \frac{1}{\color{blue}{\frac{NdChar - NaChar}{\left(NaChar + NdChar\right) \cdot \left(NdChar - NaChar\right)}}} \]
                                                  2. Taylor expanded in NaChar around inf

                                                    \[\leadsto \frac{1}{2} \cdot \frac{1}{\frac{1 + -1 \cdot \frac{NdChar}{NaChar}}{\color{blue}{NaChar}}} \]
                                                  3. Step-by-step derivation
                                                    1. Applied rewrites28.4%

                                                      \[\leadsto 0.5 \cdot \frac{1}{\frac{1 - \frac{NdChar}{NaChar}}{\color{blue}{NaChar}}} \]

                                                    if 0.0 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.99999999999999966e-103

                                                    1. Initial program 100.0%

                                                      \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                    2. Add Preprocessing
                                                    3. Taylor expanded in KbT around inf

                                                      \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                    4. Step-by-step derivation
                                                      1. +-commutativeN/A

                                                        \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                      2. distribute-lft-outN/A

                                                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                      3. lower-*.f64N/A

                                                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                      4. lower-+.f649.1

                                                        \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                    5. Applied rewrites9.1%

                                                      \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                                                    6. Taylor expanded in NdChar around 0

                                                      \[\leadsto \frac{1}{2} \cdot \color{blue}{NaChar} \]
                                                    7. Step-by-step derivation
                                                      1. Applied rewrites13.0%

                                                        \[\leadsto 0.5 \cdot \color{blue}{NaChar} \]
                                                      2. Taylor expanded in NdChar around inf

                                                        \[\leadsto \frac{1}{2} \cdot \color{blue}{NdChar} \]
                                                      3. Step-by-step derivation
                                                        1. Applied rewrites27.2%

                                                          \[\leadsto 0.5 \cdot \color{blue}{NdChar} \]
                                                      4. Recombined 3 regimes into one program.
                                                      5. Final simplification35.1%

                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq -1 \cdot 10^{-214}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 0:\\ \;\;\;\;\frac{1}{\frac{1 - \frac{NdChar}{NaChar}}{NaChar}} \cdot 0.5\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 5 \cdot 10^{-103}:\\ \;\;\;\;0.5 \cdot NdChar\\ \mathbf{else}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \end{array} \]
                                                      6. Add Preprocessing

                                                      Alternative 9: 33.0% accurate, 0.3× speedup?

                                                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\ t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{-228}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{1}{\frac{NdChar - NaChar}{NdChar \cdot NdChar}} \cdot 0.5\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-103}:\\ \;\;\;\;0.5 \cdot NdChar\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                                      (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                       :precision binary64
                                                       (let* ((t_0 (* (+ NaChar NdChar) 0.5))
                                                              (t_1
                                                               (-
                                                                (/ NdChar (+ 1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT))))
                                                                (/ NaChar (- -1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))))))
                                                         (if (<= t_1 -4e-228)
                                                           t_0
                                                           (if (<= t_1 0.0)
                                                             (* (/ 1.0 (/ (- NdChar NaChar) (* NdChar NdChar))) 0.5)
                                                             (if (<= t_1 5e-103) (* 0.5 NdChar) t_0)))))
                                                      double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                      	double t_0 = (NaChar + NdChar) * 0.5;
                                                      	double t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                                      	double tmp;
                                                      	if (t_1 <= -4e-228) {
                                                      		tmp = t_0;
                                                      	} else if (t_1 <= 0.0) {
                                                      		tmp = (1.0 / ((NdChar - NaChar) / (NdChar * NdChar))) * 0.5;
                                                      	} else if (t_1 <= 5e-103) {
                                                      		tmp = 0.5 * NdChar;
                                                      	} else {
                                                      		tmp = t_0;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                                                          real(8), intent (in) :: ndchar
                                                          real(8), intent (in) :: ec
                                                          real(8), intent (in) :: vef
                                                          real(8), intent (in) :: edonor
                                                          real(8), intent (in) :: mu
                                                          real(8), intent (in) :: kbt
                                                          real(8), intent (in) :: nachar
                                                          real(8), intent (in) :: ev
                                                          real(8), intent (in) :: eaccept
                                                          real(8) :: t_0
                                                          real(8) :: t_1
                                                          real(8) :: tmp
                                                          t_0 = (nachar + ndchar) * 0.5d0
                                                          t_1 = (ndchar / (1.0d0 + exp(((mu - ((ec - vef) - edonor)) / kbt)))) - (nachar / ((-1.0d0) - exp((((eaccept + (ev + vef)) - mu) / kbt))))
                                                          if (t_1 <= (-4d-228)) then
                                                              tmp = t_0
                                                          else if (t_1 <= 0.0d0) then
                                                              tmp = (1.0d0 / ((ndchar - nachar) / (ndchar * ndchar))) * 0.5d0
                                                          else if (t_1 <= 5d-103) then
                                                              tmp = 0.5d0 * ndchar
                                                          else
                                                              tmp = t_0
                                                          end if
                                                          code = tmp
                                                      end function
                                                      
                                                      public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                      	double t_0 = (NaChar + NdChar) * 0.5;
                                                      	double t_1 = (NdChar / (1.0 + Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                                      	double tmp;
                                                      	if (t_1 <= -4e-228) {
                                                      		tmp = t_0;
                                                      	} else if (t_1 <= 0.0) {
                                                      		tmp = (1.0 / ((NdChar - NaChar) / (NdChar * NdChar))) * 0.5;
                                                      	} else if (t_1 <= 5e-103) {
                                                      		tmp = 0.5 * NdChar;
                                                      	} else {
                                                      		tmp = t_0;
                                                      	}
                                                      	return tmp;
                                                      }
                                                      
                                                      def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                                      	t_0 = (NaChar + NdChar) * 0.5
                                                      	t_1 = (NdChar / (1.0 + math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))))
                                                      	tmp = 0
                                                      	if t_1 <= -4e-228:
                                                      		tmp = t_0
                                                      	elif t_1 <= 0.0:
                                                      		tmp = (1.0 / ((NdChar - NaChar) / (NdChar * NdChar))) * 0.5
                                                      	elif t_1 <= 5e-103:
                                                      		tmp = 0.5 * NdChar
                                                      	else:
                                                      		tmp = t_0
                                                      	return tmp
                                                      
                                                      function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                      	t_0 = Float64(Float64(NaChar + NdChar) * 0.5)
                                                      	t_1 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)))))
                                                      	tmp = 0.0
                                                      	if (t_1 <= -4e-228)
                                                      		tmp = t_0;
                                                      	elseif (t_1 <= 0.0)
                                                      		tmp = Float64(Float64(1.0 / Float64(Float64(NdChar - NaChar) / Float64(NdChar * NdChar))) * 0.5);
                                                      	elseif (t_1 <= 5e-103)
                                                      		tmp = Float64(0.5 * NdChar);
                                                      	else
                                                      		tmp = t_0;
                                                      	end
                                                      	return tmp
                                                      end
                                                      
                                                      function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                      	t_0 = (NaChar + NdChar) * 0.5;
                                                      	t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                                      	tmp = 0.0;
                                                      	if (t_1 <= -4e-228)
                                                      		tmp = t_0;
                                                      	elseif (t_1 <= 0.0)
                                                      		tmp = (1.0 / ((NdChar - NaChar) / (NdChar * NdChar))) * 0.5;
                                                      	elseif (t_1 <= 5e-103)
                                                      		tmp = 0.5 * NdChar;
                                                      	else
                                                      		tmp = t_0;
                                                      	end
                                                      	tmp_2 = tmp;
                                                      end
                                                      
                                                      code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-228], t$95$0, If[LessEqual[t$95$1, 0.0], N[(N[(1.0 / N[(N[(NdChar - NaChar), $MachinePrecision] / N[(NdChar * NdChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[t$95$1, 5e-103], N[(0.5 * NdChar), $MachinePrecision], t$95$0]]]]]
                                                      
                                                      \begin{array}{l}
                                                      
                                                      \\
                                                      \begin{array}{l}
                                                      t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
                                                      t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\
                                                      \mathbf{if}\;t\_1 \leq -4 \cdot 10^{-228}:\\
                                                      \;\;\;\;t\_0\\
                                                      
                                                      \mathbf{elif}\;t\_1 \leq 0:\\
                                                      \;\;\;\;\frac{1}{\frac{NdChar - NaChar}{NdChar \cdot NdChar}} \cdot 0.5\\
                                                      
                                                      \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-103}:\\
                                                      \;\;\;\;0.5 \cdot NdChar\\
                                                      
                                                      \mathbf{else}:\\
                                                      \;\;\;\;t\_0\\
                                                      
                                                      
                                                      \end{array}
                                                      \end{array}
                                                      
                                                      Derivation
                                                      1. Split input into 3 regimes
                                                      2. if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -4.00000000000000013e-228 or 4.99999999999999966e-103 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT)))))

                                                        1. Initial program 100.0%

                                                          \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                        2. Add Preprocessing
                                                        3. Taylor expanded in KbT around inf

                                                          \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                        4. Step-by-step derivation
                                                          1. +-commutativeN/A

                                                            \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                          2. distribute-lft-outN/A

                                                            \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                          3. lower-*.f64N/A

                                                            \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                          4. lower-+.f6438.0

                                                            \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                        5. Applied rewrites38.0%

                                                          \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]

                                                        if -4.00000000000000013e-228 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 0.0

                                                        1. Initial program 100.0%

                                                          \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                        2. Add Preprocessing
                                                        3. Taylor expanded in KbT around inf

                                                          \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                        4. Step-by-step derivation
                                                          1. +-commutativeN/A

                                                            \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                          2. distribute-lft-outN/A

                                                            \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                          3. lower-*.f64N/A

                                                            \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                          4. lower-+.f642.6

                                                            \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                        5. Applied rewrites2.6%

                                                          \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                                                        6. Step-by-step derivation
                                                          1. Applied rewrites4.0%

                                                            \[\leadsto 0.5 \cdot \frac{1}{\color{blue}{\frac{NdChar - NaChar}{\left(NaChar + NdChar\right) \cdot \left(NdChar - NaChar\right)}}} \]
                                                          2. Taylor expanded in NdChar around inf

                                                            \[\leadsto \frac{1}{2} \cdot \frac{1}{\frac{1 + -1 \cdot \frac{NaChar}{NdChar}}{\color{blue}{NdChar}}} \]
                                                          3. Step-by-step derivation
                                                            1. Applied rewrites19.9%

                                                              \[\leadsto 0.5 \cdot \frac{1}{\frac{1 - \frac{NaChar}{NdChar}}{\color{blue}{NdChar}}} \]
                                                            2. Taylor expanded in NdChar around 0

                                                              \[\leadsto \frac{1}{2} \cdot \frac{1}{\frac{NdChar + -1 \cdot NaChar}{{NdChar}^{\color{blue}{2}}}} \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites22.9%

                                                                \[\leadsto 0.5 \cdot \frac{1}{\frac{NdChar - NaChar}{NdChar \cdot \color{blue}{NdChar}}} \]

                                                              if 0.0 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.99999999999999966e-103

                                                              1. Initial program 100.0%

                                                                \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                              2. Add Preprocessing
                                                              3. Taylor expanded in KbT around inf

                                                                \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                              4. Step-by-step derivation
                                                                1. +-commutativeN/A

                                                                  \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                                2. distribute-lft-outN/A

                                                                  \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                3. lower-*.f64N/A

                                                                  \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                4. lower-+.f649.1

                                                                  \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                              5. Applied rewrites9.1%

                                                                \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                                                              6. Taylor expanded in NdChar around 0

                                                                \[\leadsto \frac{1}{2} \cdot \color{blue}{NaChar} \]
                                                              7. Step-by-step derivation
                                                                1. Applied rewrites13.0%

                                                                  \[\leadsto 0.5 \cdot \color{blue}{NaChar} \]
                                                                2. Taylor expanded in NdChar around inf

                                                                  \[\leadsto \frac{1}{2} \cdot \color{blue}{NdChar} \]
                                                                3. Step-by-step derivation
                                                                  1. Applied rewrites27.2%

                                                                    \[\leadsto 0.5 \cdot \color{blue}{NdChar} \]
                                                                4. Recombined 3 regimes into one program.
                                                                5. Final simplification33.5%

                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq -4 \cdot 10^{-228}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 0:\\ \;\;\;\;\frac{1}{\frac{NdChar - NaChar}{NdChar \cdot NdChar}} \cdot 0.5\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 5 \cdot 10^{-103}:\\ \;\;\;\;0.5 \cdot NdChar\\ \mathbf{else}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \end{array} \]
                                                                6. Add Preprocessing

                                                                Alternative 10: 32.9% accurate, 0.3× speedup?

                                                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\ t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\ \mathbf{if}\;t\_1 \leq -4 \cdot 10^{-228}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{1}{\frac{-NaChar}{NdChar \cdot NdChar}} \cdot 0.5\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-103}:\\ \;\;\;\;0.5 \cdot NdChar\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                                                (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                                 :precision binary64
                                                                 (let* ((t_0 (* (+ NaChar NdChar) 0.5))
                                                                        (t_1
                                                                         (-
                                                                          (/ NdChar (+ 1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT))))
                                                                          (/ NaChar (- -1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))))))
                                                                   (if (<= t_1 -4e-228)
                                                                     t_0
                                                                     (if (<= t_1 0.0)
                                                                       (* (/ 1.0 (/ (- NaChar) (* NdChar NdChar))) 0.5)
                                                                       (if (<= t_1 5e-103) (* 0.5 NdChar) t_0)))))
                                                                double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                	double t_0 = (NaChar + NdChar) * 0.5;
                                                                	double t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                                                	double tmp;
                                                                	if (t_1 <= -4e-228) {
                                                                		tmp = t_0;
                                                                	} else if (t_1 <= 0.0) {
                                                                		tmp = (1.0 / (-NaChar / (NdChar * NdChar))) * 0.5;
                                                                	} else if (t_1 <= 5e-103) {
                                                                		tmp = 0.5 * NdChar;
                                                                	} else {
                                                                		tmp = t_0;
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                                                                    real(8), intent (in) :: ndchar
                                                                    real(8), intent (in) :: ec
                                                                    real(8), intent (in) :: vef
                                                                    real(8), intent (in) :: edonor
                                                                    real(8), intent (in) :: mu
                                                                    real(8), intent (in) :: kbt
                                                                    real(8), intent (in) :: nachar
                                                                    real(8), intent (in) :: ev
                                                                    real(8), intent (in) :: eaccept
                                                                    real(8) :: t_0
                                                                    real(8) :: t_1
                                                                    real(8) :: tmp
                                                                    t_0 = (nachar + ndchar) * 0.5d0
                                                                    t_1 = (ndchar / (1.0d0 + exp(((mu - ((ec - vef) - edonor)) / kbt)))) - (nachar / ((-1.0d0) - exp((((eaccept + (ev + vef)) - mu) / kbt))))
                                                                    if (t_1 <= (-4d-228)) then
                                                                        tmp = t_0
                                                                    else if (t_1 <= 0.0d0) then
                                                                        tmp = (1.0d0 / (-nachar / (ndchar * ndchar))) * 0.5d0
                                                                    else if (t_1 <= 5d-103) then
                                                                        tmp = 0.5d0 * ndchar
                                                                    else
                                                                        tmp = t_0
                                                                    end if
                                                                    code = tmp
                                                                end function
                                                                
                                                                public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                	double t_0 = (NaChar + NdChar) * 0.5;
                                                                	double t_1 = (NdChar / (1.0 + Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                                                	double tmp;
                                                                	if (t_1 <= -4e-228) {
                                                                		tmp = t_0;
                                                                	} else if (t_1 <= 0.0) {
                                                                		tmp = (1.0 / (-NaChar / (NdChar * NdChar))) * 0.5;
                                                                	} else if (t_1 <= 5e-103) {
                                                                		tmp = 0.5 * NdChar;
                                                                	} else {
                                                                		tmp = t_0;
                                                                	}
                                                                	return tmp;
                                                                }
                                                                
                                                                def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                                                	t_0 = (NaChar + NdChar) * 0.5
                                                                	t_1 = (NdChar / (1.0 + math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))))
                                                                	tmp = 0
                                                                	if t_1 <= -4e-228:
                                                                		tmp = t_0
                                                                	elif t_1 <= 0.0:
                                                                		tmp = (1.0 / (-NaChar / (NdChar * NdChar))) * 0.5
                                                                	elif t_1 <= 5e-103:
                                                                		tmp = 0.5 * NdChar
                                                                	else:
                                                                		tmp = t_0
                                                                	return tmp
                                                                
                                                                function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                	t_0 = Float64(Float64(NaChar + NdChar) * 0.5)
                                                                	t_1 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)))))
                                                                	tmp = 0.0
                                                                	if (t_1 <= -4e-228)
                                                                		tmp = t_0;
                                                                	elseif (t_1 <= 0.0)
                                                                		tmp = Float64(Float64(1.0 / Float64(Float64(-NaChar) / Float64(NdChar * NdChar))) * 0.5);
                                                                	elseif (t_1 <= 5e-103)
                                                                		tmp = Float64(0.5 * NdChar);
                                                                	else
                                                                		tmp = t_0;
                                                                	end
                                                                	return tmp
                                                                end
                                                                
                                                                function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                	t_0 = (NaChar + NdChar) * 0.5;
                                                                	t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                                                	tmp = 0.0;
                                                                	if (t_1 <= -4e-228)
                                                                		tmp = t_0;
                                                                	elseif (t_1 <= 0.0)
                                                                		tmp = (1.0 / (-NaChar / (NdChar * NdChar))) * 0.5;
                                                                	elseif (t_1 <= 5e-103)
                                                                		tmp = 0.5 * NdChar;
                                                                	else
                                                                		tmp = t_0;
                                                                	end
                                                                	tmp_2 = tmp;
                                                                end
                                                                
                                                                code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e-228], t$95$0, If[LessEqual[t$95$1, 0.0], N[(N[(1.0 / N[((-NaChar) / N[(NdChar * NdChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[t$95$1, 5e-103], N[(0.5 * NdChar), $MachinePrecision], t$95$0]]]]]
                                                                
                                                                \begin{array}{l}
                                                                
                                                                \\
                                                                \begin{array}{l}
                                                                t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
                                                                t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\
                                                                \mathbf{if}\;t\_1 \leq -4 \cdot 10^{-228}:\\
                                                                \;\;\;\;t\_0\\
                                                                
                                                                \mathbf{elif}\;t\_1 \leq 0:\\
                                                                \;\;\;\;\frac{1}{\frac{-NaChar}{NdChar \cdot NdChar}} \cdot 0.5\\
                                                                
                                                                \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-103}:\\
                                                                \;\;\;\;0.5 \cdot NdChar\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;t\_0\\
                                                                
                                                                
                                                                \end{array}
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Split input into 3 regimes
                                                                2. if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -4.00000000000000013e-228 or 4.99999999999999966e-103 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT)))))

                                                                  1. Initial program 100.0%

                                                                    \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                  2. Add Preprocessing
                                                                  3. Taylor expanded in KbT around inf

                                                                    \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                                  4. Step-by-step derivation
                                                                    1. +-commutativeN/A

                                                                      \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                                    2. distribute-lft-outN/A

                                                                      \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                    3. lower-*.f64N/A

                                                                      \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                    4. lower-+.f6438.0

                                                                      \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                                  5. Applied rewrites38.0%

                                                                    \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]

                                                                  if -4.00000000000000013e-228 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 0.0

                                                                  1. Initial program 100.0%

                                                                    \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                  2. Add Preprocessing
                                                                  3. Taylor expanded in KbT around inf

                                                                    \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                                  4. Step-by-step derivation
                                                                    1. +-commutativeN/A

                                                                      \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                                    2. distribute-lft-outN/A

                                                                      \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                    3. lower-*.f64N/A

                                                                      \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                    4. lower-+.f642.6

                                                                      \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                                  5. Applied rewrites2.6%

                                                                    \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                                                                  6. Step-by-step derivation
                                                                    1. Applied rewrites4.0%

                                                                      \[\leadsto 0.5 \cdot \frac{1}{\color{blue}{\frac{NdChar - NaChar}{\left(NaChar + NdChar\right) \cdot \left(NdChar - NaChar\right)}}} \]
                                                                    2. Taylor expanded in NdChar around inf

                                                                      \[\leadsto \frac{1}{2} \cdot \frac{1}{\frac{1 + -1 \cdot \frac{NaChar}{NdChar}}{\color{blue}{NdChar}}} \]
                                                                    3. Step-by-step derivation
                                                                      1. Applied rewrites19.9%

                                                                        \[\leadsto 0.5 \cdot \frac{1}{\frac{1 - \frac{NaChar}{NdChar}}{\color{blue}{NdChar}}} \]
                                                                      2. Taylor expanded in NdChar around 0

                                                                        \[\leadsto \frac{1}{2} \cdot \frac{1}{-1 \cdot \frac{NaChar}{\color{blue}{{NdChar}^{2}}}} \]
                                                                      3. Step-by-step derivation
                                                                        1. Applied rewrites22.8%

                                                                          \[\leadsto 0.5 \cdot \frac{1}{\frac{-NaChar}{NdChar \cdot \color{blue}{NdChar}}} \]

                                                                        if 0.0 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.99999999999999966e-103

                                                                        1. Initial program 100.0%

                                                                          \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                        2. Add Preprocessing
                                                                        3. Taylor expanded in KbT around inf

                                                                          \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                                        4. Step-by-step derivation
                                                                          1. +-commutativeN/A

                                                                            \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                                          2. distribute-lft-outN/A

                                                                            \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                          3. lower-*.f64N/A

                                                                            \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                          4. lower-+.f649.1

                                                                            \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                                        5. Applied rewrites9.1%

                                                                          \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                                                                        6. Taylor expanded in NdChar around 0

                                                                          \[\leadsto \frac{1}{2} \cdot \color{blue}{NaChar} \]
                                                                        7. Step-by-step derivation
                                                                          1. Applied rewrites13.0%

                                                                            \[\leadsto 0.5 \cdot \color{blue}{NaChar} \]
                                                                          2. Taylor expanded in NdChar around inf

                                                                            \[\leadsto \frac{1}{2} \cdot \color{blue}{NdChar} \]
                                                                          3. Step-by-step derivation
                                                                            1. Applied rewrites27.2%

                                                                              \[\leadsto 0.5 \cdot \color{blue}{NdChar} \]
                                                                          4. Recombined 3 regimes into one program.
                                                                          5. Final simplification33.5%

                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq -4 \cdot 10^{-228}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 0:\\ \;\;\;\;\frac{1}{\frac{-NaChar}{NdChar \cdot NdChar}} \cdot 0.5\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 5 \cdot 10^{-103}:\\ \;\;\;\;0.5 \cdot NdChar\\ \mathbf{else}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \end{array} \]
                                                                          6. Add Preprocessing

                                                                          Alternative 11: 29.5% accurate, 0.3× speedup?

                                                                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\ t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-218}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\left(\frac{NaChar}{KbT} \cdot EAccept\right) \cdot -0.25\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-103}:\\ \;\;\;\;0.5 \cdot NdChar\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                                                          (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                                           :precision binary64
                                                                           (let* ((t_0 (* (+ NaChar NdChar) 0.5))
                                                                                  (t_1
                                                                                   (-
                                                                                    (/ NdChar (+ 1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT))))
                                                                                    (/ NaChar (- -1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))))))
                                                                             (if (<= t_1 -5e-218)
                                                                               t_0
                                                                               (if (<= t_1 0.0)
                                                                                 (* (* (/ NaChar KbT) EAccept) -0.25)
                                                                                 (if (<= t_1 5e-103) (* 0.5 NdChar) t_0)))))
                                                                          double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                          	double t_0 = (NaChar + NdChar) * 0.5;
                                                                          	double t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                                                          	double tmp;
                                                                          	if (t_1 <= -5e-218) {
                                                                          		tmp = t_0;
                                                                          	} else if (t_1 <= 0.0) {
                                                                          		tmp = ((NaChar / KbT) * EAccept) * -0.25;
                                                                          	} else if (t_1 <= 5e-103) {
                                                                          		tmp = 0.5 * NdChar;
                                                                          	} else {
                                                                          		tmp = t_0;
                                                                          	}
                                                                          	return tmp;
                                                                          }
                                                                          
                                                                          real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                                                                              real(8), intent (in) :: ndchar
                                                                              real(8), intent (in) :: ec
                                                                              real(8), intent (in) :: vef
                                                                              real(8), intent (in) :: edonor
                                                                              real(8), intent (in) :: mu
                                                                              real(8), intent (in) :: kbt
                                                                              real(8), intent (in) :: nachar
                                                                              real(8), intent (in) :: ev
                                                                              real(8), intent (in) :: eaccept
                                                                              real(8) :: t_0
                                                                              real(8) :: t_1
                                                                              real(8) :: tmp
                                                                              t_0 = (nachar + ndchar) * 0.5d0
                                                                              t_1 = (ndchar / (1.0d0 + exp(((mu - ((ec - vef) - edonor)) / kbt)))) - (nachar / ((-1.0d0) - exp((((eaccept + (ev + vef)) - mu) / kbt))))
                                                                              if (t_1 <= (-5d-218)) then
                                                                                  tmp = t_0
                                                                              else if (t_1 <= 0.0d0) then
                                                                                  tmp = ((nachar / kbt) * eaccept) * (-0.25d0)
                                                                              else if (t_1 <= 5d-103) then
                                                                                  tmp = 0.5d0 * ndchar
                                                                              else
                                                                                  tmp = t_0
                                                                              end if
                                                                              code = tmp
                                                                          end function
                                                                          
                                                                          public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                          	double t_0 = (NaChar + NdChar) * 0.5;
                                                                          	double t_1 = (NdChar / (1.0 + Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                                                          	double tmp;
                                                                          	if (t_1 <= -5e-218) {
                                                                          		tmp = t_0;
                                                                          	} else if (t_1 <= 0.0) {
                                                                          		tmp = ((NaChar / KbT) * EAccept) * -0.25;
                                                                          	} else if (t_1 <= 5e-103) {
                                                                          		tmp = 0.5 * NdChar;
                                                                          	} else {
                                                                          		tmp = t_0;
                                                                          	}
                                                                          	return tmp;
                                                                          }
                                                                          
                                                                          def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                                                          	t_0 = (NaChar + NdChar) * 0.5
                                                                          	t_1 = (NdChar / (1.0 + math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))))
                                                                          	tmp = 0
                                                                          	if t_1 <= -5e-218:
                                                                          		tmp = t_0
                                                                          	elif t_1 <= 0.0:
                                                                          		tmp = ((NaChar / KbT) * EAccept) * -0.25
                                                                          	elif t_1 <= 5e-103:
                                                                          		tmp = 0.5 * NdChar
                                                                          	else:
                                                                          		tmp = t_0
                                                                          	return tmp
                                                                          
                                                                          function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                          	t_0 = Float64(Float64(NaChar + NdChar) * 0.5)
                                                                          	t_1 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)))))
                                                                          	tmp = 0.0
                                                                          	if (t_1 <= -5e-218)
                                                                          		tmp = t_0;
                                                                          	elseif (t_1 <= 0.0)
                                                                          		tmp = Float64(Float64(Float64(NaChar / KbT) * EAccept) * -0.25);
                                                                          	elseif (t_1 <= 5e-103)
                                                                          		tmp = Float64(0.5 * NdChar);
                                                                          	else
                                                                          		tmp = t_0;
                                                                          	end
                                                                          	return tmp
                                                                          end
                                                                          
                                                                          function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                          	t_0 = (NaChar + NdChar) * 0.5;
                                                                          	t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                                                          	tmp = 0.0;
                                                                          	if (t_1 <= -5e-218)
                                                                          		tmp = t_0;
                                                                          	elseif (t_1 <= 0.0)
                                                                          		tmp = ((NaChar / KbT) * EAccept) * -0.25;
                                                                          	elseif (t_1 <= 5e-103)
                                                                          		tmp = 0.5 * NdChar;
                                                                          	else
                                                                          		tmp = t_0;
                                                                          	end
                                                                          	tmp_2 = tmp;
                                                                          end
                                                                          
                                                                          code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-218], t$95$0, If[LessEqual[t$95$1, 0.0], N[(N[(N[(NaChar / KbT), $MachinePrecision] * EAccept), $MachinePrecision] * -0.25), $MachinePrecision], If[LessEqual[t$95$1, 5e-103], N[(0.5 * NdChar), $MachinePrecision], t$95$0]]]]]
                                                                          
                                                                          \begin{array}{l}
                                                                          
                                                                          \\
                                                                          \begin{array}{l}
                                                                          t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
                                                                          t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\
                                                                          \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-218}:\\
                                                                          \;\;\;\;t\_0\\
                                                                          
                                                                          \mathbf{elif}\;t\_1 \leq 0:\\
                                                                          \;\;\;\;\left(\frac{NaChar}{KbT} \cdot EAccept\right) \cdot -0.25\\
                                                                          
                                                                          \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-103}:\\
                                                                          \;\;\;\;0.5 \cdot NdChar\\
                                                                          
                                                                          \mathbf{else}:\\
                                                                          \;\;\;\;t\_0\\
                                                                          
                                                                          
                                                                          \end{array}
                                                                          \end{array}
                                                                          
                                                                          Derivation
                                                                          1. Split input into 3 regimes
                                                                          2. if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -5.00000000000000041e-218 or 4.99999999999999966e-103 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT)))))

                                                                            1. Initial program 100.0%

                                                                              \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                            2. Add Preprocessing
                                                                            3. Taylor expanded in KbT around inf

                                                                              \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                                            4. Step-by-step derivation
                                                                              1. +-commutativeN/A

                                                                                \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                                              2. distribute-lft-outN/A

                                                                                \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                              3. lower-*.f64N/A

                                                                                \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                              4. lower-+.f6438.5

                                                                                \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                                            5. Applied rewrites38.5%

                                                                              \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]

                                                                            if -5.00000000000000041e-218 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 0.0

                                                                            1. Initial program 100.0%

                                                                              \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                            2. Add Preprocessing
                                                                            3. Taylor expanded in KbT around -inf

                                                                              \[\leadsto \color{blue}{\frac{-1}{4} \cdot \frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \left(\frac{-1}{4} \cdot \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT} + \left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right)\right)} \]
                                                                            4. Step-by-step derivation
                                                                              1. associate-+r+N/A

                                                                                \[\leadsto \color{blue}{\left(\frac{-1}{4} \cdot \frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \frac{-1}{4} \cdot \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT}\right) + \left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right)} \]
                                                                              2. distribute-lft-outN/A

                                                                                \[\leadsto \color{blue}{\frac{-1}{4} \cdot \left(\frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT}\right)} + \left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right) \]
                                                                              3. lower-fma.f64N/A

                                                                                \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{4}, \frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT}, \frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right)} \]
                                                                            5. Applied rewrites1.5%

                                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, \mathsf{fma}\left(NaChar, \frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}, NdChar \cdot \frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}\right), 0.5 \cdot \left(NdChar + NaChar\right)\right)} \]
                                                                            6. Taylor expanded in EAccept around inf

                                                                              \[\leadsto \frac{-1}{4} \cdot \color{blue}{\frac{EAccept \cdot NaChar}{KbT}} \]
                                                                            7. Step-by-step derivation
                                                                              1. Applied rewrites14.4%

                                                                                \[\leadsto \left(EAccept \cdot \frac{NaChar}{KbT}\right) \cdot \color{blue}{-0.25} \]

                                                                              if 0.0 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.99999999999999966e-103

                                                                              1. Initial program 100.0%

                                                                                \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                              2. Add Preprocessing
                                                                              3. Taylor expanded in KbT around inf

                                                                                \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                                              4. Step-by-step derivation
                                                                                1. +-commutativeN/A

                                                                                  \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                                                2. distribute-lft-outN/A

                                                                                  \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                                3. lower-*.f64N/A

                                                                                  \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                                4. lower-+.f649.1

                                                                                  \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                                              5. Applied rewrites9.1%

                                                                                \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                                                                              6. Taylor expanded in NdChar around 0

                                                                                \[\leadsto \frac{1}{2} \cdot \color{blue}{NaChar} \]
                                                                              7. Step-by-step derivation
                                                                                1. Applied rewrites13.0%

                                                                                  \[\leadsto 0.5 \cdot \color{blue}{NaChar} \]
                                                                                2. Taylor expanded in NdChar around inf

                                                                                  \[\leadsto \frac{1}{2} \cdot \color{blue}{NdChar} \]
                                                                                3. Step-by-step derivation
                                                                                  1. Applied rewrites27.2%

                                                                                    \[\leadsto 0.5 \cdot \color{blue}{NdChar} \]
                                                                                4. Recombined 3 regimes into one program.
                                                                                5. Final simplification31.7%

                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq -5 \cdot 10^{-218}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 0:\\ \;\;\;\;\left(\frac{NaChar}{KbT} \cdot EAccept\right) \cdot -0.25\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 5 \cdot 10^{-103}:\\ \;\;\;\;0.5 \cdot NdChar\\ \mathbf{else}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \end{array} \]
                                                                                6. Add Preprocessing

                                                                                Alternative 12: 79.4% accurate, 0.3× speedup?

                                                                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}\\ t_1 := \frac{NdChar}{1 + t\_0} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\ t_2 := \frac{NdChar}{-1 - t\_0}\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{-250}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} - t\_2\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-241}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{KbT}}} - t\_2\\ \end{array} \end{array} \]
                                                                                (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                                                 :precision binary64
                                                                                 (let* ((t_0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))
                                                                                        (t_1
                                                                                         (-
                                                                                          (/ NdChar (+ 1.0 t_0))
                                                                                          (/ NaChar (- -1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT))))))
                                                                                        (t_2 (/ NdChar (- -1.0 t_0))))
                                                                                   (if (<= t_1 -2e-250)
                                                                                     (- (/ NaChar (+ 1.0 (exp (/ EAccept KbT)))) t_2)
                                                                                     (if (<= t_1 5e-241)
                                                                                       (/ NdChar (+ 1.0 (exp (/ (- (+ (+ mu Vef) EDonor) Ec) KbT))))
                                                                                       (- (/ NaChar (+ 1.0 (exp (/ Ev KbT)))) t_2)))))
                                                                                double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                	double t_0 = exp(((mu - ((Ec - Vef) - EDonor)) / KbT));
                                                                                	double t_1 = (NdChar / (1.0 + t_0)) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                                                                	double t_2 = NdChar / (-1.0 - t_0);
                                                                                	double tmp;
                                                                                	if (t_1 <= -2e-250) {
                                                                                		tmp = (NaChar / (1.0 + exp((EAccept / KbT)))) - t_2;
                                                                                	} else if (t_1 <= 5e-241) {
                                                                                		tmp = NdChar / (1.0 + exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
                                                                                	} else {
                                                                                		tmp = (NaChar / (1.0 + exp((Ev / KbT)))) - t_2;
                                                                                	}
                                                                                	return tmp;
                                                                                }
                                                                                
                                                                                real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                                                                                    real(8), intent (in) :: ndchar
                                                                                    real(8), intent (in) :: ec
                                                                                    real(8), intent (in) :: vef
                                                                                    real(8), intent (in) :: edonor
                                                                                    real(8), intent (in) :: mu
                                                                                    real(8), intent (in) :: kbt
                                                                                    real(8), intent (in) :: nachar
                                                                                    real(8), intent (in) :: ev
                                                                                    real(8), intent (in) :: eaccept
                                                                                    real(8) :: t_0
                                                                                    real(8) :: t_1
                                                                                    real(8) :: t_2
                                                                                    real(8) :: tmp
                                                                                    t_0 = exp(((mu - ((ec - vef) - edonor)) / kbt))
                                                                                    t_1 = (ndchar / (1.0d0 + t_0)) - (nachar / ((-1.0d0) - exp((((eaccept + (ev + vef)) - mu) / kbt))))
                                                                                    t_2 = ndchar / ((-1.0d0) - t_0)
                                                                                    if (t_1 <= (-2d-250)) then
                                                                                        tmp = (nachar / (1.0d0 + exp((eaccept / kbt)))) - t_2
                                                                                    else if (t_1 <= 5d-241) then
                                                                                        tmp = ndchar / (1.0d0 + exp(((((mu + vef) + edonor) - ec) / kbt)))
                                                                                    else
                                                                                        tmp = (nachar / (1.0d0 + exp((ev / kbt)))) - t_2
                                                                                    end if
                                                                                    code = tmp
                                                                                end function
                                                                                
                                                                                public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                	double t_0 = Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT));
                                                                                	double t_1 = (NdChar / (1.0 + t_0)) - (NaChar / (-1.0 - Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                                                                	double t_2 = NdChar / (-1.0 - t_0);
                                                                                	double tmp;
                                                                                	if (t_1 <= -2e-250) {
                                                                                		tmp = (NaChar / (1.0 + Math.exp((EAccept / KbT)))) - t_2;
                                                                                	} else if (t_1 <= 5e-241) {
                                                                                		tmp = NdChar / (1.0 + Math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
                                                                                	} else {
                                                                                		tmp = (NaChar / (1.0 + Math.exp((Ev / KbT)))) - t_2;
                                                                                	}
                                                                                	return tmp;
                                                                                }
                                                                                
                                                                                def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                                                                	t_0 = math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))
                                                                                	t_1 = (NdChar / (1.0 + t_0)) - (NaChar / (-1.0 - math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))))
                                                                                	t_2 = NdChar / (-1.0 - t_0)
                                                                                	tmp = 0
                                                                                	if t_1 <= -2e-250:
                                                                                		tmp = (NaChar / (1.0 + math.exp((EAccept / KbT)))) - t_2
                                                                                	elif t_1 <= 5e-241:
                                                                                		tmp = NdChar / (1.0 + math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)))
                                                                                	else:
                                                                                		tmp = (NaChar / (1.0 + math.exp((Ev / KbT)))) - t_2
                                                                                	return tmp
                                                                                
                                                                                function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                	t_0 = exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT))
                                                                                	t_1 = Float64(Float64(NdChar / Float64(1.0 + t_0)) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)))))
                                                                                	t_2 = Float64(NdChar / Float64(-1.0 - t_0))
                                                                                	tmp = 0.0
                                                                                	if (t_1 <= -2e-250)
                                                                                		tmp = Float64(Float64(NaChar / Float64(1.0 + exp(Float64(EAccept / KbT)))) - t_2);
                                                                                	elseif (t_1 <= 5e-241)
                                                                                		tmp = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT))));
                                                                                	else
                                                                                		tmp = Float64(Float64(NaChar / Float64(1.0 + exp(Float64(Ev / KbT)))) - t_2);
                                                                                	end
                                                                                	return tmp
                                                                                end
                                                                                
                                                                                function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                	t_0 = exp(((mu - ((Ec - Vef) - EDonor)) / KbT));
                                                                                	t_1 = (NdChar / (1.0 + t_0)) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                                                                	t_2 = NdChar / (-1.0 - t_0);
                                                                                	tmp = 0.0;
                                                                                	if (t_1 <= -2e-250)
                                                                                		tmp = (NaChar / (1.0 + exp((EAccept / KbT)))) - t_2;
                                                                                	elseif (t_1 <= 5e-241)
                                                                                		tmp = NdChar / (1.0 + exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
                                                                                	else
                                                                                		tmp = (NaChar / (1.0 + exp((Ev / KbT)))) - t_2;
                                                                                	end
                                                                                	tmp_2 = tmp;
                                                                                end
                                                                                
                                                                                code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(NdChar / N[(-1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-250], N[(N[(NaChar / N[(1.0 + N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision], If[LessEqual[t$95$1, 5e-241], N[(NdChar / N[(1.0 + N[Exp[N[(N[(N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(NaChar / N[(1.0 + N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$2), $MachinePrecision]]]]]]
                                                                                
                                                                                \begin{array}{l}
                                                                                
                                                                                \\
                                                                                \begin{array}{l}
                                                                                t_0 := e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}\\
                                                                                t_1 := \frac{NdChar}{1 + t\_0} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\
                                                                                t_2 := \frac{NdChar}{-1 - t\_0}\\
                                                                                \mathbf{if}\;t\_1 \leq -2 \cdot 10^{-250}:\\
                                                                                \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} - t\_2\\
                                                                                
                                                                                \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-241}:\\
                                                                                \;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\
                                                                                
                                                                                \mathbf{else}:\\
                                                                                \;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{KbT}}} - t\_2\\
                                                                                
                                                                                
                                                                                \end{array}
                                                                                \end{array}
                                                                                
                                                                                Derivation
                                                                                1. Split input into 3 regimes
                                                                                2. if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -2.0000000000000001e-250

                                                                                  1. Initial program 100.0%

                                                                                    \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                  2. Add Preprocessing
                                                                                  3. Taylor expanded in EAccept around inf

                                                                                    \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
                                                                                  4. Step-by-step derivation
                                                                                    1. lower-/.f6481.4

                                                                                      \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
                                                                                  5. Applied rewrites81.4%

                                                                                    \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]

                                                                                  if -2.0000000000000001e-250 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.9999999999999998e-241

                                                                                  1. Initial program 100.0%

                                                                                    \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                  2. Add Preprocessing
                                                                                  3. Taylor expanded in KbT around inf

                                                                                    \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                                                  4. Step-by-step derivation
                                                                                    1. +-commutativeN/A

                                                                                      \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                                                    2. distribute-lft-outN/A

                                                                                      \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                                    3. lower-*.f64N/A

                                                                                      \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                                    4. lower-+.f643.2

                                                                                      \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                                                  5. Applied rewrites3.2%

                                                                                    \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                                                                                  6. Taylor expanded in NdChar around 0

                                                                                    \[\leadsto \frac{1}{2} \cdot \color{blue}{NaChar} \]
                                                                                  7. Step-by-step derivation
                                                                                    1. Applied rewrites4.7%

                                                                                      \[\leadsto 0.5 \cdot \color{blue}{NaChar} \]
                                                                                    2. Taylor expanded in NdChar around inf

                                                                                      \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                                                                                    3. Step-by-step derivation
                                                                                      1. lower-/.f64N/A

                                                                                        \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                                                                                      2. +-commutativeN/A

                                                                                        \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}} + 1}} \]
                                                                                      3. lower-+.f64N/A

                                                                                        \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}} + 1}} \]
                                                                                      4. lower-exp.f64N/A

                                                                                        \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}} + 1} \]
                                                                                      5. lower-/.f64N/A

                                                                                        \[\leadsto \frac{NdChar}{e^{\color{blue}{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}} + 1} \]
                                                                                      6. lower--.f64N/A

                                                                                        \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(EDonor + \left(Vef + mu\right)\right) - Ec}}{KbT}} + 1} \]
                                                                                      7. +-commutativeN/A

                                                                                        \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(\left(Vef + mu\right) + EDonor\right)} - Ec}{KbT}} + 1} \]
                                                                                      8. lower-+.f64N/A

                                                                                        \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(\left(Vef + mu\right) + EDonor\right)} - Ec}{KbT}} + 1} \]
                                                                                      9. +-commutativeN/A

                                                                                        \[\leadsto \frac{NdChar}{e^{\frac{\left(\color{blue}{\left(mu + Vef\right)} + EDonor\right) - Ec}{KbT}} + 1} \]
                                                                                      10. lower-+.f6495.5

                                                                                        \[\leadsto \frac{NdChar}{e^{\frac{\left(\color{blue}{\left(mu + Vef\right)} + EDonor\right) - Ec}{KbT}} + 1} \]
                                                                                    4. Applied rewrites95.5%

                                                                                      \[\leadsto \color{blue}{\frac{NdChar}{e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}} + 1}} \]

                                                                                    if 4.9999999999999998e-241 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT)))))

                                                                                    1. Initial program 99.9%

                                                                                      \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                    2. Add Preprocessing
                                                                                    3. Taylor expanded in Ev around inf

                                                                                      \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Ev}{KbT}}}} \]
                                                                                    4. Step-by-step derivation
                                                                                      1. lower-/.f6471.5

                                                                                        \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Ev}{KbT}}}} \]
                                                                                    5. Applied rewrites71.5%

                                                                                      \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Ev}{KbT}}}} \]
                                                                                  8. Recombined 3 regimes into one program.
                                                                                  9. Final simplification80.9%

                                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq -2 \cdot 10^{-250}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 5 \cdot 10^{-241}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\ \end{array} \]
                                                                                  10. Add Preprocessing

                                                                                  Alternative 13: 70.5% accurate, 0.4× speedup?

                                                                                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(mu + Vef\right) + EDonor\\ t_1 := e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}\\ t_2 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - t\_1}\\ \mathbf{if}\;t\_2 \leq -4 \cdot 10^{-228}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(mu + Vef\right) - Ec}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{Vef}{KbT}}}\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-70}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{t\_0 - Ec}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{\mathsf{fma}\left(\frac{Ec - t\_0}{KbT}, -1, 2\right)} + \frac{NaChar}{1 + t\_1}\\ \end{array} \end{array} \]
                                                                                  (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                                                   :precision binary64
                                                                                   (let* ((t_0 (+ (+ mu Vef) EDonor))
                                                                                          (t_1 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))
                                                                                          (t_2
                                                                                           (-
                                                                                            (/ NdChar (+ 1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT))))
                                                                                            (/ NaChar (- -1.0 t_1)))))
                                                                                     (if (<= t_2 -4e-228)
                                                                                       (-
                                                                                        (/ NdChar (+ 1.0 (exp (/ (- (+ mu Vef) Ec) KbT))))
                                                                                        (/ NaChar (- -1.0 (exp (/ Vef KbT)))))
                                                                                       (if (<= t_2 5e-70)
                                                                                         (/ NdChar (+ 1.0 (exp (/ (- t_0 Ec) KbT))))
                                                                                         (+
                                                                                          (/ NdChar (fma (/ (- Ec t_0) KbT) -1.0 2.0))
                                                                                          (/ NaChar (+ 1.0 t_1)))))))
                                                                                  double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                  	double t_0 = (mu + Vef) + EDonor;
                                                                                  	double t_1 = exp((((EAccept + (Ev + Vef)) - mu) / KbT));
                                                                                  	double t_2 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - t_1));
                                                                                  	double tmp;
                                                                                  	if (t_2 <= -4e-228) {
                                                                                  		tmp = (NdChar / (1.0 + exp((((mu + Vef) - Ec) / KbT)))) - (NaChar / (-1.0 - exp((Vef / KbT))));
                                                                                  	} else if (t_2 <= 5e-70) {
                                                                                  		tmp = NdChar / (1.0 + exp(((t_0 - Ec) / KbT)));
                                                                                  	} else {
                                                                                  		tmp = (NdChar / fma(((Ec - t_0) / KbT), -1.0, 2.0)) + (NaChar / (1.0 + t_1));
                                                                                  	}
                                                                                  	return tmp;
                                                                                  }
                                                                                  
                                                                                  function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                  	t_0 = Float64(Float64(mu + Vef) + EDonor)
                                                                                  	t_1 = exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT))
                                                                                  	t_2 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) - Float64(NaChar / Float64(-1.0 - t_1)))
                                                                                  	tmp = 0.0
                                                                                  	if (t_2 <= -4e-228)
                                                                                  		tmp = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Float64(mu + Vef) - Ec) / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Vef / KbT)))));
                                                                                  	elseif (t_2 <= 5e-70)
                                                                                  		tmp = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(t_0 - Ec) / KbT))));
                                                                                  	else
                                                                                  		tmp = Float64(Float64(NdChar / fma(Float64(Float64(Ec - t_0) / KbT), -1.0, 2.0)) + Float64(NaChar / Float64(1.0 + t_1)));
                                                                                  	end
                                                                                  	return tmp
                                                                                  end
                                                                                  
                                                                                  code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-228], N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(N[(mu + Vef), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e-70], N[(NdChar / N[(1.0 + N[Exp[N[(N[(t$95$0 - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(NdChar / N[(N[(N[(Ec - t$95$0), $MachinePrecision] / KbT), $MachinePrecision] * -1.0 + 2.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
                                                                                  
                                                                                  \begin{array}{l}
                                                                                  
                                                                                  \\
                                                                                  \begin{array}{l}
                                                                                  t_0 := \left(mu + Vef\right) + EDonor\\
                                                                                  t_1 := e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}\\
                                                                                  t_2 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - t\_1}\\
                                                                                  \mathbf{if}\;t\_2 \leq -4 \cdot 10^{-228}:\\
                                                                                  \;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(mu + Vef\right) - Ec}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{Vef}{KbT}}}\\
                                                                                  
                                                                                  \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-70}:\\
                                                                                  \;\;\;\;\frac{NdChar}{1 + e^{\frac{t\_0 - Ec}{KbT}}}\\
                                                                                  
                                                                                  \mathbf{else}:\\
                                                                                  \;\;\;\;\frac{NdChar}{\mathsf{fma}\left(\frac{Ec - t\_0}{KbT}, -1, 2\right)} + \frac{NaChar}{1 + t\_1}\\
                                                                                  
                                                                                  
                                                                                  \end{array}
                                                                                  \end{array}
                                                                                  
                                                                                  Derivation
                                                                                  1. Split input into 3 regimes
                                                                                  2. if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -4.00000000000000013e-228

                                                                                    1. Initial program 100.0%

                                                                                      \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                    2. Add Preprocessing
                                                                                    3. Taylor expanded in Vef around inf

                                                                                      \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
                                                                                    4. Step-by-step derivation
                                                                                      1. lower-/.f6486.3

                                                                                        \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
                                                                                    5. Applied rewrites86.3%

                                                                                      \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
                                                                                    6. Taylor expanded in EDonor around 0

                                                                                      \[\leadsto \frac{NdChar}{1 + e^{\frac{\color{blue}{\left(Vef + mu\right) - Ec}}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} \]
                                                                                    7. Step-by-step derivation
                                                                                      1. lower--.f64N/A

                                                                                        \[\leadsto \frac{NdChar}{1 + e^{\frac{\color{blue}{\left(Vef + mu\right) - Ec}}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} \]
                                                                                      2. +-commutativeN/A

                                                                                        \[\leadsto \frac{NdChar}{1 + e^{\frac{\color{blue}{\left(mu + Vef\right)} - Ec}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} \]
                                                                                      3. lower-+.f6478.7

                                                                                        \[\leadsto \frac{NdChar}{1 + e^{\frac{\color{blue}{\left(mu + Vef\right)} - Ec}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} \]
                                                                                    8. Applied rewrites78.7%

                                                                                      \[\leadsto \frac{NdChar}{1 + e^{\frac{\color{blue}{\left(mu + Vef\right) - Ec}}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} \]

                                                                                    if -4.00000000000000013e-228 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.9999999999999998e-70

                                                                                    1. Initial program 100.0%

                                                                                      \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                    2. Add Preprocessing
                                                                                    3. Taylor expanded in KbT around inf

                                                                                      \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                                                    4. Step-by-step derivation
                                                                                      1. +-commutativeN/A

                                                                                        \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                                                      2. distribute-lft-outN/A

                                                                                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                                      3. lower-*.f64N/A

                                                                                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                                      4. lower-+.f646.6

                                                                                        \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                                                    5. Applied rewrites6.6%

                                                                                      \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                                                                                    6. Taylor expanded in NdChar around 0

                                                                                      \[\leadsto \frac{1}{2} \cdot \color{blue}{NaChar} \]
                                                                                    7. Step-by-step derivation
                                                                                      1. Applied rewrites7.5%

                                                                                        \[\leadsto 0.5 \cdot \color{blue}{NaChar} \]
                                                                                      2. Taylor expanded in NdChar around inf

                                                                                        \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                                                                                      3. Step-by-step derivation
                                                                                        1. lower-/.f64N/A

                                                                                          \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                                                                                        2. +-commutativeN/A

                                                                                          \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}} + 1}} \]
                                                                                        3. lower-+.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}} + 1}} \]
                                                                                        4. lower-exp.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}} + 1} \]
                                                                                        5. lower-/.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{e^{\color{blue}{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}} + 1} \]
                                                                                        6. lower--.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(EDonor + \left(Vef + mu\right)\right) - Ec}}{KbT}} + 1} \]
                                                                                        7. +-commutativeN/A

                                                                                          \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(\left(Vef + mu\right) + EDonor\right)} - Ec}{KbT}} + 1} \]
                                                                                        8. lower-+.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(\left(Vef + mu\right) + EDonor\right)} - Ec}{KbT}} + 1} \]
                                                                                        9. +-commutativeN/A

                                                                                          \[\leadsto \frac{NdChar}{e^{\frac{\left(\color{blue}{\left(mu + Vef\right)} + EDonor\right) - Ec}{KbT}} + 1} \]
                                                                                        10. lower-+.f6484.2

                                                                                          \[\leadsto \frac{NdChar}{e^{\frac{\left(\color{blue}{\left(mu + Vef\right)} + EDonor\right) - Ec}{KbT}} + 1} \]
                                                                                      4. Applied rewrites84.2%

                                                                                        \[\leadsto \color{blue}{\frac{NdChar}{e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}} + 1}} \]

                                                                                      if 4.9999999999999998e-70 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT)))))

                                                                                      1. Initial program 99.9%

                                                                                        \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                      2. Add Preprocessing
                                                                                      3. Step-by-step derivation
                                                                                        1. lift-exp.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{1 + \color{blue}{e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        2. lift-/.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        3. lift-neg.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{1 + e^{\frac{\color{blue}{\mathsf{neg}\left(\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)\right)}}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        4. distribute-frac-negN/A

                                                                                          \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\mathsf{neg}\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        5. neg-mul-1N/A

                                                                                          \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{-1 \cdot \frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        6. exp-prodN/A

                                                                                          \[\leadsto \frac{NdChar}{1 + \color{blue}{{\left(e^{-1}\right)}^{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        7. lower-pow.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{1 + \color{blue}{{\left(e^{-1}\right)}^{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        8. lower-exp.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{1 + {\color{blue}{\left(e^{-1}\right)}}^{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        9. lower-/.f6499.9

                                                                                          \[\leadsto \frac{NdChar}{1 + {\left(e^{-1}\right)}^{\color{blue}{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                      4. Applied rewrites99.9%

                                                                                        \[\leadsto \frac{NdChar}{1 + \color{blue}{{\left(e^{-1}\right)}^{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                      5. Taylor expanded in KbT around inf

                                                                                        \[\leadsto \frac{NdChar}{\color{blue}{2 + -1 \cdot \frac{Ec - \left(EDonor + \left(Vef + mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                      6. Step-by-step derivation
                                                                                        1. +-commutativeN/A

                                                                                          \[\leadsto \frac{NdChar}{\color{blue}{-1 \cdot \frac{Ec - \left(EDonor + \left(Vef + mu\right)\right)}{KbT} + 2}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        2. *-commutativeN/A

                                                                                          \[\leadsto \frac{NdChar}{\color{blue}{\frac{Ec - \left(EDonor + \left(Vef + mu\right)\right)}{KbT} \cdot -1} + 2} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        3. lower-fma.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{\color{blue}{\mathsf{fma}\left(\frac{Ec - \left(EDonor + \left(Vef + mu\right)\right)}{KbT}, -1, 2\right)}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        4. lower-/.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{\mathsf{fma}\left(\color{blue}{\frac{Ec - \left(EDonor + \left(Vef + mu\right)\right)}{KbT}}, -1, 2\right)} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        5. lower--.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{\mathsf{fma}\left(\frac{\color{blue}{Ec - \left(EDonor + \left(Vef + mu\right)\right)}}{KbT}, -1, 2\right)} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        6. +-commutativeN/A

                                                                                          \[\leadsto \frac{NdChar}{\mathsf{fma}\left(\frac{Ec - \color{blue}{\left(\left(Vef + mu\right) + EDonor\right)}}{KbT}, -1, 2\right)} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        7. lower-+.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{\mathsf{fma}\left(\frac{Ec - \color{blue}{\left(\left(Vef + mu\right) + EDonor\right)}}{KbT}, -1, 2\right)} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        8. +-commutativeN/A

                                                                                          \[\leadsto \frac{NdChar}{\mathsf{fma}\left(\frac{Ec - \left(\color{blue}{\left(mu + Vef\right)} + EDonor\right)}{KbT}, -1, 2\right)} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        9. lower-+.f6463.3

                                                                                          \[\leadsto \frac{NdChar}{\mathsf{fma}\left(\frac{Ec - \left(\color{blue}{\left(mu + Vef\right)} + EDonor\right)}{KbT}, -1, 2\right)} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                      7. Applied rewrites63.3%

                                                                                        \[\leadsto \frac{NdChar}{\color{blue}{\mathsf{fma}\left(\frac{Ec - \left(\left(mu + Vef\right) + EDonor\right)}{KbT}, -1, 2\right)}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                    8. Recombined 3 regimes into one program.
                                                                                    9. Final simplification76.1%

                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq -4 \cdot 10^{-228}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(mu + Vef\right) - Ec}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{Vef}{KbT}}}\\ \mathbf{elif}\;\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \leq 5 \cdot 10^{-70}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{\mathsf{fma}\left(\frac{Ec - \left(\left(mu + Vef\right) + EDonor\right)}{KbT}, -1, 2\right)} + \frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\ \end{array} \]
                                                                                    10. Add Preprocessing

                                                                                    Alternative 14: 92.9% accurate, 1.0× speedup?

                                                                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\ \mathbf{if}\;Vef \leq -4.5 \cdot 10^{+123}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;Vef \leq 1.86 \cdot 10^{+71}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{\left(mu + EDonor\right) - Ec}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                                                                    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                                                     :precision binary64
                                                                                     (let* ((t_0
                                                                                             (-
                                                                                              (/ NaChar (+ 1.0 (exp (/ Vef KbT))))
                                                                                              (/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))))))
                                                                                       (if (<= Vef -4.5e+123)
                                                                                         t_0
                                                                                         (if (<= Vef 1.86e+71)
                                                                                           (-
                                                                                            (/ NaChar (+ 1.0 (exp (/ (- (+ EAccept Ev) mu) KbT))))
                                                                                            (/ NdChar (- -1.0 (exp (/ (- (+ mu EDonor) Ec) KbT)))))
                                                                                           t_0))))
                                                                                    double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                    	double t_0 = (NaChar / (1.0 + exp((Vef / KbT)))) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
                                                                                    	double tmp;
                                                                                    	if (Vef <= -4.5e+123) {
                                                                                    		tmp = t_0;
                                                                                    	} else if (Vef <= 1.86e+71) {
                                                                                    		tmp = (NaChar / (1.0 + exp((((EAccept + Ev) - mu) / KbT)))) - (NdChar / (-1.0 - exp((((mu + EDonor) - Ec) / KbT))));
                                                                                    	} else {
                                                                                    		tmp = t_0;
                                                                                    	}
                                                                                    	return tmp;
                                                                                    }
                                                                                    
                                                                                    real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                                                                                        real(8), intent (in) :: ndchar
                                                                                        real(8), intent (in) :: ec
                                                                                        real(8), intent (in) :: vef
                                                                                        real(8), intent (in) :: edonor
                                                                                        real(8), intent (in) :: mu
                                                                                        real(8), intent (in) :: kbt
                                                                                        real(8), intent (in) :: nachar
                                                                                        real(8), intent (in) :: ev
                                                                                        real(8), intent (in) :: eaccept
                                                                                        real(8) :: t_0
                                                                                        real(8) :: tmp
                                                                                        t_0 = (nachar / (1.0d0 + exp((vef / kbt)))) - (ndchar / ((-1.0d0) - exp(((mu - ((ec - vef) - edonor)) / kbt))))
                                                                                        if (vef <= (-4.5d+123)) then
                                                                                            tmp = t_0
                                                                                        else if (vef <= 1.86d+71) then
                                                                                            tmp = (nachar / (1.0d0 + exp((((eaccept + ev) - mu) / kbt)))) - (ndchar / ((-1.0d0) - exp((((mu + edonor) - ec) / kbt))))
                                                                                        else
                                                                                            tmp = t_0
                                                                                        end if
                                                                                        code = tmp
                                                                                    end function
                                                                                    
                                                                                    public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                    	double t_0 = (NaChar / (1.0 + Math.exp((Vef / KbT)))) - (NdChar / (-1.0 - Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
                                                                                    	double tmp;
                                                                                    	if (Vef <= -4.5e+123) {
                                                                                    		tmp = t_0;
                                                                                    	} else if (Vef <= 1.86e+71) {
                                                                                    		tmp = (NaChar / (1.0 + Math.exp((((EAccept + Ev) - mu) / KbT)))) - (NdChar / (-1.0 - Math.exp((((mu + EDonor) - Ec) / KbT))));
                                                                                    	} else {
                                                                                    		tmp = t_0;
                                                                                    	}
                                                                                    	return tmp;
                                                                                    }
                                                                                    
                                                                                    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                                                                    	t_0 = (NaChar / (1.0 + math.exp((Vef / KbT)))) - (NdChar / (-1.0 - math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))))
                                                                                    	tmp = 0
                                                                                    	if Vef <= -4.5e+123:
                                                                                    		tmp = t_0
                                                                                    	elif Vef <= 1.86e+71:
                                                                                    		tmp = (NaChar / (1.0 + math.exp((((EAccept + Ev) - mu) / KbT)))) - (NdChar / (-1.0 - math.exp((((mu + EDonor) - Ec) / KbT))))
                                                                                    	else:
                                                                                    		tmp = t_0
                                                                                    	return tmp
                                                                                    
                                                                                    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                    	t_0 = Float64(Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT)))) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))))
                                                                                    	tmp = 0.0
                                                                                    	if (Vef <= -4.5e+123)
                                                                                    		tmp = t_0;
                                                                                    	elseif (Vef <= 1.86e+71)
                                                                                    		tmp = Float64(Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(EAccept + Ev) - mu) / KbT)))) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(Float64(mu + EDonor) - Ec) / KbT)))));
                                                                                    	else
                                                                                    		tmp = t_0;
                                                                                    	end
                                                                                    	return tmp
                                                                                    end
                                                                                    
                                                                                    function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                    	t_0 = (NaChar / (1.0 + exp((Vef / KbT)))) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
                                                                                    	tmp = 0.0;
                                                                                    	if (Vef <= -4.5e+123)
                                                                                    		tmp = t_0;
                                                                                    	elseif (Vef <= 1.86e+71)
                                                                                    		tmp = (NaChar / (1.0 + exp((((EAccept + Ev) - mu) / KbT)))) - (NdChar / (-1.0 - exp((((mu + EDonor) - Ec) / KbT))));
                                                                                    	else
                                                                                    		tmp = t_0;
                                                                                    	end
                                                                                    	tmp_2 = tmp;
                                                                                    end
                                                                                    
                                                                                    code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Vef, -4.5e+123], t$95$0, If[LessEqual[Vef, 1.86e+71], N[(N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(EAccept + Ev), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - N[Exp[N[(N[(N[(mu + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                                                                                    
                                                                                    \begin{array}{l}
                                                                                    
                                                                                    \\
                                                                                    \begin{array}{l}
                                                                                    t_0 := \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\
                                                                                    \mathbf{if}\;Vef \leq -4.5 \cdot 10^{+123}:\\
                                                                                    \;\;\;\;t\_0\\
                                                                                    
                                                                                    \mathbf{elif}\;Vef \leq 1.86 \cdot 10^{+71}:\\
                                                                                    \;\;\;\;\frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{\left(mu + EDonor\right) - Ec}{KbT}}}\\
                                                                                    
                                                                                    \mathbf{else}:\\
                                                                                    \;\;\;\;t\_0\\
                                                                                    
                                                                                    
                                                                                    \end{array}
                                                                                    \end{array}
                                                                                    
                                                                                    Derivation
                                                                                    1. Split input into 2 regimes
                                                                                    2. if Vef < -4.49999999999999983e123 or 1.86000000000000006e71 < Vef

                                                                                      1. Initial program 100.0%

                                                                                        \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                      2. Add Preprocessing
                                                                                      3. Taylor expanded in Vef around inf

                                                                                        \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. lower-/.f6488.1

                                                                                          \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
                                                                                      5. Applied rewrites88.1%

                                                                                        \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]

                                                                                      if -4.49999999999999983e123 < Vef < 1.86000000000000006e71

                                                                                      1. Initial program 100.0%

                                                                                        \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                      2. Add Preprocessing
                                                                                      3. Taylor expanded in Vef around 0

                                                                                        \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}} + \frac{NdChar}{1 + e^{\frac{\left(EDonor + mu\right) - Ec}{KbT}}}} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. +-commutativeN/A

                                                                                          \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + mu\right) - Ec}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}}} \]
                                                                                        2. lower-+.f64N/A

                                                                                          \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + mu\right) - Ec}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}}} \]
                                                                                        3. lower-/.f64N/A

                                                                                          \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + mu\right) - Ec}{KbT}}}} + \frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}} \]
                                                                                        4. +-commutativeN/A

                                                                                          \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + mu\right) - Ec}{KbT}} + 1}} + \frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}} \]
                                                                                        5. lower-+.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + mu\right) - Ec}{KbT}} + 1}} + \frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}} \]
                                                                                        6. lower-exp.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + mu\right) - Ec}{KbT}}} + 1} + \frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}} \]
                                                                                        7. lower-/.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{e^{\color{blue}{\frac{\left(EDonor + mu\right) - Ec}{KbT}}} + 1} + \frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}} \]
                                                                                        8. lower--.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(EDonor + mu\right) - Ec}}{KbT}} + 1} + \frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}} \]
                                                                                        9. +-commutativeN/A

                                                                                          \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(mu + EDonor\right)} - Ec}{KbT}} + 1} + \frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}} \]
                                                                                        10. lower-+.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(mu + EDonor\right)} - Ec}{KbT}} + 1} + \frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}} \]
                                                                                        11. lower-/.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{e^{\frac{\left(mu + EDonor\right) - Ec}{KbT}} + 1} + \color{blue}{\frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}}} \]
                                                                                        12. +-commutativeN/A

                                                                                          \[\leadsto \frac{NdChar}{e^{\frac{\left(mu + EDonor\right) - Ec}{KbT}} + 1} + \frac{NaChar}{\color{blue}{e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}} + 1}} \]
                                                                                        13. lower-+.f64N/A

                                                                                          \[\leadsto \frac{NdChar}{e^{\frac{\left(mu + EDonor\right) - Ec}{KbT}} + 1} + \frac{NaChar}{\color{blue}{e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}} + 1}} \]
                                                                                      5. Applied rewrites97.1%

                                                                                        \[\leadsto \color{blue}{\frac{NdChar}{e^{\frac{\left(mu + EDonor\right) - Ec}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}} + 1}} \]
                                                                                    3. Recombined 2 regimes into one program.
                                                                                    4. Final simplification94.0%

                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;Vef \leq -4.5 \cdot 10^{+123}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\ \mathbf{elif}\;Vef \leq 1.86 \cdot 10^{+71}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{\left(mu + EDonor\right) - Ec}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\ \end{array} \]
                                                                                    5. Add Preprocessing

                                                                                    Alternative 15: 72.9% accurate, 1.0× speedup?

                                                                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\ \mathbf{if}\;Ev \leq -3.5 \cdot 10^{+115}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{KbT}}} - t\_0\\ \mathbf{elif}\;Ev \leq 8.3 \cdot 10^{-277}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} - t\_0\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} - t\_0\\ \end{array} \end{array} \]
                                                                                    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                                                     :precision binary64
                                                                                     (let* ((t_0 (/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT))))))
                                                                                       (if (<= Ev -3.5e+115)
                                                                                         (- (/ NaChar (+ 1.0 (exp (/ Ev KbT)))) t_0)
                                                                                         (if (<= Ev 8.3e-277)
                                                                                           (- (/ NaChar (+ 1.0 (exp (/ Vef KbT)))) t_0)
                                                                                           (- (/ NaChar (+ 1.0 (exp (/ EAccept KbT)))) t_0)))))
                                                                                    double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                    	double t_0 = NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT)));
                                                                                    	double tmp;
                                                                                    	if (Ev <= -3.5e+115) {
                                                                                    		tmp = (NaChar / (1.0 + exp((Ev / KbT)))) - t_0;
                                                                                    	} else if (Ev <= 8.3e-277) {
                                                                                    		tmp = (NaChar / (1.0 + exp((Vef / KbT)))) - t_0;
                                                                                    	} else {
                                                                                    		tmp = (NaChar / (1.0 + exp((EAccept / KbT)))) - t_0;
                                                                                    	}
                                                                                    	return tmp;
                                                                                    }
                                                                                    
                                                                                    real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                                                                                        real(8), intent (in) :: ndchar
                                                                                        real(8), intent (in) :: ec
                                                                                        real(8), intent (in) :: vef
                                                                                        real(8), intent (in) :: edonor
                                                                                        real(8), intent (in) :: mu
                                                                                        real(8), intent (in) :: kbt
                                                                                        real(8), intent (in) :: nachar
                                                                                        real(8), intent (in) :: ev
                                                                                        real(8), intent (in) :: eaccept
                                                                                        real(8) :: t_0
                                                                                        real(8) :: tmp
                                                                                        t_0 = ndchar / ((-1.0d0) - exp(((mu - ((ec - vef) - edonor)) / kbt)))
                                                                                        if (ev <= (-3.5d+115)) then
                                                                                            tmp = (nachar / (1.0d0 + exp((ev / kbt)))) - t_0
                                                                                        else if (ev <= 8.3d-277) then
                                                                                            tmp = (nachar / (1.0d0 + exp((vef / kbt)))) - t_0
                                                                                        else
                                                                                            tmp = (nachar / (1.0d0 + exp((eaccept / kbt)))) - t_0
                                                                                        end if
                                                                                        code = tmp
                                                                                    end function
                                                                                    
                                                                                    public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                    	double t_0 = NdChar / (-1.0 - Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)));
                                                                                    	double tmp;
                                                                                    	if (Ev <= -3.5e+115) {
                                                                                    		tmp = (NaChar / (1.0 + Math.exp((Ev / KbT)))) - t_0;
                                                                                    	} else if (Ev <= 8.3e-277) {
                                                                                    		tmp = (NaChar / (1.0 + Math.exp((Vef / KbT)))) - t_0;
                                                                                    	} else {
                                                                                    		tmp = (NaChar / (1.0 + Math.exp((EAccept / KbT)))) - t_0;
                                                                                    	}
                                                                                    	return tmp;
                                                                                    }
                                                                                    
                                                                                    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                                                                    	t_0 = NdChar / (-1.0 - math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))
                                                                                    	tmp = 0
                                                                                    	if Ev <= -3.5e+115:
                                                                                    		tmp = (NaChar / (1.0 + math.exp((Ev / KbT)))) - t_0
                                                                                    	elif Ev <= 8.3e-277:
                                                                                    		tmp = (NaChar / (1.0 + math.exp((Vef / KbT)))) - t_0
                                                                                    	else:
                                                                                    		tmp = (NaChar / (1.0 + math.exp((EAccept / KbT)))) - t_0
                                                                                    	return tmp
                                                                                    
                                                                                    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                    	t_0 = Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT))))
                                                                                    	tmp = 0.0
                                                                                    	if (Ev <= -3.5e+115)
                                                                                    		tmp = Float64(Float64(NaChar / Float64(1.0 + exp(Float64(Ev / KbT)))) - t_0);
                                                                                    	elseif (Ev <= 8.3e-277)
                                                                                    		tmp = Float64(Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT)))) - t_0);
                                                                                    	else
                                                                                    		tmp = Float64(Float64(NaChar / Float64(1.0 + exp(Float64(EAccept / KbT)))) - t_0);
                                                                                    	end
                                                                                    	return tmp
                                                                                    end
                                                                                    
                                                                                    function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                    	t_0 = NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT)));
                                                                                    	tmp = 0.0;
                                                                                    	if (Ev <= -3.5e+115)
                                                                                    		tmp = (NaChar / (1.0 + exp((Ev / KbT)))) - t_0;
                                                                                    	elseif (Ev <= 8.3e-277)
                                                                                    		tmp = (NaChar / (1.0 + exp((Vef / KbT)))) - t_0;
                                                                                    	else
                                                                                    		tmp = (NaChar / (1.0 + exp((EAccept / KbT)))) - t_0;
                                                                                    	end
                                                                                    	tmp_2 = tmp;
                                                                                    end
                                                                                    
                                                                                    code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(-1.0 - N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Ev, -3.5e+115], N[(N[(NaChar / N[(1.0 + N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[Ev, 8.3e-277], N[(N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], N[(N[(NaChar / N[(1.0 + N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]
                                                                                    
                                                                                    \begin{array}{l}
                                                                                    
                                                                                    \\
                                                                                    \begin{array}{l}
                                                                                    t_0 := \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\
                                                                                    \mathbf{if}\;Ev \leq -3.5 \cdot 10^{+115}:\\
                                                                                    \;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{KbT}}} - t\_0\\
                                                                                    
                                                                                    \mathbf{elif}\;Ev \leq 8.3 \cdot 10^{-277}:\\
                                                                                    \;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} - t\_0\\
                                                                                    
                                                                                    \mathbf{else}:\\
                                                                                    \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} - t\_0\\
                                                                                    
                                                                                    
                                                                                    \end{array}
                                                                                    \end{array}
                                                                                    
                                                                                    Derivation
                                                                                    1. Split input into 3 regimes
                                                                                    2. if Ev < -3.50000000000000005e115

                                                                                      1. Initial program 100.0%

                                                                                        \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                      2. Add Preprocessing
                                                                                      3. Taylor expanded in Ev around inf

                                                                                        \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Ev}{KbT}}}} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. lower-/.f6494.6

                                                                                          \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Ev}{KbT}}}} \]
                                                                                      5. Applied rewrites94.6%

                                                                                        \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Ev}{KbT}}}} \]

                                                                                      if -3.50000000000000005e115 < Ev < 8.29999999999999978e-277

                                                                                      1. Initial program 100.0%

                                                                                        \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                      2. Add Preprocessing
                                                                                      3. Taylor expanded in Vef around inf

                                                                                        \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. lower-/.f6476.2

                                                                                          \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
                                                                                      5. Applied rewrites76.2%

                                                                                        \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]

                                                                                      if 8.29999999999999978e-277 < Ev

                                                                                      1. Initial program 100.0%

                                                                                        \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                      2. Add Preprocessing
                                                                                      3. Taylor expanded in EAccept around inf

                                                                                        \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. lower-/.f6468.7

                                                                                          \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
                                                                                      5. Applied rewrites68.7%

                                                                                        \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
                                                                                    3. Recombined 3 regimes into one program.
                                                                                    4. Final simplification75.6%

                                                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;Ev \leq -3.5 \cdot 10^{+115}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\ \mathbf{elif}\;Ev \leq 8.3 \cdot 10^{-277}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\ \end{array} \]
                                                                                    5. Add Preprocessing

                                                                                    Alternative 16: 100.0% accurate, 1.0× speedup?

                                                                                    \[\begin{array}{l} \\ \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \end{array} \]
                                                                                    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                                                     :precision binary64
                                                                                     (-
                                                                                      (/ NdChar (+ 1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT))))
                                                                                      (/ NaChar (- -1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT))))))
                                                                                    double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                    	return (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                                                                    }
                                                                                    
                                                                                    real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                                                                                        real(8), intent (in) :: ndchar
                                                                                        real(8), intent (in) :: ec
                                                                                        real(8), intent (in) :: vef
                                                                                        real(8), intent (in) :: edonor
                                                                                        real(8), intent (in) :: mu
                                                                                        real(8), intent (in) :: kbt
                                                                                        real(8), intent (in) :: nachar
                                                                                        real(8), intent (in) :: ev
                                                                                        real(8), intent (in) :: eaccept
                                                                                        code = (ndchar / (1.0d0 + exp(((mu - ((ec - vef) - edonor)) / kbt)))) - (nachar / ((-1.0d0) - exp((((eaccept + (ev + vef)) - mu) / kbt))))
                                                                                    end function
                                                                                    
                                                                                    public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                    	return (NdChar / (1.0 + Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                                                                    }
                                                                                    
                                                                                    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                                                                    	return (NdChar / (1.0 + math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))))
                                                                                    
                                                                                    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                    	return Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)))))
                                                                                    end
                                                                                    
                                                                                    function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                    	tmp = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                                                                    end
                                                                                    
                                                                                    code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
                                                                                    
                                                                                    \begin{array}{l}
                                                                                    
                                                                                    \\
                                                                                    \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}
                                                                                    \end{array}
                                                                                    
                                                                                    Derivation
                                                                                    1. Initial program 100.0%

                                                                                      \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                    2. Add Preprocessing
                                                                                    3. Final simplification100.0%

                                                                                      \[\leadsto \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \]
                                                                                    4. Add Preprocessing

                                                                                    Alternative 17: 68.9% accurate, 1.5× speedup?

                                                                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(mu + Vef\right) + EDonor\\ t_1 := \frac{NdChar}{1 + e^{\frac{t\_0 - Ec}{KbT}}}\\ \mathbf{if}\;NdChar \leq -8 \cdot 10^{-23}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;NdChar \leq 9.2 \cdot 10^{-154}:\\ \;\;\;\;\frac{NdChar}{\mathsf{fma}\left(\frac{Ec - t\_0}{KbT}, -1, 2\right)} + \frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                                                                                    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                                                     :precision binary64
                                                                                     (let* ((t_0 (+ (+ mu Vef) EDonor))
                                                                                            (t_1 (/ NdChar (+ 1.0 (exp (/ (- t_0 Ec) KbT))))))
                                                                                       (if (<= NdChar -8e-23)
                                                                                         t_1
                                                                                         (if (<= NdChar 9.2e-154)
                                                                                           (+
                                                                                            (/ NdChar (fma (/ (- Ec t_0) KbT) -1.0 2.0))
                                                                                            (/ NaChar (+ 1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))))
                                                                                           t_1))))
                                                                                    double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                    	double t_0 = (mu + Vef) + EDonor;
                                                                                    	double t_1 = NdChar / (1.0 + exp(((t_0 - Ec) / KbT)));
                                                                                    	double tmp;
                                                                                    	if (NdChar <= -8e-23) {
                                                                                    		tmp = t_1;
                                                                                    	} else if (NdChar <= 9.2e-154) {
                                                                                    		tmp = (NdChar / fma(((Ec - t_0) / KbT), -1.0, 2.0)) + (NaChar / (1.0 + exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
                                                                                    	} else {
                                                                                    		tmp = t_1;
                                                                                    	}
                                                                                    	return tmp;
                                                                                    }
                                                                                    
                                                                                    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                    	t_0 = Float64(Float64(mu + Vef) + EDonor)
                                                                                    	t_1 = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(t_0 - Ec) / KbT))))
                                                                                    	tmp = 0.0
                                                                                    	if (NdChar <= -8e-23)
                                                                                    		tmp = t_1;
                                                                                    	elseif (NdChar <= 9.2e-154)
                                                                                    		tmp = Float64(Float64(NdChar / fma(Float64(Float64(Ec - t_0) / KbT), -1.0, 2.0)) + Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)))));
                                                                                    	else
                                                                                    		tmp = t_1;
                                                                                    	end
                                                                                    	return tmp
                                                                                    end
                                                                                    
                                                                                    code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision]}, Block[{t$95$1 = N[(NdChar / N[(1.0 + N[Exp[N[(N[(t$95$0 - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NdChar, -8e-23], t$95$1, If[LessEqual[NdChar, 9.2e-154], N[(N[(NdChar / N[(N[(N[(Ec - t$95$0), $MachinePrecision] / KbT), $MachinePrecision] * -1.0 + 2.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
                                                                                    
                                                                                    \begin{array}{l}
                                                                                    
                                                                                    \\
                                                                                    \begin{array}{l}
                                                                                    t_0 := \left(mu + Vef\right) + EDonor\\
                                                                                    t_1 := \frac{NdChar}{1 + e^{\frac{t\_0 - Ec}{KbT}}}\\
                                                                                    \mathbf{if}\;NdChar \leq -8 \cdot 10^{-23}:\\
                                                                                    \;\;\;\;t\_1\\
                                                                                    
                                                                                    \mathbf{elif}\;NdChar \leq 9.2 \cdot 10^{-154}:\\
                                                                                    \;\;\;\;\frac{NdChar}{\mathsf{fma}\left(\frac{Ec - t\_0}{KbT}, -1, 2\right)} + \frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\
                                                                                    
                                                                                    \mathbf{else}:\\
                                                                                    \;\;\;\;t\_1\\
                                                                                    
                                                                                    
                                                                                    \end{array}
                                                                                    \end{array}
                                                                                    
                                                                                    Derivation
                                                                                    1. Split input into 2 regimes
                                                                                    2. if NdChar < -7.99999999999999968e-23 or 9.1999999999999999e-154 < NdChar

                                                                                      1. Initial program 100.0%

                                                                                        \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                      2. Add Preprocessing
                                                                                      3. Taylor expanded in KbT around inf

                                                                                        \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                                                      4. Step-by-step derivation
                                                                                        1. +-commutativeN/A

                                                                                          \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                                                        2. distribute-lft-outN/A

                                                                                          \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                                        3. lower-*.f64N/A

                                                                                          \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                                        4. lower-+.f6424.5

                                                                                          \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                                                      5. Applied rewrites24.5%

                                                                                        \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                                                                                      6. Taylor expanded in NdChar around 0

                                                                                        \[\leadsto \frac{1}{2} \cdot \color{blue}{NaChar} \]
                                                                                      7. Step-by-step derivation
                                                                                        1. Applied rewrites12.6%

                                                                                          \[\leadsto 0.5 \cdot \color{blue}{NaChar} \]
                                                                                        2. Taylor expanded in NdChar around inf

                                                                                          \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                                                                                        3. Step-by-step derivation
                                                                                          1. lower-/.f64N/A

                                                                                            \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                                                                                          2. +-commutativeN/A

                                                                                            \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}} + 1}} \]
                                                                                          3. lower-+.f64N/A

                                                                                            \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}} + 1}} \]
                                                                                          4. lower-exp.f64N/A

                                                                                            \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}} + 1} \]
                                                                                          5. lower-/.f64N/A

                                                                                            \[\leadsto \frac{NdChar}{e^{\color{blue}{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}} + 1} \]
                                                                                          6. lower--.f64N/A

                                                                                            \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(EDonor + \left(Vef + mu\right)\right) - Ec}}{KbT}} + 1} \]
                                                                                          7. +-commutativeN/A

                                                                                            \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(\left(Vef + mu\right) + EDonor\right)} - Ec}{KbT}} + 1} \]
                                                                                          8. lower-+.f64N/A

                                                                                            \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(\left(Vef + mu\right) + EDonor\right)} - Ec}{KbT}} + 1} \]
                                                                                          9. +-commutativeN/A

                                                                                            \[\leadsto \frac{NdChar}{e^{\frac{\left(\color{blue}{\left(mu + Vef\right)} + EDonor\right) - Ec}{KbT}} + 1} \]
                                                                                          10. lower-+.f6471.1

                                                                                            \[\leadsto \frac{NdChar}{e^{\frac{\left(\color{blue}{\left(mu + Vef\right)} + EDonor\right) - Ec}{KbT}} + 1} \]
                                                                                        4. Applied rewrites71.1%

                                                                                          \[\leadsto \color{blue}{\frac{NdChar}{e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}} + 1}} \]

                                                                                        if -7.99999999999999968e-23 < NdChar < 9.1999999999999999e-154

                                                                                        1. Initial program 100.0%

                                                                                          \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        2. Add Preprocessing
                                                                                        3. Step-by-step derivation
                                                                                          1. lift-exp.f64N/A

                                                                                            \[\leadsto \frac{NdChar}{1 + \color{blue}{e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                          2. lift-/.f64N/A

                                                                                            \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                          3. lift-neg.f64N/A

                                                                                            \[\leadsto \frac{NdChar}{1 + e^{\frac{\color{blue}{\mathsf{neg}\left(\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)\right)}}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                          4. distribute-frac-negN/A

                                                                                            \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\mathsf{neg}\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                          5. neg-mul-1N/A

                                                                                            \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{-1 \cdot \frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                          6. exp-prodN/A

                                                                                            \[\leadsto \frac{NdChar}{1 + \color{blue}{{\left(e^{-1}\right)}^{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                          7. lower-pow.f64N/A

                                                                                            \[\leadsto \frac{NdChar}{1 + \color{blue}{{\left(e^{-1}\right)}^{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                          8. lower-exp.f64N/A

                                                                                            \[\leadsto \frac{NdChar}{1 + {\color{blue}{\left(e^{-1}\right)}}^{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                          9. lower-/.f64100.0

                                                                                            \[\leadsto \frac{NdChar}{1 + {\left(e^{-1}\right)}^{\color{blue}{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        4. Applied rewrites100.0%

                                                                                          \[\leadsto \frac{NdChar}{1 + \color{blue}{{\left(e^{-1}\right)}^{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        5. Taylor expanded in KbT around inf

                                                                                          \[\leadsto \frac{NdChar}{\color{blue}{2 + -1 \cdot \frac{Ec - \left(EDonor + \left(Vef + mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        6. Step-by-step derivation
                                                                                          1. +-commutativeN/A

                                                                                            \[\leadsto \frac{NdChar}{\color{blue}{-1 \cdot \frac{Ec - \left(EDonor + \left(Vef + mu\right)\right)}{KbT} + 2}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                          2. *-commutativeN/A

                                                                                            \[\leadsto \frac{NdChar}{\color{blue}{\frac{Ec - \left(EDonor + \left(Vef + mu\right)\right)}{KbT} \cdot -1} + 2} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                          3. lower-fma.f64N/A

                                                                                            \[\leadsto \frac{NdChar}{\color{blue}{\mathsf{fma}\left(\frac{Ec - \left(EDonor + \left(Vef + mu\right)\right)}{KbT}, -1, 2\right)}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                          4. lower-/.f64N/A

                                                                                            \[\leadsto \frac{NdChar}{\mathsf{fma}\left(\color{blue}{\frac{Ec - \left(EDonor + \left(Vef + mu\right)\right)}{KbT}}, -1, 2\right)} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                          5. lower--.f64N/A

                                                                                            \[\leadsto \frac{NdChar}{\mathsf{fma}\left(\frac{\color{blue}{Ec - \left(EDonor + \left(Vef + mu\right)\right)}}{KbT}, -1, 2\right)} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                          6. +-commutativeN/A

                                                                                            \[\leadsto \frac{NdChar}{\mathsf{fma}\left(\frac{Ec - \color{blue}{\left(\left(Vef + mu\right) + EDonor\right)}}{KbT}, -1, 2\right)} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                          7. lower-+.f64N/A

                                                                                            \[\leadsto \frac{NdChar}{\mathsf{fma}\left(\frac{Ec - \color{blue}{\left(\left(Vef + mu\right) + EDonor\right)}}{KbT}, -1, 2\right)} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                          8. +-commutativeN/A

                                                                                            \[\leadsto \frac{NdChar}{\mathsf{fma}\left(\frac{Ec - \left(\color{blue}{\left(mu + Vef\right)} + EDonor\right)}{KbT}, -1, 2\right)} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                          9. lower-+.f6482.3

                                                                                            \[\leadsto \frac{NdChar}{\mathsf{fma}\left(\frac{Ec - \left(\color{blue}{\left(mu + Vef\right)} + EDonor\right)}{KbT}, -1, 2\right)} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        7. Applied rewrites82.3%

                                                                                          \[\leadsto \frac{NdChar}{\color{blue}{\mathsf{fma}\left(\frac{Ec - \left(\left(mu + Vef\right) + EDonor\right)}{KbT}, -1, 2\right)}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                      8. Recombined 2 regimes into one program.
                                                                                      9. Final simplification74.7%

                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;NdChar \leq -8 \cdot 10^{-23}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\ \mathbf{elif}\;NdChar \leq 9.2 \cdot 10^{-154}:\\ \;\;\;\;\frac{NdChar}{\mathsf{fma}\left(\frac{Ec - \left(\left(mu + Vef\right) + EDonor\right)}{KbT}, -1, 2\right)} + \frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\ \end{array} \]
                                                                                      10. Add Preprocessing

                                                                                      Alternative 18: 69.6% accurate, 1.9× speedup?

                                                                                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\ \mathbf{if}\;NaChar \leq -1.7 \cdot 10^{-97}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;NaChar \leq 5.8 \cdot 10^{-65}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                                                                      (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                                                       :precision binary64
                                                                                       (let* ((t_0 (/ NaChar (+ 1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT))))))
                                                                                         (if (<= NaChar -1.7e-97)
                                                                                           t_0
                                                                                           (if (<= NaChar 5.8e-65)
                                                                                             (/ NdChar (+ 1.0 (exp (/ (- (+ (+ mu Vef) EDonor) Ec) KbT))))
                                                                                             t_0))))
                                                                                      double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                      	double t_0 = NaChar / (1.0 + exp((((EAccept + (Ev + Vef)) - mu) / KbT)));
                                                                                      	double tmp;
                                                                                      	if (NaChar <= -1.7e-97) {
                                                                                      		tmp = t_0;
                                                                                      	} else if (NaChar <= 5.8e-65) {
                                                                                      		tmp = NdChar / (1.0 + exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
                                                                                      	} else {
                                                                                      		tmp = t_0;
                                                                                      	}
                                                                                      	return tmp;
                                                                                      }
                                                                                      
                                                                                      real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                                                                                          real(8), intent (in) :: ndchar
                                                                                          real(8), intent (in) :: ec
                                                                                          real(8), intent (in) :: vef
                                                                                          real(8), intent (in) :: edonor
                                                                                          real(8), intent (in) :: mu
                                                                                          real(8), intent (in) :: kbt
                                                                                          real(8), intent (in) :: nachar
                                                                                          real(8), intent (in) :: ev
                                                                                          real(8), intent (in) :: eaccept
                                                                                          real(8) :: t_0
                                                                                          real(8) :: tmp
                                                                                          t_0 = nachar / (1.0d0 + exp((((eaccept + (ev + vef)) - mu) / kbt)))
                                                                                          if (nachar <= (-1.7d-97)) then
                                                                                              tmp = t_0
                                                                                          else if (nachar <= 5.8d-65) then
                                                                                              tmp = ndchar / (1.0d0 + exp(((((mu + vef) + edonor) - ec) / kbt)))
                                                                                          else
                                                                                              tmp = t_0
                                                                                          end if
                                                                                          code = tmp
                                                                                      end function
                                                                                      
                                                                                      public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                      	double t_0 = NaChar / (1.0 + Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT)));
                                                                                      	double tmp;
                                                                                      	if (NaChar <= -1.7e-97) {
                                                                                      		tmp = t_0;
                                                                                      	} else if (NaChar <= 5.8e-65) {
                                                                                      		tmp = NdChar / (1.0 + Math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
                                                                                      	} else {
                                                                                      		tmp = t_0;
                                                                                      	}
                                                                                      	return tmp;
                                                                                      }
                                                                                      
                                                                                      def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                                                                      	t_0 = NaChar / (1.0 + math.exp((((EAccept + (Ev + Vef)) - mu) / KbT)))
                                                                                      	tmp = 0
                                                                                      	if NaChar <= -1.7e-97:
                                                                                      		tmp = t_0
                                                                                      	elif NaChar <= 5.8e-65:
                                                                                      		tmp = NdChar / (1.0 + math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)))
                                                                                      	else:
                                                                                      		tmp = t_0
                                                                                      	return tmp
                                                                                      
                                                                                      function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                      	t_0 = Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT))))
                                                                                      	tmp = 0.0
                                                                                      	if (NaChar <= -1.7e-97)
                                                                                      		tmp = t_0;
                                                                                      	elseif (NaChar <= 5.8e-65)
                                                                                      		tmp = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT))));
                                                                                      	else
                                                                                      		tmp = t_0;
                                                                                      	end
                                                                                      	return tmp
                                                                                      end
                                                                                      
                                                                                      function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                      	t_0 = NaChar / (1.0 + exp((((EAccept + (Ev + Vef)) - mu) / KbT)));
                                                                                      	tmp = 0.0;
                                                                                      	if (NaChar <= -1.7e-97)
                                                                                      		tmp = t_0;
                                                                                      	elseif (NaChar <= 5.8e-65)
                                                                                      		tmp = NdChar / (1.0 + exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
                                                                                      	else
                                                                                      		tmp = t_0;
                                                                                      	end
                                                                                      	tmp_2 = tmp;
                                                                                      end
                                                                                      
                                                                                      code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NaChar, -1.7e-97], t$95$0, If[LessEqual[NaChar, 5.8e-65], N[(NdChar / N[(1.0 + N[Exp[N[(N[(N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                                                                                      
                                                                                      \begin{array}{l}
                                                                                      
                                                                                      \\
                                                                                      \begin{array}{l}
                                                                                      t_0 := \frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\
                                                                                      \mathbf{if}\;NaChar \leq -1.7 \cdot 10^{-97}:\\
                                                                                      \;\;\;\;t\_0\\
                                                                                      
                                                                                      \mathbf{elif}\;NaChar \leq 5.8 \cdot 10^{-65}:\\
                                                                                      \;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\
                                                                                      
                                                                                      \mathbf{else}:\\
                                                                                      \;\;\;\;t\_0\\
                                                                                      
                                                                                      
                                                                                      \end{array}
                                                                                      \end{array}
                                                                                      
                                                                                      Derivation
                                                                                      1. Split input into 2 regimes
                                                                                      2. if NaChar < -1.6999999999999999e-97 or 5.7999999999999996e-65 < NaChar

                                                                                        1. Initial program 100.0%

                                                                                          \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        2. Add Preprocessing
                                                                                        3. Taylor expanded in NdChar around 0

                                                                                          \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}} \]
                                                                                        4. Step-by-step derivation
                                                                                          1. lower-/.f64N/A

                                                                                            \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}} \]
                                                                                          2. +-commutativeN/A

                                                                                            \[\leadsto \frac{NaChar}{\color{blue}{e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}} + 1}} \]
                                                                                          3. lower-+.f64N/A

                                                                                            \[\leadsto \frac{NaChar}{\color{blue}{e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}} + 1}} \]
                                                                                          4. lower-exp.f64N/A

                                                                                            \[\leadsto \frac{NaChar}{\color{blue}{e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} + 1} \]
                                                                                          5. lower-/.f64N/A

                                                                                            \[\leadsto \frac{NaChar}{e^{\color{blue}{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} + 1} \]
                                                                                          6. lower--.f64N/A

                                                                                            \[\leadsto \frac{NaChar}{e^{\frac{\color{blue}{\left(EAccept + \left(Ev + Vef\right)\right) - mu}}{KbT}} + 1} \]
                                                                                          7. +-commutativeN/A

                                                                                            \[\leadsto \frac{NaChar}{e^{\frac{\color{blue}{\left(\left(Ev + Vef\right) + EAccept\right)} - mu}{KbT}} + 1} \]
                                                                                          8. lower-+.f64N/A

                                                                                            \[\leadsto \frac{NaChar}{e^{\frac{\color{blue}{\left(\left(Ev + Vef\right) + EAccept\right)} - mu}{KbT}} + 1} \]
                                                                                          9. lower-+.f6470.0

                                                                                            \[\leadsto \frac{NaChar}{e^{\frac{\left(\color{blue}{\left(Ev + Vef\right)} + EAccept\right) - mu}{KbT}} + 1} \]
                                                                                        5. Applied rewrites70.0%

                                                                                          \[\leadsto \color{blue}{\frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} + 1}} \]

                                                                                        if -1.6999999999999999e-97 < NaChar < 5.7999999999999996e-65

                                                                                        1. Initial program 100.0%

                                                                                          \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                        2. Add Preprocessing
                                                                                        3. Taylor expanded in KbT around inf

                                                                                          \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                                                        4. Step-by-step derivation
                                                                                          1. +-commutativeN/A

                                                                                            \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                                                          2. distribute-lft-outN/A

                                                                                            \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                                          3. lower-*.f64N/A

                                                                                            \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                                          4. lower-+.f6431.5

                                                                                            \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                                                        5. Applied rewrites31.5%

                                                                                          \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                                                                                        6. Taylor expanded in NdChar around 0

                                                                                          \[\leadsto \frac{1}{2} \cdot \color{blue}{NaChar} \]
                                                                                        7. Step-by-step derivation
                                                                                          1. Applied rewrites12.1%

                                                                                            \[\leadsto 0.5 \cdot \color{blue}{NaChar} \]
                                                                                          2. Taylor expanded in NdChar around inf

                                                                                            \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                                                                                          3. Step-by-step derivation
                                                                                            1. lower-/.f64N/A

                                                                                              \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                                                                                            2. +-commutativeN/A

                                                                                              \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}} + 1}} \]
                                                                                            3. lower-+.f64N/A

                                                                                              \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}} + 1}} \]
                                                                                            4. lower-exp.f64N/A

                                                                                              \[\leadsto \frac{NdChar}{\color{blue}{e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}} + 1} \]
                                                                                            5. lower-/.f64N/A

                                                                                              \[\leadsto \frac{NdChar}{e^{\color{blue}{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}} + 1} \]
                                                                                            6. lower--.f64N/A

                                                                                              \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(EDonor + \left(Vef + mu\right)\right) - Ec}}{KbT}} + 1} \]
                                                                                            7. +-commutativeN/A

                                                                                              \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(\left(Vef + mu\right) + EDonor\right)} - Ec}{KbT}} + 1} \]
                                                                                            8. lower-+.f64N/A

                                                                                              \[\leadsto \frac{NdChar}{e^{\frac{\color{blue}{\left(\left(Vef + mu\right) + EDonor\right)} - Ec}{KbT}} + 1} \]
                                                                                            9. +-commutativeN/A

                                                                                              \[\leadsto \frac{NdChar}{e^{\frac{\left(\color{blue}{\left(mu + Vef\right)} + EDonor\right) - Ec}{KbT}} + 1} \]
                                                                                            10. lower-+.f6477.0

                                                                                              \[\leadsto \frac{NdChar}{e^{\frac{\left(\color{blue}{\left(mu + Vef\right)} + EDonor\right) - Ec}{KbT}} + 1} \]
                                                                                          4. Applied rewrites77.0%

                                                                                            \[\leadsto \color{blue}{\frac{NdChar}{e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}} + 1}} \]
                                                                                        8. Recombined 2 regimes into one program.
                                                                                        9. Final simplification72.8%

                                                                                          \[\leadsto \begin{array}{l} \mathbf{if}\;NaChar \leq -1.7 \cdot 10^{-97}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\ \mathbf{elif}\;NaChar \leq 5.8 \cdot 10^{-65}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\ \end{array} \]
                                                                                        10. Add Preprocessing

                                                                                        Alternative 19: 62.9% accurate, 1.9× speedup?

                                                                                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\\ t_1 := \left(NaChar + NdChar\right) \cdot 0.5\\ \mathbf{if}\;KbT \leq -2.8 \cdot 10^{+204}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, \left(\frac{NdChar}{KbT} - \frac{NaChar}{KbT}\right) \cdot mu, t\_1\right)\\ \mathbf{elif}\;KbT \leq 2.6 \cdot 10^{+225}:\\ \;\;\;\;\frac{NaChar}{1 + e^{t\_0}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, \mathsf{fma}\left(NaChar, t\_0, \frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT} \cdot NdChar\right), t\_1\right)\\ \end{array} \end{array} \]
                                                                                        (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                                                         :precision binary64
                                                                                         (let* ((t_0 (/ (- (+ EAccept (+ Ev Vef)) mu) KbT))
                                                                                                (t_1 (* (+ NaChar NdChar) 0.5)))
                                                                                           (if (<= KbT -2.8e+204)
                                                                                             (fma -0.25 (* (- (/ NdChar KbT) (/ NaChar KbT)) mu) t_1)
                                                                                             (if (<= KbT 2.6e+225)
                                                                                               (/ NaChar (+ 1.0 (exp t_0)))
                                                                                               (fma
                                                                                                -0.25
                                                                                                (fma NaChar t_0 (* (/ (- (+ (+ mu Vef) EDonor) Ec) KbT) NdChar))
                                                                                                t_1)))))
                                                                                        double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                        	double t_0 = ((EAccept + (Ev + Vef)) - mu) / KbT;
                                                                                        	double t_1 = (NaChar + NdChar) * 0.5;
                                                                                        	double tmp;
                                                                                        	if (KbT <= -2.8e+204) {
                                                                                        		tmp = fma(-0.25, (((NdChar / KbT) - (NaChar / KbT)) * mu), t_1);
                                                                                        	} else if (KbT <= 2.6e+225) {
                                                                                        		tmp = NaChar / (1.0 + exp(t_0));
                                                                                        	} else {
                                                                                        		tmp = fma(-0.25, fma(NaChar, t_0, (((((mu + Vef) + EDonor) - Ec) / KbT) * NdChar)), t_1);
                                                                                        	}
                                                                                        	return tmp;
                                                                                        }
                                                                                        
                                                                                        function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                        	t_0 = Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)
                                                                                        	t_1 = Float64(Float64(NaChar + NdChar) * 0.5)
                                                                                        	tmp = 0.0
                                                                                        	if (KbT <= -2.8e+204)
                                                                                        		tmp = fma(-0.25, Float64(Float64(Float64(NdChar / KbT) - Float64(NaChar / KbT)) * mu), t_1);
                                                                                        	elseif (KbT <= 2.6e+225)
                                                                                        		tmp = Float64(NaChar / Float64(1.0 + exp(t_0)));
                                                                                        	else
                                                                                        		tmp = fma(-0.25, fma(NaChar, t_0, Float64(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT) * NdChar)), t_1);
                                                                                        	end
                                                                                        	return tmp
                                                                                        end
                                                                                        
                                                                                        code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[KbT, -2.8e+204], N[(-0.25 * N[(N[(N[(NdChar / KbT), $MachinePrecision] - N[(NaChar / KbT), $MachinePrecision]), $MachinePrecision] * mu), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[KbT, 2.6e+225], N[(NaChar / N[(1.0 + N[Exp[t$95$0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.25 * N[(NaChar * t$95$0 + N[(N[(N[(N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision] * NdChar), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]
                                                                                        
                                                                                        \begin{array}{l}
                                                                                        
                                                                                        \\
                                                                                        \begin{array}{l}
                                                                                        t_0 := \frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\\
                                                                                        t_1 := \left(NaChar + NdChar\right) \cdot 0.5\\
                                                                                        \mathbf{if}\;KbT \leq -2.8 \cdot 10^{+204}:\\
                                                                                        \;\;\;\;\mathsf{fma}\left(-0.25, \left(\frac{NdChar}{KbT} - \frac{NaChar}{KbT}\right) \cdot mu, t\_1\right)\\
                                                                                        
                                                                                        \mathbf{elif}\;KbT \leq 2.6 \cdot 10^{+225}:\\
                                                                                        \;\;\;\;\frac{NaChar}{1 + e^{t\_0}}\\
                                                                                        
                                                                                        \mathbf{else}:\\
                                                                                        \;\;\;\;\mathsf{fma}\left(-0.25, \mathsf{fma}\left(NaChar, t\_0, \frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT} \cdot NdChar\right), t\_1\right)\\
                                                                                        
                                                                                        
                                                                                        \end{array}
                                                                                        \end{array}
                                                                                        
                                                                                        Derivation
                                                                                        1. Split input into 3 regimes
                                                                                        2. if KbT < -2.80000000000000025e204

                                                                                          1. Initial program 99.9%

                                                                                            \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                          2. Add Preprocessing
                                                                                          3. Taylor expanded in KbT around -inf

                                                                                            \[\leadsto \color{blue}{\frac{-1}{4} \cdot \frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \left(\frac{-1}{4} \cdot \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT} + \left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right)\right)} \]
                                                                                          4. Step-by-step derivation
                                                                                            1. associate-+r+N/A

                                                                                              \[\leadsto \color{blue}{\left(\frac{-1}{4} \cdot \frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \frac{-1}{4} \cdot \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT}\right) + \left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right)} \]
                                                                                            2. distribute-lft-outN/A

                                                                                              \[\leadsto \color{blue}{\frac{-1}{4} \cdot \left(\frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT}\right)} + \left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right) \]
                                                                                            3. lower-fma.f64N/A

                                                                                              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{4}, \frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT}, \frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right)} \]
                                                                                          5. Applied rewrites76.7%

                                                                                            \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, \mathsf{fma}\left(NaChar, \frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}, NdChar \cdot \frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}\right), 0.5 \cdot \left(NdChar + NaChar\right)\right)} \]
                                                                                          6. Taylor expanded in EAccept around inf

                                                                                            \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, \frac{EAccept \cdot NaChar}{\color{blue}{KbT}}, \frac{1}{2} \cdot \left(NdChar + NaChar\right)\right) \]
                                                                                          7. Step-by-step derivation
                                                                                            1. Applied rewrites76.2%

                                                                                              \[\leadsto \mathsf{fma}\left(-0.25, EAccept \cdot \color{blue}{\frac{NaChar}{KbT}}, 0.5 \cdot \left(NdChar + NaChar\right)\right) \]
                                                                                            2. Taylor expanded in mu around inf

                                                                                              \[\leadsto \mathsf{fma}\left(\frac{-1}{4}, mu \cdot \color{blue}{\left(-1 \cdot \frac{NaChar}{KbT} + \frac{NdChar}{KbT}\right)}, \frac{1}{2} \cdot \left(NdChar + NaChar\right)\right) \]
                                                                                            3. Step-by-step derivation
                                                                                              1. Applied rewrites80.2%

                                                                                                \[\leadsto \mathsf{fma}\left(-0.25, \left(\frac{NdChar}{KbT} - \frac{NaChar}{KbT}\right) \cdot \color{blue}{mu}, 0.5 \cdot \left(NdChar + NaChar\right)\right) \]

                                                                                              if -2.80000000000000025e204 < KbT < 2.60000000000000004e225

                                                                                              1. Initial program 100.0%

                                                                                                \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                              2. Add Preprocessing
                                                                                              3. Taylor expanded in NdChar around 0

                                                                                                \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}} \]
                                                                                              4. Step-by-step derivation
                                                                                                1. lower-/.f64N/A

                                                                                                  \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}} \]
                                                                                                2. +-commutativeN/A

                                                                                                  \[\leadsto \frac{NaChar}{\color{blue}{e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}} + 1}} \]
                                                                                                3. lower-+.f64N/A

                                                                                                  \[\leadsto \frac{NaChar}{\color{blue}{e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}} + 1}} \]
                                                                                                4. lower-exp.f64N/A

                                                                                                  \[\leadsto \frac{NaChar}{\color{blue}{e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} + 1} \]
                                                                                                5. lower-/.f64N/A

                                                                                                  \[\leadsto \frac{NaChar}{e^{\color{blue}{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} + 1} \]
                                                                                                6. lower--.f64N/A

                                                                                                  \[\leadsto \frac{NaChar}{e^{\frac{\color{blue}{\left(EAccept + \left(Ev + Vef\right)\right) - mu}}{KbT}} + 1} \]
                                                                                                7. +-commutativeN/A

                                                                                                  \[\leadsto \frac{NaChar}{e^{\frac{\color{blue}{\left(\left(Ev + Vef\right) + EAccept\right)} - mu}{KbT}} + 1} \]
                                                                                                8. lower-+.f64N/A

                                                                                                  \[\leadsto \frac{NaChar}{e^{\frac{\color{blue}{\left(\left(Ev + Vef\right) + EAccept\right)} - mu}{KbT}} + 1} \]
                                                                                                9. lower-+.f6463.0

                                                                                                  \[\leadsto \frac{NaChar}{e^{\frac{\left(\color{blue}{\left(Ev + Vef\right)} + EAccept\right) - mu}{KbT}} + 1} \]
                                                                                              5. Applied rewrites63.0%

                                                                                                \[\leadsto \color{blue}{\frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} + 1}} \]

                                                                                              if 2.60000000000000004e225 < KbT

                                                                                              1. Initial program 99.8%

                                                                                                \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                              2. Add Preprocessing
                                                                                              3. Taylor expanded in KbT around -inf

                                                                                                \[\leadsto \color{blue}{\frac{-1}{4} \cdot \frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \left(\frac{-1}{4} \cdot \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT} + \left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right)\right)} \]
                                                                                              4. Step-by-step derivation
                                                                                                1. associate-+r+N/A

                                                                                                  \[\leadsto \color{blue}{\left(\frac{-1}{4} \cdot \frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \frac{-1}{4} \cdot \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT}\right) + \left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right)} \]
                                                                                                2. distribute-lft-outN/A

                                                                                                  \[\leadsto \color{blue}{\frac{-1}{4} \cdot \left(\frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT}\right)} + \left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right) \]
                                                                                                3. lower-fma.f64N/A

                                                                                                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{-1}{4}, \frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT}, \frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right)} \]
                                                                                              5. Applied rewrites83.9%

                                                                                                \[\leadsto \color{blue}{\mathsf{fma}\left(-0.25, \mathsf{fma}\left(NaChar, \frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}, NdChar \cdot \frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}\right), 0.5 \cdot \left(NdChar + NaChar\right)\right)} \]
                                                                                            4. Recombined 3 regimes into one program.
                                                                                            5. Final simplification66.1%

                                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -2.8 \cdot 10^{+204}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, \left(\frac{NdChar}{KbT} - \frac{NaChar}{KbT}\right) \cdot mu, \left(NaChar + NdChar\right) \cdot 0.5\right)\\ \mathbf{elif}\;KbT \leq 2.6 \cdot 10^{+225}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, \mathsf{fma}\left(NaChar, \frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}, \frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT} \cdot NdChar\right), \left(NaChar + NdChar\right) \cdot 0.5\right)\\ \end{array} \]
                                                                                            6. Add Preprocessing

                                                                                            Alternative 20: 22.7% accurate, 15.3× speedup?

                                                                                            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;NaChar \leq -1.65 \cdot 10^{-97}:\\ \;\;\;\;0.5 \cdot NaChar\\ \mathbf{elif}\;NaChar \leq 2.7 \cdot 10^{+91}:\\ \;\;\;\;0.5 \cdot NdChar\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot NaChar\\ \end{array} \end{array} \]
                                                                                            (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                                                             :precision binary64
                                                                                             (if (<= NaChar -1.65e-97)
                                                                                               (* 0.5 NaChar)
                                                                                               (if (<= NaChar 2.7e+91) (* 0.5 NdChar) (* 0.5 NaChar))))
                                                                                            double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                            	double tmp;
                                                                                            	if (NaChar <= -1.65e-97) {
                                                                                            		tmp = 0.5 * NaChar;
                                                                                            	} else if (NaChar <= 2.7e+91) {
                                                                                            		tmp = 0.5 * NdChar;
                                                                                            	} else {
                                                                                            		tmp = 0.5 * NaChar;
                                                                                            	}
                                                                                            	return tmp;
                                                                                            }
                                                                                            
                                                                                            real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                                                                                                real(8), intent (in) :: ndchar
                                                                                                real(8), intent (in) :: ec
                                                                                                real(8), intent (in) :: vef
                                                                                                real(8), intent (in) :: edonor
                                                                                                real(8), intent (in) :: mu
                                                                                                real(8), intent (in) :: kbt
                                                                                                real(8), intent (in) :: nachar
                                                                                                real(8), intent (in) :: ev
                                                                                                real(8), intent (in) :: eaccept
                                                                                                real(8) :: tmp
                                                                                                if (nachar <= (-1.65d-97)) then
                                                                                                    tmp = 0.5d0 * nachar
                                                                                                else if (nachar <= 2.7d+91) then
                                                                                                    tmp = 0.5d0 * ndchar
                                                                                                else
                                                                                                    tmp = 0.5d0 * nachar
                                                                                                end if
                                                                                                code = tmp
                                                                                            end function
                                                                                            
                                                                                            public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                            	double tmp;
                                                                                            	if (NaChar <= -1.65e-97) {
                                                                                            		tmp = 0.5 * NaChar;
                                                                                            	} else if (NaChar <= 2.7e+91) {
                                                                                            		tmp = 0.5 * NdChar;
                                                                                            	} else {
                                                                                            		tmp = 0.5 * NaChar;
                                                                                            	}
                                                                                            	return tmp;
                                                                                            }
                                                                                            
                                                                                            def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                                                                            	tmp = 0
                                                                                            	if NaChar <= -1.65e-97:
                                                                                            		tmp = 0.5 * NaChar
                                                                                            	elif NaChar <= 2.7e+91:
                                                                                            		tmp = 0.5 * NdChar
                                                                                            	else:
                                                                                            		tmp = 0.5 * NaChar
                                                                                            	return tmp
                                                                                            
                                                                                            function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                            	tmp = 0.0
                                                                                            	if (NaChar <= -1.65e-97)
                                                                                            		tmp = Float64(0.5 * NaChar);
                                                                                            	elseif (NaChar <= 2.7e+91)
                                                                                            		tmp = Float64(0.5 * NdChar);
                                                                                            	else
                                                                                            		tmp = Float64(0.5 * NaChar);
                                                                                            	end
                                                                                            	return tmp
                                                                                            end
                                                                                            
                                                                                            function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                            	tmp = 0.0;
                                                                                            	if (NaChar <= -1.65e-97)
                                                                                            		tmp = 0.5 * NaChar;
                                                                                            	elseif (NaChar <= 2.7e+91)
                                                                                            		tmp = 0.5 * NdChar;
                                                                                            	else
                                                                                            		tmp = 0.5 * NaChar;
                                                                                            	end
                                                                                            	tmp_2 = tmp;
                                                                                            end
                                                                                            
                                                                                            code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[NaChar, -1.65e-97], N[(0.5 * NaChar), $MachinePrecision], If[LessEqual[NaChar, 2.7e+91], N[(0.5 * NdChar), $MachinePrecision], N[(0.5 * NaChar), $MachinePrecision]]]
                                                                                            
                                                                                            \begin{array}{l}
                                                                                            
                                                                                            \\
                                                                                            \begin{array}{l}
                                                                                            \mathbf{if}\;NaChar \leq -1.65 \cdot 10^{-97}:\\
                                                                                            \;\;\;\;0.5 \cdot NaChar\\
                                                                                            
                                                                                            \mathbf{elif}\;NaChar \leq 2.7 \cdot 10^{+91}:\\
                                                                                            \;\;\;\;0.5 \cdot NdChar\\
                                                                                            
                                                                                            \mathbf{else}:\\
                                                                                            \;\;\;\;0.5 \cdot NaChar\\
                                                                                            
                                                                                            
                                                                                            \end{array}
                                                                                            \end{array}
                                                                                            
                                                                                            Derivation
                                                                                            1. Split input into 2 regimes
                                                                                            2. if NaChar < -1.6500000000000001e-97 or 2.7e91 < NaChar

                                                                                              1. Initial program 100.0%

                                                                                                \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                              2. Add Preprocessing
                                                                                              3. Taylor expanded in KbT around inf

                                                                                                \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                                                              4. Step-by-step derivation
                                                                                                1. +-commutativeN/A

                                                                                                  \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                                                                2. distribute-lft-outN/A

                                                                                                  \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                                                3. lower-*.f64N/A

                                                                                                  \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                                                4. lower-+.f6425.9

                                                                                                  \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                                                              5. Applied rewrites25.9%

                                                                                                \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                                                                                              6. Taylor expanded in NdChar around 0

                                                                                                \[\leadsto \frac{1}{2} \cdot \color{blue}{NaChar} \]
                                                                                              7. Step-by-step derivation
                                                                                                1. Applied rewrites22.3%

                                                                                                  \[\leadsto 0.5 \cdot \color{blue}{NaChar} \]

                                                                                                if -1.6500000000000001e-97 < NaChar < 2.7e91

                                                                                                1. Initial program 100.0%

                                                                                                  \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                                2. Add Preprocessing
                                                                                                3. Taylor expanded in KbT around inf

                                                                                                  \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                                                                4. Step-by-step derivation
                                                                                                  1. +-commutativeN/A

                                                                                                    \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                                                                  2. distribute-lft-outN/A

                                                                                                    \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                                                  3. lower-*.f64N/A

                                                                                                    \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                                                  4. lower-+.f6428.1

                                                                                                    \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                                                                5. Applied rewrites28.1%

                                                                                                  \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                                                                                                6. Taylor expanded in NdChar around 0

                                                                                                  \[\leadsto \frac{1}{2} \cdot \color{blue}{NaChar} \]
                                                                                                7. Step-by-step derivation
                                                                                                  1. Applied rewrites12.8%

                                                                                                    \[\leadsto 0.5 \cdot \color{blue}{NaChar} \]
                                                                                                  2. Taylor expanded in NdChar around inf

                                                                                                    \[\leadsto \frac{1}{2} \cdot \color{blue}{NdChar} \]
                                                                                                  3. Step-by-step derivation
                                                                                                    1. Applied rewrites26.0%

                                                                                                      \[\leadsto 0.5 \cdot \color{blue}{NdChar} \]
                                                                                                  4. Recombined 2 regimes into one program.
                                                                                                  5. Add Preprocessing

                                                                                                  Alternative 21: 27.7% accurate, 30.7× speedup?

                                                                                                  \[\begin{array}{l} \\ \left(NaChar + NdChar\right) \cdot 0.5 \end{array} \]
                                                                                                  (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                                                                   :precision binary64
                                                                                                   (* (+ NaChar NdChar) 0.5))
                                                                                                  double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                                  	return (NaChar + NdChar) * 0.5;
                                                                                                  }
                                                                                                  
                                                                                                  real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                                                                                                      real(8), intent (in) :: ndchar
                                                                                                      real(8), intent (in) :: ec
                                                                                                      real(8), intent (in) :: vef
                                                                                                      real(8), intent (in) :: edonor
                                                                                                      real(8), intent (in) :: mu
                                                                                                      real(8), intent (in) :: kbt
                                                                                                      real(8), intent (in) :: nachar
                                                                                                      real(8), intent (in) :: ev
                                                                                                      real(8), intent (in) :: eaccept
                                                                                                      code = (nachar + ndchar) * 0.5d0
                                                                                                  end function
                                                                                                  
                                                                                                  public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                                  	return (NaChar + NdChar) * 0.5;
                                                                                                  }
                                                                                                  
                                                                                                  def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                                                                                  	return (NaChar + NdChar) * 0.5
                                                                                                  
                                                                                                  function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                                  	return Float64(Float64(NaChar + NdChar) * 0.5)
                                                                                                  end
                                                                                                  
                                                                                                  function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                                  	tmp = (NaChar + NdChar) * 0.5;
                                                                                                  end
                                                                                                  
                                                                                                  code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]
                                                                                                  
                                                                                                  \begin{array}{l}
                                                                                                  
                                                                                                  \\
                                                                                                  \left(NaChar + NdChar\right) \cdot 0.5
                                                                                                  \end{array}
                                                                                                  
                                                                                                  Derivation
                                                                                                  1. Initial program 100.0%

                                                                                                    \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                                  2. Add Preprocessing
                                                                                                  3. Taylor expanded in KbT around inf

                                                                                                    \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                                                                  4. Step-by-step derivation
                                                                                                    1. +-commutativeN/A

                                                                                                      \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                                                                    2. distribute-lft-outN/A

                                                                                                      \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                                                    3. lower-*.f64N/A

                                                                                                      \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                                                    4. lower-+.f6427.1

                                                                                                      \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                                                                  5. Applied rewrites27.1%

                                                                                                    \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                                                                                                  6. Final simplification27.1%

                                                                                                    \[\leadsto \left(NaChar + NdChar\right) \cdot 0.5 \]
                                                                                                  7. Add Preprocessing

                                                                                                  Alternative 22: 17.8% accurate, 46.0× speedup?

                                                                                                  \[\begin{array}{l} \\ 0.5 \cdot NaChar \end{array} \]
                                                                                                  (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                                                                   :precision binary64
                                                                                                   (* 0.5 NaChar))
                                                                                                  double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                                  	return 0.5 * NaChar;
                                                                                                  }
                                                                                                  
                                                                                                  real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                                                                                                      real(8), intent (in) :: ndchar
                                                                                                      real(8), intent (in) :: ec
                                                                                                      real(8), intent (in) :: vef
                                                                                                      real(8), intent (in) :: edonor
                                                                                                      real(8), intent (in) :: mu
                                                                                                      real(8), intent (in) :: kbt
                                                                                                      real(8), intent (in) :: nachar
                                                                                                      real(8), intent (in) :: ev
                                                                                                      real(8), intent (in) :: eaccept
                                                                                                      code = 0.5d0 * nachar
                                                                                                  end function
                                                                                                  
                                                                                                  public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                                                  	return 0.5 * NaChar;
                                                                                                  }
                                                                                                  
                                                                                                  def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                                                                                  	return 0.5 * NaChar
                                                                                                  
                                                                                                  function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                                  	return Float64(0.5 * NaChar)
                                                                                                  end
                                                                                                  
                                                                                                  function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                                                  	tmp = 0.5 * NaChar;
                                                                                                  end
                                                                                                  
                                                                                                  code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(0.5 * NaChar), $MachinePrecision]
                                                                                                  
                                                                                                  \begin{array}{l}
                                                                                                  
                                                                                                  \\
                                                                                                  0.5 \cdot NaChar
                                                                                                  \end{array}
                                                                                                  
                                                                                                  Derivation
                                                                                                  1. Initial program 100.0%

                                                                                                    \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                                                  2. Add Preprocessing
                                                                                                  3. Taylor expanded in KbT around inf

                                                                                                    \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
                                                                                                  4. Step-by-step derivation
                                                                                                    1. +-commutativeN/A

                                                                                                      \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar + \frac{1}{2} \cdot NaChar} \]
                                                                                                    2. distribute-lft-outN/A

                                                                                                      \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                                                    3. lower-*.f64N/A

                                                                                                      \[\leadsto \color{blue}{\frac{1}{2} \cdot \left(NdChar + NaChar\right)} \]
                                                                                                    4. lower-+.f6427.1

                                                                                                      \[\leadsto 0.5 \cdot \color{blue}{\left(NdChar + NaChar\right)} \]
                                                                                                  5. Applied rewrites27.1%

                                                                                                    \[\leadsto \color{blue}{0.5 \cdot \left(NdChar + NaChar\right)} \]
                                                                                                  6. Taylor expanded in NdChar around 0

                                                                                                    \[\leadsto \frac{1}{2} \cdot \color{blue}{NaChar} \]
                                                                                                  7. Step-by-step derivation
                                                                                                    1. Applied rewrites17.1%

                                                                                                      \[\leadsto 0.5 \cdot \color{blue}{NaChar} \]
                                                                                                    2. Add Preprocessing

                                                                                                    Reproduce

                                                                                                    ?
                                                                                                    herbie shell --seed 2024331 
                                                                                                    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                                                                      :name "Bulmash initializePoisson"
                                                                                                      :precision binary64
                                                                                                      (+ (/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT)))) (/ NaChar (+ 1.0 (exp (/ (+ (+ (+ Ev Vef) EAccept) (- mu)) KbT))))))