Bulmash initializePoisson

Percentage Accurate: 100.0% → 100.0%
Time: 18.5s
Alternatives: 16
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 16 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, 1.0× speedup?

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

\\
\frac{NdChar}{e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(\left(Vef + Ev\right) + EAccept\right) - mu}{KbT}} + 1}
\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}{e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(\left(Vef + Ev\right) + EAccept\right) - mu}{KbT}} + 1} \]
  4. Add Preprocessing

Alternative 2: 45.3% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ t_1 := \frac{NdChar}{e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(\left(Vef + Ev\right) + EAccept\right) - mu}{KbT}} + 1}\\ t_2 := \frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ t_3 := Ec - \left(Vef + mu\right)\\ t_4 := EDonor - t\_3\\ \mathbf{if}\;t\_1 \leq -2 \cdot 10^{-40}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-274}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_1 \leq 0:\\ \;\;\;\;\frac{NdChar}{2 - \frac{\mathsf{fma}\left(-0.5, \frac{t\_4 \cdot t\_4}{KbT}, t\_3 - EDonor\right)}{KbT}}\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+183}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, Vef \cdot \frac{NdChar}{KbT}, t\_0\right)\\ \end{array} \end{array} \]
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
 :precision binary64
 (let* ((t_0 (* 0.5 (+ NdChar NaChar)))
        (t_1
         (+
          (/ NdChar (+ (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)) 1.0))
          (/ NaChar (+ (exp (/ (- (+ (+ Vef Ev) EAccept) mu) KbT)) 1.0))))
        (t_2 (/ NdChar (+ (exp (/ EDonor KbT)) 1.0)))
        (t_3 (- Ec (+ Vef mu)))
        (t_4 (- EDonor t_3)))
   (if (<= t_1 -2e-40)
     t_0
     (if (<= t_1 -2e-274)
       t_2
       (if (<= t_1 0.0)
         (/
          NdChar
          (- 2.0 (/ (fma -0.5 (/ (* t_4 t_4) KbT) (- t_3 EDonor)) KbT)))
         (if (<= t_1 2e+183) t_2 (fma -0.25 (* Vef (/ NdChar 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 = 0.5 * (NdChar + NaChar);
	double t_1 = (NdChar / (exp(((mu - ((Ec - Vef) - EDonor)) / KbT)) + 1.0)) + (NaChar / (exp(((((Vef + Ev) + EAccept) - mu) / KbT)) + 1.0));
	double t_2 = NdChar / (exp((EDonor / KbT)) + 1.0);
	double t_3 = Ec - (Vef + mu);
	double t_4 = EDonor - t_3;
	double tmp;
	if (t_1 <= -2e-40) {
		tmp = t_0;
	} else if (t_1 <= -2e-274) {
		tmp = t_2;
	} else if (t_1 <= 0.0) {
		tmp = NdChar / (2.0 - (fma(-0.5, ((t_4 * t_4) / KbT), (t_3 - EDonor)) / KbT));
	} else if (t_1 <= 2e+183) {
		tmp = t_2;
	} else {
		tmp = fma(-0.25, (Vef * (NdChar / KbT)), t_0);
	}
	return tmp;
}
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	t_0 = Float64(0.5 * Float64(NdChar + NaChar))
	t_1 = Float64(Float64(NdChar / Float64(exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)) + 1.0)) + Float64(NaChar / Float64(exp(Float64(Float64(Float64(Float64(Vef + Ev) + EAccept) - mu) / KbT)) + 1.0)))
	t_2 = Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) + 1.0))
	t_3 = Float64(Ec - Float64(Vef + mu))
	t_4 = Float64(EDonor - t_3)
	tmp = 0.0
	if (t_1 <= -2e-40)
		tmp = t_0;
	elseif (t_1 <= -2e-274)
		tmp = t_2;
	elseif (t_1 <= 0.0)
		tmp = Float64(NdChar / Float64(2.0 - Float64(fma(-0.5, Float64(Float64(t_4 * t_4) / KbT), Float64(t_3 - EDonor)) / KbT)));
	elseif (t_1 <= 2e+183)
		tmp = t_2;
	else
		tmp = fma(-0.25, Float64(Vef * Float64(NdChar / KbT)), t_0);
	end
	return tmp
end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(N[Exp[N[(N[(N[(N[(Vef + Ev), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(Ec - N[(Vef + mu), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(EDonor - t$95$3), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-40], t$95$0, If[LessEqual[t$95$1, -2e-274], t$95$2, If[LessEqual[t$95$1, 0.0], N[(NdChar / N[(2.0 - N[(N[(-0.5 * N[(N[(t$95$4 * t$95$4), $MachinePrecision] / KbT), $MachinePrecision] + N[(t$95$3 - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+183], t$95$2, N[(-0.25 * N[(Vef * N[(NdChar / KbT), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-274}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{NdChar}{2 - \frac{\mathsf{fma}\left(-0.5, \frac{t\_4 \cdot t\_4}{KbT}, t\_3 - EDonor\right)}{KbT}}\\

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+183}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, Vef \cdot \frac{NdChar}{KbT}, t\_0\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 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))))) < -1.9999999999999999e-40

    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. distribute-lft-outN/A

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

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

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

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

    if -1.9999999999999999e-40 < (+.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.99999999999999993e-274 or 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))))) < 1.99999999999999989e183

    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 inf

      \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
    4. 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} \]
    7. Step-by-step derivation
      1. Applied rewrites40.6%

        \[\leadsto \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} \]

      if -1.99999999999999993e-274 < (+.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 NdChar around inf

        \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
      4. 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{NdChar}{2 - \color{blue}{\frac{\mathsf{fma}\left(-0.5, \frac{\left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right) \cdot \left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right)}{KbT}, -\left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right)\right)}{KbT}}} \]

        if 1.99999999999999989e183 < (+.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 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. Applied rewrites21.0%

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

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

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

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

              \[\leadsto \mathsf{fma}\left(-0.25, Vef \cdot \frac{NdChar}{KbT}, 0.5 \cdot \left(NaChar + NdChar\right)\right) \]
          4. Recombined 4 regimes into one program.
          5. Final simplification48.0%

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

          Alternative 3: 43.8% accurate, 0.4× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := Ec - \left(Vef + mu\right)\\ t_1 := EDonor - t\_0\\ t_2 := 0.5 \cdot \left(NdChar + NaChar\right)\\ t_3 := \frac{NdChar}{e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(\left(Vef + Ev\right) + EAccept\right) - mu}{KbT}} + 1}\\ \mathbf{if}\;t\_3 \leq -5 \cdot 10^{-267}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-286}:\\ \;\;\;\;\frac{NdChar}{2 - \frac{\mathsf{fma}\left(-0.5, \frac{t\_1 \cdot t\_1}{KbT}, t\_0 - EDonor\right)}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
          (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
           :precision binary64
           (let* ((t_0 (- Ec (+ Vef mu)))
                  (t_1 (- EDonor t_0))
                  (t_2 (* 0.5 (+ NdChar NaChar)))
                  (t_3
                   (+
                    (/ NdChar (+ (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)) 1.0))
                    (/ NaChar (+ (exp (/ (- (+ (+ Vef Ev) EAccept) mu) KbT)) 1.0)))))
             (if (<= t_3 -5e-267)
               t_2
               (if (<= t_3 2e-286)
                 (/ NdChar (- 2.0 (/ (fma -0.5 (/ (* t_1 t_1) KbT) (- t_0 EDonor)) 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 = Ec - (Vef + mu);
          	double t_1 = EDonor - t_0;
          	double t_2 = 0.5 * (NdChar + NaChar);
          	double t_3 = (NdChar / (exp(((mu - ((Ec - Vef) - EDonor)) / KbT)) + 1.0)) + (NaChar / (exp(((((Vef + Ev) + EAccept) - mu) / KbT)) + 1.0));
          	double tmp;
          	if (t_3 <= -5e-267) {
          		tmp = t_2;
          	} else if (t_3 <= 2e-286) {
          		tmp = NdChar / (2.0 - (fma(-0.5, ((t_1 * t_1) / KbT), (t_0 - EDonor)) / KbT));
          	} else {
          		tmp = t_2;
          	}
          	return tmp;
          }
          
          function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
          	t_0 = Float64(Ec - Float64(Vef + mu))
          	t_1 = Float64(EDonor - t_0)
          	t_2 = Float64(0.5 * Float64(NdChar + NaChar))
          	t_3 = Float64(Float64(NdChar / Float64(exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)) + 1.0)) + Float64(NaChar / Float64(exp(Float64(Float64(Float64(Float64(Vef + Ev) + EAccept) - mu) / KbT)) + 1.0)))
          	tmp = 0.0
          	if (t_3 <= -5e-267)
          		tmp = t_2;
          	elseif (t_3 <= 2e-286)
          		tmp = Float64(NdChar / Float64(2.0 - Float64(fma(-0.5, Float64(Float64(t_1 * t_1) / KbT), Float64(t_0 - EDonor)) / KbT)));
          	else
          		tmp = t_2;
          	end
          	return tmp
          end
          
          code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(Ec - N[(Vef + mu), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(EDonor - t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(NdChar / N[(N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(N[Exp[N[(N[(N[(N[(Vef + Ev), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-267], t$95$2, If[LessEqual[t$95$3, 2e-286], N[(NdChar / N[(2.0 - N[(N[(-0.5 * N[(N[(t$95$1 * t$95$1), $MachinePrecision] / KbT), $MachinePrecision] + N[(t$95$0 - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := Ec - \left(Vef + mu\right)\\
          t_1 := EDonor - t\_0\\
          t_2 := 0.5 \cdot \left(NdChar + NaChar\right)\\
          t_3 := \frac{NdChar}{e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(\left(Vef + Ev\right) + EAccept\right) - mu}{KbT}} + 1}\\
          \mathbf{if}\;t\_3 \leq -5 \cdot 10^{-267}:\\
          \;\;\;\;t\_2\\
          
          \mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-286}:\\
          \;\;\;\;\frac{NdChar}{2 - \frac{\mathsf{fma}\left(-0.5, \frac{t\_1 \cdot t\_1}{KbT}, t\_0 - EDonor\right)}{KbT}}\\
          
          \mathbf{else}:\\
          \;\;\;\;t\_2\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 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.9999999999999999e-267 or 2.0000000000000001e-286 < (+.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. distribute-lft-outN/A

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

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

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

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

            if -4.9999999999999999e-267 < (+.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-286

            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 inf

              \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
            4. 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{NdChar}{2 - \color{blue}{\frac{\mathsf{fma}\left(-0.5, \frac{\left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right) \cdot \left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right)}{KbT}, -\left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right)\right)}{KbT}}} \]
            8. Recombined 2 regimes into one program.
            9. Final simplification43.1%

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

            Alternative 4: 35.8% accurate, 0.5× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ t_1 := \frac{NdChar}{e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(\left(Vef + Ev\right) + EAccept\right) - mu}{KbT}} + 1}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-267}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-158}:\\ \;\;\;\;\frac{NdChar}{2 - \left(\left(\frac{Ec - mu}{KbT} - \frac{Vef}{KbT}\right) - \frac{EDonor}{KbT}\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
            (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
             :precision binary64
             (let* ((t_0 (* 0.5 (+ NdChar NaChar)))
                    (t_1
                     (+
                      (/ NdChar (+ (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)) 1.0))
                      (/ NaChar (+ (exp (/ (- (+ (+ Vef Ev) EAccept) mu) KbT)) 1.0)))))
               (if (<= t_1 -5e-267)
                 t_0
                 (if (<= t_1 5e-158)
                   (/ NdChar (- 2.0 (- (- (/ (- Ec mu) KbT) (/ Vef KbT)) (/ EDonor 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 = 0.5 * (NdChar + NaChar);
            	double t_1 = (NdChar / (exp(((mu - ((Ec - Vef) - EDonor)) / KbT)) + 1.0)) + (NaChar / (exp(((((Vef + Ev) + EAccept) - mu) / KbT)) + 1.0));
            	double tmp;
            	if (t_1 <= -5e-267) {
            		tmp = t_0;
            	} else if (t_1 <= 5e-158) {
            		tmp = NdChar / (2.0 - ((((Ec - mu) / KbT) - (Vef / KbT)) - (EDonor / 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) :: t_1
                real(8) :: tmp
                t_0 = 0.5d0 * (ndchar + nachar)
                t_1 = (ndchar / (exp(((mu - ((ec - vef) - edonor)) / kbt)) + 1.0d0)) + (nachar / (exp(((((vef + ev) + eaccept) - mu) / kbt)) + 1.0d0))
                if (t_1 <= (-5d-267)) then
                    tmp = t_0
                else if (t_1 <= 5d-158) then
                    tmp = ndchar / (2.0d0 - ((((ec - mu) / kbt) - (vef / kbt)) - (edonor / 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 = 0.5 * (NdChar + NaChar);
            	double t_1 = (NdChar / (Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)) + 1.0)) + (NaChar / (Math.exp(((((Vef + Ev) + EAccept) - mu) / KbT)) + 1.0));
            	double tmp;
            	if (t_1 <= -5e-267) {
            		tmp = t_0;
            	} else if (t_1 <= 5e-158) {
            		tmp = NdChar / (2.0 - ((((Ec - mu) / KbT) - (Vef / KbT)) - (EDonor / KbT)));
            	} else {
            		tmp = t_0;
            	}
            	return tmp;
            }
            
            def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
            	t_0 = 0.5 * (NdChar + NaChar)
            	t_1 = (NdChar / (math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)) + 1.0)) + (NaChar / (math.exp(((((Vef + Ev) + EAccept) - mu) / KbT)) + 1.0))
            	tmp = 0
            	if t_1 <= -5e-267:
            		tmp = t_0
            	elif t_1 <= 5e-158:
            		tmp = NdChar / (2.0 - ((((Ec - mu) / KbT) - (Vef / KbT)) - (EDonor / KbT)))
            	else:
            		tmp = t_0
            	return tmp
            
            function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
            	t_0 = Float64(0.5 * Float64(NdChar + NaChar))
            	t_1 = Float64(Float64(NdChar / Float64(exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)) + 1.0)) + Float64(NaChar / Float64(exp(Float64(Float64(Float64(Float64(Vef + Ev) + EAccept) - mu) / KbT)) + 1.0)))
            	tmp = 0.0
            	if (t_1 <= -5e-267)
            		tmp = t_0;
            	elseif (t_1 <= 5e-158)
            		tmp = Float64(NdChar / Float64(2.0 - Float64(Float64(Float64(Float64(Ec - mu) / KbT) - Float64(Vef / KbT)) - Float64(EDonor / KbT))));
            	else
            		tmp = t_0;
            	end
            	return tmp
            end
            
            function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
            	t_0 = 0.5 * (NdChar + NaChar);
            	t_1 = (NdChar / (exp(((mu - ((Ec - Vef) - EDonor)) / KbT)) + 1.0)) + (NaChar / (exp(((((Vef + Ev) + EAccept) - mu) / KbT)) + 1.0));
            	tmp = 0.0;
            	if (t_1 <= -5e-267)
            		tmp = t_0;
            	elseif (t_1 <= 5e-158)
            		tmp = NdChar / (2.0 - ((((Ec - mu) / KbT) - (Vef / KbT)) - (EDonor / 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[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(N[Exp[N[(N[(N[(N[(Vef + Ev), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-267], t$95$0, If[LessEqual[t$95$1, 5e-158], N[(NdChar / N[(2.0 - N[(N[(N[(N[(Ec - mu), $MachinePrecision] / KbT), $MachinePrecision] - N[(Vef / KbT), $MachinePrecision]), $MachinePrecision] - N[(EDonor / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
            t_1 := \frac{NdChar}{e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(\left(Vef + Ev\right) + EAccept\right) - mu}{KbT}} + 1}\\
            \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-267}:\\
            \;\;\;\;t\_0\\
            
            \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-158}:\\
            \;\;\;\;\frac{NdChar}{2 - \left(\left(\frac{Ec - mu}{KbT} - \frac{Vef}{KbT}\right) - \frac{EDonor}{KbT}\right)}\\
            
            \mathbf{else}:\\
            \;\;\;\;t\_0\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 2 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.9999999999999999e-267 or 4.99999999999999972e-158 < (+.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. distribute-lft-outN/A

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

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

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

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

              if -4.9999999999999999e-267 < (+.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.99999999999999972e-158

              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 inf

                \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
              4. 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \frac{NdChar}{1 + e^{\frac{Vef}{KbT}}} \]
              7. Step-by-step derivation
                1. Applied rewrites51.9%

                  \[\leadsto \frac{NdChar}{1 + e^{\frac{Vef}{KbT}}} \]
                2. Taylor expanded in KbT around inf

                  \[\leadsto \frac{NdChar}{\left(2 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \color{blue}{\frac{Ec}{KbT}}} \]
                3. Step-by-step derivation
                  1. Applied rewrites48.6%

                    \[\leadsto \frac{NdChar}{2 + \color{blue}{\left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu - Ec}{KbT}\right)\right)}} \]
                4. Recombined 2 regimes into one program.
                5. Final simplification36.6%

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

                Alternative 5: 32.7% accurate, 0.5× speedup?

                \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ t_1 := \frac{NdChar}{e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(\left(Vef + Ev\right) + EAccept\right) - mu}{KbT}} + 1}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-267}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-286}:\\ \;\;\;\;0.5 \cdot \left(\left(NaChar \cdot NaChar\right) \cdot \frac{1}{NaChar - NdChar}\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                 :precision binary64
                 (let* ((t_0 (* 0.5 (+ NdChar NaChar)))
                        (t_1
                         (+
                          (/ NdChar (+ (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)) 1.0))
                          (/ NaChar (+ (exp (/ (- (+ (+ Vef Ev) EAccept) mu) KbT)) 1.0)))))
                   (if (<= t_1 -5e-267)
                     t_0
                     (if (<= t_1 2e-286)
                       (* 0.5 (* (* NaChar NaChar) (/ 1.0 (- NaChar 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 = 0.5 * (NdChar + NaChar);
                	double t_1 = (NdChar / (exp(((mu - ((Ec - Vef) - EDonor)) / KbT)) + 1.0)) + (NaChar / (exp(((((Vef + Ev) + EAccept) - mu) / KbT)) + 1.0));
                	double tmp;
                	if (t_1 <= -5e-267) {
                		tmp = t_0;
                	} else if (t_1 <= 2e-286) {
                		tmp = 0.5 * ((NaChar * NaChar) * (1.0 / (NaChar - 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 = 0.5d0 * (ndchar + nachar)
                    t_1 = (ndchar / (exp(((mu - ((ec - vef) - edonor)) / kbt)) + 1.0d0)) + (nachar / (exp(((((vef + ev) + eaccept) - mu) / kbt)) + 1.0d0))
                    if (t_1 <= (-5d-267)) then
                        tmp = t_0
                    else if (t_1 <= 2d-286) then
                        tmp = 0.5d0 * ((nachar * nachar) * (1.0d0 / (nachar - 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 = 0.5 * (NdChar + NaChar);
                	double t_1 = (NdChar / (Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)) + 1.0)) + (NaChar / (Math.exp(((((Vef + Ev) + EAccept) - mu) / KbT)) + 1.0));
                	double tmp;
                	if (t_1 <= -5e-267) {
                		tmp = t_0;
                	} else if (t_1 <= 2e-286) {
                		tmp = 0.5 * ((NaChar * NaChar) * (1.0 / (NaChar - NdChar)));
                	} else {
                		tmp = t_0;
                	}
                	return tmp;
                }
                
                def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                	t_0 = 0.5 * (NdChar + NaChar)
                	t_1 = (NdChar / (math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)) + 1.0)) + (NaChar / (math.exp(((((Vef + Ev) + EAccept) - mu) / KbT)) + 1.0))
                	tmp = 0
                	if t_1 <= -5e-267:
                		tmp = t_0
                	elif t_1 <= 2e-286:
                		tmp = 0.5 * ((NaChar * NaChar) * (1.0 / (NaChar - NdChar)))
                	else:
                		tmp = t_0
                	return tmp
                
                function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                	t_0 = Float64(0.5 * Float64(NdChar + NaChar))
                	t_1 = Float64(Float64(NdChar / Float64(exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)) + 1.0)) + Float64(NaChar / Float64(exp(Float64(Float64(Float64(Float64(Vef + Ev) + EAccept) - mu) / KbT)) + 1.0)))
                	tmp = 0.0
                	if (t_1 <= -5e-267)
                		tmp = t_0;
                	elseif (t_1 <= 2e-286)
                		tmp = Float64(0.5 * Float64(Float64(NaChar * NaChar) * Float64(1.0 / Float64(NaChar - NdChar))));
                	else
                		tmp = t_0;
                	end
                	return tmp
                end
                
                function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                	t_0 = 0.5 * (NdChar + NaChar);
                	t_1 = (NdChar / (exp(((mu - ((Ec - Vef) - EDonor)) / KbT)) + 1.0)) + (NaChar / (exp(((((Vef + Ev) + EAccept) - mu) / KbT)) + 1.0));
                	tmp = 0.0;
                	if (t_1 <= -5e-267)
                		tmp = t_0;
                	elseif (t_1 <= 2e-286)
                		tmp = 0.5 * ((NaChar * NaChar) * (1.0 / (NaChar - 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[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(N[Exp[N[(N[(N[(N[(Vef + Ev), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-267], t$95$0, If[LessEqual[t$95$1, 2e-286], N[(0.5 * N[(N[(NaChar * NaChar), $MachinePrecision] * N[(1.0 / N[(NaChar - NdChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
                
                \begin{array}{l}
                
                \\
                \begin{array}{l}
                t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
                t_1 := \frac{NdChar}{e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(\left(Vef + Ev\right) + EAccept\right) - mu}{KbT}} + 1}\\
                \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-267}:\\
                \;\;\;\;t\_0\\
                
                \mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-286}:\\
                \;\;\;\;0.5 \cdot \left(\left(NaChar \cdot NaChar\right) \cdot \frac{1}{NaChar - NdChar}\right)\\
                
                \mathbf{else}:\\
                \;\;\;\;t\_0\\
                
                
                \end{array}
                \end{array}
                
                Derivation
                1. Split input into 2 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.9999999999999999e-267 or 2.0000000000000001e-286 < (+.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. distribute-lft-outN/A

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

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

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

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

                  if -4.9999999999999999e-267 < (+.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-286

                  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. distribute-lft-outN/A

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

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

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

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

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

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

                        \[\leadsto 0.5 \cdot \left(\left(NaChar \cdot NaChar\right) \cdot \frac{\color{blue}{1}}{NaChar - NdChar}\right) \]
                    4. Recombined 2 regimes into one program.
                    5. Final simplification33.3%

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

                    Alternative 6: 94.6% accurate, 1.0× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NaChar}{e^{\frac{\left(Ev + EAccept\right) - mu}{KbT}} + 1} + \frac{NdChar}{e^{\frac{EDonor + \left(mu - Ec\right)}{KbT}} + 1}\\ \mathbf{if}\;mu \leq -1.18 \cdot 10^{+116}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;mu \leq 5.4 \cdot 10^{+122}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{\left(Vef + Ev\right) + EAccept}{KbT}} + 1} + \frac{NdChar}{e^{\frac{EDonor + \left(Vef - Ec\right)}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                     :precision binary64
                     (let* ((t_0
                             (+
                              (/ NaChar (+ (exp (/ (- (+ Ev EAccept) mu) KbT)) 1.0))
                              (/ NdChar (+ (exp (/ (+ EDonor (- mu Ec)) KbT)) 1.0)))))
                       (if (<= mu -1.18e+116)
                         t_0
                         (if (<= mu 5.4e+122)
                           (+
                            (/ NaChar (+ (exp (/ (+ (+ Vef Ev) EAccept) KbT)) 1.0))
                            (/ NdChar (+ (exp (/ (+ EDonor (- Vef Ec)) KbT)) 1.0)))
                           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 / (exp((((Ev + EAccept) - mu) / KbT)) + 1.0)) + (NdChar / (exp(((EDonor + (mu - Ec)) / KbT)) + 1.0));
                    	double tmp;
                    	if (mu <= -1.18e+116) {
                    		tmp = t_0;
                    	} else if (mu <= 5.4e+122) {
                    		tmp = (NaChar / (exp((((Vef + Ev) + EAccept) / KbT)) + 1.0)) + (NdChar / (exp(((EDonor + (Vef - Ec)) / KbT)) + 1.0));
                    	} 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 / (exp((((ev + eaccept) - mu) / kbt)) + 1.0d0)) + (ndchar / (exp(((edonor + (mu - ec)) / kbt)) + 1.0d0))
                        if (mu <= (-1.18d+116)) then
                            tmp = t_0
                        else if (mu <= 5.4d+122) then
                            tmp = (nachar / (exp((((vef + ev) + eaccept) / kbt)) + 1.0d0)) + (ndchar / (exp(((edonor + (vef - ec)) / kbt)) + 1.0d0))
                        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 / (Math.exp((((Ev + EAccept) - mu) / KbT)) + 1.0)) + (NdChar / (Math.exp(((EDonor + (mu - Ec)) / KbT)) + 1.0));
                    	double tmp;
                    	if (mu <= -1.18e+116) {
                    		tmp = t_0;
                    	} else if (mu <= 5.4e+122) {
                    		tmp = (NaChar / (Math.exp((((Vef + Ev) + EAccept) / KbT)) + 1.0)) + (NdChar / (Math.exp(((EDonor + (Vef - Ec)) / KbT)) + 1.0));
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                    	t_0 = (NaChar / (math.exp((((Ev + EAccept) - mu) / KbT)) + 1.0)) + (NdChar / (math.exp(((EDonor + (mu - Ec)) / KbT)) + 1.0))
                    	tmp = 0
                    	if mu <= -1.18e+116:
                    		tmp = t_0
                    	elif mu <= 5.4e+122:
                    		tmp = (NaChar / (math.exp((((Vef + Ev) + EAccept) / KbT)) + 1.0)) + (NdChar / (math.exp(((EDonor + (Vef - Ec)) / KbT)) + 1.0))
                    	else:
                    		tmp = t_0
                    	return tmp
                    
                    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                    	t_0 = Float64(Float64(NaChar / Float64(exp(Float64(Float64(Float64(Ev + EAccept) - mu) / KbT)) + 1.0)) + Float64(NdChar / Float64(exp(Float64(Float64(EDonor + Float64(mu - Ec)) / KbT)) + 1.0)))
                    	tmp = 0.0
                    	if (mu <= -1.18e+116)
                    		tmp = t_0;
                    	elseif (mu <= 5.4e+122)
                    		tmp = Float64(Float64(NaChar / Float64(exp(Float64(Float64(Float64(Vef + Ev) + EAccept) / KbT)) + 1.0)) + Float64(NdChar / Float64(exp(Float64(Float64(EDonor + Float64(Vef - Ec)) / KbT)) + 1.0)));
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                    	t_0 = (NaChar / (exp((((Ev + EAccept) - mu) / KbT)) + 1.0)) + (NdChar / (exp(((EDonor + (mu - Ec)) / KbT)) + 1.0));
                    	tmp = 0.0;
                    	if (mu <= -1.18e+116)
                    		tmp = t_0;
                    	elseif (mu <= 5.4e+122)
                    		tmp = (NaChar / (exp((((Vef + Ev) + EAccept) / KbT)) + 1.0)) + (NdChar / (exp(((EDonor + (Vef - Ec)) / KbT)) + 1.0));
                    	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[(N[Exp[N[(N[(N[(Ev + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NdChar / N[(N[Exp[N[(N[(EDonor + N[(mu - Ec), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[mu, -1.18e+116], t$95$0, If[LessEqual[mu, 5.4e+122], N[(N[(NaChar / N[(N[Exp[N[(N[(N[(Vef + Ev), $MachinePrecision] + EAccept), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NdChar / N[(N[Exp[N[(N[(EDonor + N[(Vef - Ec), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := \frac{NaChar}{e^{\frac{\left(Ev + EAccept\right) - mu}{KbT}} + 1} + \frac{NdChar}{e^{\frac{EDonor + \left(mu - Ec\right)}{KbT}} + 1}\\
                    \mathbf{if}\;mu \leq -1.18 \cdot 10^{+116}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;mu \leq 5.4 \cdot 10^{+122}:\\
                    \;\;\;\;\frac{NaChar}{e^{\frac{\left(Vef + Ev\right) + EAccept}{KbT}} + 1} + \frac{NdChar}{e^{\frac{EDonor + \left(Vef - Ec\right)}{KbT}} + 1}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if mu < -1.1799999999999999e116 or 5.3999999999999997e122 < mu

                      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. lower-+.f64N/A

                          \[\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}}}} \]
                        2. lower-/.f64N/A

                          \[\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}}} \]
                        3. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

                      if -1.1799999999999999e116 < mu < 5.3999999999999997e122

                      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 mu around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 7: 85.6% accurate, 1.0× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NaChar}{e^{\frac{\left(Ev + EAccept\right) + \left(Vef - mu\right)}{KbT}} + 1}\\ \mathbf{if}\;mu \leq -2.65 \cdot 10^{+162}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;mu \leq 9.6 \cdot 10^{+169}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{\left(Vef + Ev\right) + EAccept}{KbT}} + 1} + \frac{NdChar}{e^{\frac{EDonor + \left(Vef - Ec\right)}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                     :precision binary64
                     (let* ((t_0 (/ NaChar (+ (exp (/ (+ (+ Ev EAccept) (- Vef mu)) KbT)) 1.0))))
                       (if (<= mu -2.65e+162)
                         t_0
                         (if (<= mu 9.6e+169)
                           (+
                            (/ NaChar (+ (exp (/ (+ (+ Vef Ev) EAccept) KbT)) 1.0))
                            (/ NdChar (+ (exp (/ (+ EDonor (- Vef Ec)) KbT)) 1.0)))
                           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 / (exp((((Ev + EAccept) + (Vef - mu)) / KbT)) + 1.0);
                    	double tmp;
                    	if (mu <= -2.65e+162) {
                    		tmp = t_0;
                    	} else if (mu <= 9.6e+169) {
                    		tmp = (NaChar / (exp((((Vef + Ev) + EAccept) / KbT)) + 1.0)) + (NdChar / (exp(((EDonor + (Vef - Ec)) / KbT)) + 1.0));
                    	} 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 / (exp((((ev + eaccept) + (vef - mu)) / kbt)) + 1.0d0)
                        if (mu <= (-2.65d+162)) then
                            tmp = t_0
                        else if (mu <= 9.6d+169) then
                            tmp = (nachar / (exp((((vef + ev) + eaccept) / kbt)) + 1.0d0)) + (ndchar / (exp(((edonor + (vef - ec)) / kbt)) + 1.0d0))
                        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 / (Math.exp((((Ev + EAccept) + (Vef - mu)) / KbT)) + 1.0);
                    	double tmp;
                    	if (mu <= -2.65e+162) {
                    		tmp = t_0;
                    	} else if (mu <= 9.6e+169) {
                    		tmp = (NaChar / (Math.exp((((Vef + Ev) + EAccept) / KbT)) + 1.0)) + (NdChar / (Math.exp(((EDonor + (Vef - Ec)) / KbT)) + 1.0));
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                    	t_0 = NaChar / (math.exp((((Ev + EAccept) + (Vef - mu)) / KbT)) + 1.0)
                    	tmp = 0
                    	if mu <= -2.65e+162:
                    		tmp = t_0
                    	elif mu <= 9.6e+169:
                    		tmp = (NaChar / (math.exp((((Vef + Ev) + EAccept) / KbT)) + 1.0)) + (NdChar / (math.exp(((EDonor + (Vef - Ec)) / KbT)) + 1.0))
                    	else:
                    		tmp = t_0
                    	return tmp
                    
                    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                    	t_0 = Float64(NaChar / Float64(exp(Float64(Float64(Float64(Ev + EAccept) + Float64(Vef - mu)) / KbT)) + 1.0))
                    	tmp = 0.0
                    	if (mu <= -2.65e+162)
                    		tmp = t_0;
                    	elseif (mu <= 9.6e+169)
                    		tmp = Float64(Float64(NaChar / Float64(exp(Float64(Float64(Float64(Vef + Ev) + EAccept) / KbT)) + 1.0)) + Float64(NdChar / Float64(exp(Float64(Float64(EDonor + Float64(Vef - Ec)) / KbT)) + 1.0)));
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                    	t_0 = NaChar / (exp((((Ev + EAccept) + (Vef - mu)) / KbT)) + 1.0);
                    	tmp = 0.0;
                    	if (mu <= -2.65e+162)
                    		tmp = t_0;
                    	elseif (mu <= 9.6e+169)
                    		tmp = (NaChar / (exp((((Vef + Ev) + EAccept) / KbT)) + 1.0)) + (NdChar / (exp(((EDonor + (Vef - Ec)) / KbT)) + 1.0));
                    	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[(N[Exp[N[(N[(N[(Ev + EAccept), $MachinePrecision] + N[(Vef - mu), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[mu, -2.65e+162], t$95$0, If[LessEqual[mu, 9.6e+169], N[(N[(NaChar / N[(N[Exp[N[(N[(N[(Vef + Ev), $MachinePrecision] + EAccept), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NdChar / N[(N[Exp[N[(N[(EDonor + N[(Vef - Ec), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := \frac{NaChar}{e^{\frac{\left(Ev + EAccept\right) + \left(Vef - mu\right)}{KbT}} + 1}\\
                    \mathbf{if}\;mu \leq -2.65 \cdot 10^{+162}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;mu \leq 9.6 \cdot 10^{+169}:\\
                    \;\;\;\;\frac{NaChar}{e^{\frac{\left(Vef + Ev\right) + EAccept}{KbT}} + 1} + \frac{NdChar}{e^{\frac{EDonor + \left(Vef - Ec\right)}{KbT}} + 1}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 2 regimes
                    2. if mu < -2.6500000000000001e162 or 9.5999999999999994e169 < mu

                      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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -2.6500000000000001e162 < mu < 9.5999999999999994e169

                      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 mu around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 8: 61.1% accurate, 1.8× speedup?

                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NaChar}{e^{\frac{\left(Ev + EAccept\right) + \left(Vef - mu\right)}{KbT}} + 1}\\ \mathbf{if}\;NaChar \leq -2.4 \cdot 10^{-214}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;NaChar \leq 1.7 \cdot 10^{-252}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{elif}\;NaChar \leq 3.2 \cdot 10^{-166}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Ec}{-KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                     :precision binary64
                     (let* ((t_0 (/ NaChar (+ (exp (/ (+ (+ Ev EAccept) (- Vef mu)) KbT)) 1.0))))
                       (if (<= NaChar -2.4e-214)
                         t_0
                         (if (<= NaChar 1.7e-252)
                           (/ NdChar (+ (exp (/ EDonor KbT)) 1.0))
                           (if (<= NaChar 3.2e-166)
                             (/ NdChar (+ (exp (/ Ec (- KbT))) 1.0))
                             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 / (exp((((Ev + EAccept) + (Vef - mu)) / KbT)) + 1.0);
                    	double tmp;
                    	if (NaChar <= -2.4e-214) {
                    		tmp = t_0;
                    	} else if (NaChar <= 1.7e-252) {
                    		tmp = NdChar / (exp((EDonor / KbT)) + 1.0);
                    	} else if (NaChar <= 3.2e-166) {
                    		tmp = NdChar / (exp((Ec / -KbT)) + 1.0);
                    	} 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 / (exp((((ev + eaccept) + (vef - mu)) / kbt)) + 1.0d0)
                        if (nachar <= (-2.4d-214)) then
                            tmp = t_0
                        else if (nachar <= 1.7d-252) then
                            tmp = ndchar / (exp((edonor / kbt)) + 1.0d0)
                        else if (nachar <= 3.2d-166) then
                            tmp = ndchar / (exp((ec / -kbt)) + 1.0d0)
                        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 / (Math.exp((((Ev + EAccept) + (Vef - mu)) / KbT)) + 1.0);
                    	double tmp;
                    	if (NaChar <= -2.4e-214) {
                    		tmp = t_0;
                    	} else if (NaChar <= 1.7e-252) {
                    		tmp = NdChar / (Math.exp((EDonor / KbT)) + 1.0);
                    	} else if (NaChar <= 3.2e-166) {
                    		tmp = NdChar / (Math.exp((Ec / -KbT)) + 1.0);
                    	} else {
                    		tmp = t_0;
                    	}
                    	return tmp;
                    }
                    
                    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                    	t_0 = NaChar / (math.exp((((Ev + EAccept) + (Vef - mu)) / KbT)) + 1.0)
                    	tmp = 0
                    	if NaChar <= -2.4e-214:
                    		tmp = t_0
                    	elif NaChar <= 1.7e-252:
                    		tmp = NdChar / (math.exp((EDonor / KbT)) + 1.0)
                    	elif NaChar <= 3.2e-166:
                    		tmp = NdChar / (math.exp((Ec / -KbT)) + 1.0)
                    	else:
                    		tmp = t_0
                    	return tmp
                    
                    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                    	t_0 = Float64(NaChar / Float64(exp(Float64(Float64(Float64(Ev + EAccept) + Float64(Vef - mu)) / KbT)) + 1.0))
                    	tmp = 0.0
                    	if (NaChar <= -2.4e-214)
                    		tmp = t_0;
                    	elseif (NaChar <= 1.7e-252)
                    		tmp = Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) + 1.0));
                    	elseif (NaChar <= 3.2e-166)
                    		tmp = Float64(NdChar / Float64(exp(Float64(Ec / Float64(-KbT))) + 1.0));
                    	else
                    		tmp = t_0;
                    	end
                    	return tmp
                    end
                    
                    function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                    	t_0 = NaChar / (exp((((Ev + EAccept) + (Vef - mu)) / KbT)) + 1.0);
                    	tmp = 0.0;
                    	if (NaChar <= -2.4e-214)
                    		tmp = t_0;
                    	elseif (NaChar <= 1.7e-252)
                    		tmp = NdChar / (exp((EDonor / KbT)) + 1.0);
                    	elseif (NaChar <= 3.2e-166)
                    		tmp = NdChar / (exp((Ec / -KbT)) + 1.0);
                    	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[(N[Exp[N[(N[(N[(Ev + EAccept), $MachinePrecision] + N[(Vef - mu), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NaChar, -2.4e-214], t$95$0, If[LessEqual[NaChar, 1.7e-252], N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[NaChar, 3.2e-166], N[(NdChar / N[(N[Exp[N[(Ec / (-KbT)), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
                    
                    \begin{array}{l}
                    
                    \\
                    \begin{array}{l}
                    t_0 := \frac{NaChar}{e^{\frac{\left(Ev + EAccept\right) + \left(Vef - mu\right)}{KbT}} + 1}\\
                    \mathbf{if}\;NaChar \leq -2.4 \cdot 10^{-214}:\\
                    \;\;\;\;t\_0\\
                    
                    \mathbf{elif}\;NaChar \leq 1.7 \cdot 10^{-252}:\\
                    \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\
                    
                    \mathbf{elif}\;NaChar \leq 3.2 \cdot 10^{-166}:\\
                    \;\;\;\;\frac{NdChar}{e^{\frac{Ec}{-KbT}} + 1}\\
                    
                    \mathbf{else}:\\
                    \;\;\;\;t\_0\\
                    
                    
                    \end{array}
                    \end{array}
                    
                    Derivation
                    1. Split input into 3 regimes
                    2. if NaChar < -2.4000000000000002e-214 or 3.20000000000000001e-166 < 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if -2.4000000000000002e-214 < NaChar < 1.7e-252

                      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 inf

                        \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                      4. 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} \]
                      7. Step-by-step derivation
                        1. Applied rewrites62.1%

                          \[\leadsto \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} \]

                        if 1.7e-252 < NaChar < 3.20000000000000001e-166

                        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 NdChar around inf

                          \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                        4. 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \frac{NdChar}{1 + e^{-1 \cdot \frac{Ec}{KbT}}} \]
                        7. Step-by-step derivation
                          1. Applied rewrites71.9%

                            \[\leadsto \frac{NdChar}{1 + e^{\frac{-Ec}{KbT}}} \]
                        8. Recombined 3 regimes into one program.
                        9. Final simplification69.0%

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

                        Alternative 9: 41.6% accurate, 1.8× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NdChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{if}\;Vef \leq -3.55 \cdot 10^{+19}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;Vef \leq -1.52 \cdot 10^{-226}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;Vef \leq 9.8 \cdot 10^{-289}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{elif}\;Vef \leq 8.5 \cdot 10^{+25}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Ec}{-KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                        (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                         :precision binary64
                         (let* ((t_0 (/ NdChar (+ (exp (/ Vef KbT)) 1.0))))
                           (if (<= Vef -3.55e+19)
                             t_0
                             (if (<= Vef -1.52e-226)
                               (* 0.5 (+ NdChar NaChar))
                               (if (<= Vef 9.8e-289)
                                 (/ NdChar (+ (exp (/ EDonor KbT)) 1.0))
                                 (if (<= Vef 8.5e+25) (/ NdChar (+ (exp (/ Ec (- KbT))) 1.0)) 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 / (exp((Vef / KbT)) + 1.0);
                        	double tmp;
                        	if (Vef <= -3.55e+19) {
                        		tmp = t_0;
                        	} else if (Vef <= -1.52e-226) {
                        		tmp = 0.5 * (NdChar + NaChar);
                        	} else if (Vef <= 9.8e-289) {
                        		tmp = NdChar / (exp((EDonor / KbT)) + 1.0);
                        	} else if (Vef <= 8.5e+25) {
                        		tmp = NdChar / (exp((Ec / -KbT)) + 1.0);
                        	} 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 = ndchar / (exp((vef / kbt)) + 1.0d0)
                            if (vef <= (-3.55d+19)) then
                                tmp = t_0
                            else if (vef <= (-1.52d-226)) then
                                tmp = 0.5d0 * (ndchar + nachar)
                            else if (vef <= 9.8d-289) then
                                tmp = ndchar / (exp((edonor / kbt)) + 1.0d0)
                            else if (vef <= 8.5d+25) then
                                tmp = ndchar / (exp((ec / -kbt)) + 1.0d0)
                            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 = NdChar / (Math.exp((Vef / KbT)) + 1.0);
                        	double tmp;
                        	if (Vef <= -3.55e+19) {
                        		tmp = t_0;
                        	} else if (Vef <= -1.52e-226) {
                        		tmp = 0.5 * (NdChar + NaChar);
                        	} else if (Vef <= 9.8e-289) {
                        		tmp = NdChar / (Math.exp((EDonor / KbT)) + 1.0);
                        	} else if (Vef <= 8.5e+25) {
                        		tmp = NdChar / (Math.exp((Ec / -KbT)) + 1.0);
                        	} else {
                        		tmp = t_0;
                        	}
                        	return tmp;
                        }
                        
                        def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                        	t_0 = NdChar / (math.exp((Vef / KbT)) + 1.0)
                        	tmp = 0
                        	if Vef <= -3.55e+19:
                        		tmp = t_0
                        	elif Vef <= -1.52e-226:
                        		tmp = 0.5 * (NdChar + NaChar)
                        	elif Vef <= 9.8e-289:
                        		tmp = NdChar / (math.exp((EDonor / KbT)) + 1.0)
                        	elif Vef <= 8.5e+25:
                        		tmp = NdChar / (math.exp((Ec / -KbT)) + 1.0)
                        	else:
                        		tmp = t_0
                        	return tmp
                        
                        function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                        	t_0 = Float64(NdChar / Float64(exp(Float64(Vef / KbT)) + 1.0))
                        	tmp = 0.0
                        	if (Vef <= -3.55e+19)
                        		tmp = t_0;
                        	elseif (Vef <= -1.52e-226)
                        		tmp = Float64(0.5 * Float64(NdChar + NaChar));
                        	elseif (Vef <= 9.8e-289)
                        		tmp = Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) + 1.0));
                        	elseif (Vef <= 8.5e+25)
                        		tmp = Float64(NdChar / Float64(exp(Float64(Ec / Float64(-KbT))) + 1.0));
                        	else
                        		tmp = t_0;
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                        	t_0 = NdChar / (exp((Vef / KbT)) + 1.0);
                        	tmp = 0.0;
                        	if (Vef <= -3.55e+19)
                        		tmp = t_0;
                        	elseif (Vef <= -1.52e-226)
                        		tmp = 0.5 * (NdChar + NaChar);
                        	elseif (Vef <= 9.8e-289)
                        		tmp = NdChar / (exp((EDonor / KbT)) + 1.0);
                        	elseif (Vef <= 8.5e+25)
                        		tmp = NdChar / (exp((Ec / -KbT)) + 1.0);
                        	else
                        		tmp = t_0;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Vef, -3.55e+19], t$95$0, If[LessEqual[Vef, -1.52e-226], N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision], If[LessEqual[Vef, 9.8e-289], N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[Vef, 8.5e+25], N[(NdChar / N[(N[Exp[N[(Ec / (-KbT)), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := \frac{NdChar}{e^{\frac{Vef}{KbT}} + 1}\\
                        \mathbf{if}\;Vef \leq -3.55 \cdot 10^{+19}:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{elif}\;Vef \leq -1.52 \cdot 10^{-226}:\\
                        \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\
                        
                        \mathbf{elif}\;Vef \leq 9.8 \cdot 10^{-289}:\\
                        \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\
                        
                        \mathbf{elif}\;Vef \leq 8.5 \cdot 10^{+25}:\\
                        \;\;\;\;\frac{NdChar}{e^{\frac{Ec}{-KbT}} + 1}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_0\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 4 regimes
                        2. if Vef < -3.55e19 or 8.5000000000000007e25 < 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 NdChar around inf

                            \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                          4. 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{NdChar}{1 + e^{\frac{Vef}{KbT}}} \]
                          7. Step-by-step derivation
                            1. Applied rewrites56.5%

                              \[\leadsto \frac{NdChar}{1 + e^{\frac{Vef}{KbT}}} \]

                            if -3.55e19 < Vef < -1.52000000000000004e-226

                            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. distribute-lft-outN/A

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

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

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

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

                            if -1.52000000000000004e-226 < Vef < 9.80000000000000016e-289

                            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 inf

                              \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                            4. 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} \]
                            7. Step-by-step derivation
                              1. Applied rewrites57.9%

                                \[\leadsto \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} \]

                              if 9.80000000000000016e-289 < Vef < 8.5000000000000007e25

                              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 inf

                                \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                              4. 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{NdChar}{1 + e^{-1 \cdot \frac{Ec}{KbT}}} \]
                              7. Step-by-step derivation
                                1. Applied rewrites45.3%

                                  \[\leadsto \frac{NdChar}{1 + e^{\frac{-Ec}{KbT}}} \]
                              8. Recombined 4 regimes into one program.
                              9. Final simplification49.6%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;Vef \leq -3.55 \cdot 10^{+19}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{elif}\;Vef \leq -1.52 \cdot 10^{-226}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;Vef \leq 9.8 \cdot 10^{-289}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{elif}\;Vef \leq 8.5 \cdot 10^{+25}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Ec}{-KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} + 1}\\ \end{array} \]
                              10. Add Preprocessing

                              Alternative 10: 54.6% accurate, 1.8× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;NaChar \leq -2.55 \cdot 10^{-214}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{\left(Ev + EAccept\right) - mu}{KbT}} + 1}\\ \mathbf{elif}\;NaChar \leq 1.7 \cdot 10^{-252}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{elif}\;NaChar \leq 2 \cdot 10^{-139}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Ec}{-KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Ev + \left(Vef + EAccept\right)}{KbT}} + 1}\\ \end{array} \end{array} \]
                              (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                               :precision binary64
                               (if (<= NaChar -2.55e-214)
                                 (/ NaChar (+ (exp (/ (- (+ Ev EAccept) mu) KbT)) 1.0))
                                 (if (<= NaChar 1.7e-252)
                                   (/ NdChar (+ (exp (/ EDonor KbT)) 1.0))
                                   (if (<= NaChar 2e-139)
                                     (/ NdChar (+ (exp (/ Ec (- KbT))) 1.0))
                                     (/ NaChar (+ (exp (/ (+ Ev (+ Vef EAccept)) KbT)) 1.0))))))
                              double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                              	double tmp;
                              	if (NaChar <= -2.55e-214) {
                              		tmp = NaChar / (exp((((Ev + EAccept) - mu) / KbT)) + 1.0);
                              	} else if (NaChar <= 1.7e-252) {
                              		tmp = NdChar / (exp((EDonor / KbT)) + 1.0);
                              	} else if (NaChar <= 2e-139) {
                              		tmp = NdChar / (exp((Ec / -KbT)) + 1.0);
                              	} else {
                              		tmp = NaChar / (exp(((Ev + (Vef + EAccept)) / KbT)) + 1.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) :: tmp
                                  if (nachar <= (-2.55d-214)) then
                                      tmp = nachar / (exp((((ev + eaccept) - mu) / kbt)) + 1.0d0)
                                  else if (nachar <= 1.7d-252) then
                                      tmp = ndchar / (exp((edonor / kbt)) + 1.0d0)
                                  else if (nachar <= 2d-139) then
                                      tmp = ndchar / (exp((ec / -kbt)) + 1.0d0)
                                  else
                                      tmp = nachar / (exp(((ev + (vef + eaccept)) / kbt)) + 1.0d0)
                                  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 <= -2.55e-214) {
                              		tmp = NaChar / (Math.exp((((Ev + EAccept) - mu) / KbT)) + 1.0);
                              	} else if (NaChar <= 1.7e-252) {
                              		tmp = NdChar / (Math.exp((EDonor / KbT)) + 1.0);
                              	} else if (NaChar <= 2e-139) {
                              		tmp = NdChar / (Math.exp((Ec / -KbT)) + 1.0);
                              	} else {
                              		tmp = NaChar / (Math.exp(((Ev + (Vef + EAccept)) / KbT)) + 1.0);
                              	}
                              	return tmp;
                              }
                              
                              def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                              	tmp = 0
                              	if NaChar <= -2.55e-214:
                              		tmp = NaChar / (math.exp((((Ev + EAccept) - mu) / KbT)) + 1.0)
                              	elif NaChar <= 1.7e-252:
                              		tmp = NdChar / (math.exp((EDonor / KbT)) + 1.0)
                              	elif NaChar <= 2e-139:
                              		tmp = NdChar / (math.exp((Ec / -KbT)) + 1.0)
                              	else:
                              		tmp = NaChar / (math.exp(((Ev + (Vef + EAccept)) / KbT)) + 1.0)
                              	return tmp
                              
                              function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                              	tmp = 0.0
                              	if (NaChar <= -2.55e-214)
                              		tmp = Float64(NaChar / Float64(exp(Float64(Float64(Float64(Ev + EAccept) - mu) / KbT)) + 1.0));
                              	elseif (NaChar <= 1.7e-252)
                              		tmp = Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) + 1.0));
                              	elseif (NaChar <= 2e-139)
                              		tmp = Float64(NdChar / Float64(exp(Float64(Ec / Float64(-KbT))) + 1.0));
                              	else
                              		tmp = Float64(NaChar / Float64(exp(Float64(Float64(Ev + Float64(Vef + EAccept)) / KbT)) + 1.0));
                              	end
                              	return tmp
                              end
                              
                              function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                              	tmp = 0.0;
                              	if (NaChar <= -2.55e-214)
                              		tmp = NaChar / (exp((((Ev + EAccept) - mu) / KbT)) + 1.0);
                              	elseif (NaChar <= 1.7e-252)
                              		tmp = NdChar / (exp((EDonor / KbT)) + 1.0);
                              	elseif (NaChar <= 2e-139)
                              		tmp = NdChar / (exp((Ec / -KbT)) + 1.0);
                              	else
                              		tmp = NaChar / (exp(((Ev + (Vef + EAccept)) / KbT)) + 1.0);
                              	end
                              	tmp_2 = tmp;
                              end
                              
                              code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[NaChar, -2.55e-214], N[(NaChar / N[(N[Exp[N[(N[(N[(Ev + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[NaChar, 1.7e-252], N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[NaChar, 2e-139], N[(NdChar / N[(N[Exp[N[(Ec / (-KbT)), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(NaChar / N[(N[Exp[N[(N[(Ev + N[(Vef + EAccept), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              \mathbf{if}\;NaChar \leq -2.55 \cdot 10^{-214}:\\
                              \;\;\;\;\frac{NaChar}{e^{\frac{\left(Ev + EAccept\right) - mu}{KbT}} + 1}\\
                              
                              \mathbf{elif}\;NaChar \leq 1.7 \cdot 10^{-252}:\\
                              \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\
                              
                              \mathbf{elif}\;NaChar \leq 2 \cdot 10^{-139}:\\
                              \;\;\;\;\frac{NdChar}{e^{\frac{Ec}{-KbT}} + 1}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\frac{NaChar}{e^{\frac{Ev + \left(Vef + EAccept\right)}{KbT}} + 1}\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 4 regimes
                              2. if NaChar < -2.54999999999999993e-214

                                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 mu around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Vef + Ev\right)}{KbT}}} + \frac{NdChar}{1 + e^{\frac{EDonor + \left(Vef - Ec\right)}{KbT}}}} \]
                                6. 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}}}} \]
                                7. Step-by-step derivation
                                  1. lower-+.f64N/A

                                    \[\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}}}} \]
                                  2. lower-/.f64N/A

                                    \[\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}}} \]
                                  3. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{NaChar}{\color{blue}{1 + e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}}} \]
                                10. Step-by-step derivation
                                  1. Applied rewrites63.1%

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

                                  if -2.54999999999999993e-214 < NaChar < 1.7e-252

                                  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 inf

                                    \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                                  4. 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} \]
                                  7. Step-by-step derivation
                                    1. Applied rewrites62.1%

                                      \[\leadsto \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} \]

                                    if 1.7e-252 < NaChar < 2.00000000000000006e-139

                                    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 NdChar around inf

                                      \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                                    4. 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{NdChar}{1 + e^{-1 \cdot \frac{Ec}{KbT}}} \]
                                    7. Step-by-step derivation
                                      1. Applied rewrites67.9%

                                        \[\leadsto \frac{NdChar}{1 + e^{\frac{-Ec}{KbT}}} \]

                                      if 2.00000000000000006e-139 < 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 mu around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        \[\leadsto \frac{NaChar}{\color{blue}{1 + e^{\frac{EAccept + \left(Ev + Vef\right)}{KbT}}}} \]
                                      7. Step-by-step derivation
                                        1. Applied rewrites62.4%

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

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

                                      Alternative 11: 55.8% accurate, 1.8× speedup?

                                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NaChar}{e^{\frac{Ev + \left(Vef + EAccept\right)}{KbT}} + 1}\\ \mathbf{if}\;NaChar \leq -1 \cdot 10^{-213}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;NaChar \leq 1.7 \cdot 10^{-252}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{elif}\;NaChar \leq 2 \cdot 10^{-139}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Ec}{-KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                      (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                       :precision binary64
                                       (let* ((t_0 (/ NaChar (+ (exp (/ (+ Ev (+ Vef EAccept)) KbT)) 1.0))))
                                         (if (<= NaChar -1e-213)
                                           t_0
                                           (if (<= NaChar 1.7e-252)
                                             (/ NdChar (+ (exp (/ EDonor KbT)) 1.0))
                                             (if (<= NaChar 2e-139) (/ NdChar (+ (exp (/ Ec (- KbT))) 1.0)) 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 / (exp(((Ev + (Vef + EAccept)) / KbT)) + 1.0);
                                      	double tmp;
                                      	if (NaChar <= -1e-213) {
                                      		tmp = t_0;
                                      	} else if (NaChar <= 1.7e-252) {
                                      		tmp = NdChar / (exp((EDonor / KbT)) + 1.0);
                                      	} else if (NaChar <= 2e-139) {
                                      		tmp = NdChar / (exp((Ec / -KbT)) + 1.0);
                                      	} 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 / (exp(((ev + (vef + eaccept)) / kbt)) + 1.0d0)
                                          if (nachar <= (-1d-213)) then
                                              tmp = t_0
                                          else if (nachar <= 1.7d-252) then
                                              tmp = ndchar / (exp((edonor / kbt)) + 1.0d0)
                                          else if (nachar <= 2d-139) then
                                              tmp = ndchar / (exp((ec / -kbt)) + 1.0d0)
                                          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 / (Math.exp(((Ev + (Vef + EAccept)) / KbT)) + 1.0);
                                      	double tmp;
                                      	if (NaChar <= -1e-213) {
                                      		tmp = t_0;
                                      	} else if (NaChar <= 1.7e-252) {
                                      		tmp = NdChar / (Math.exp((EDonor / KbT)) + 1.0);
                                      	} else if (NaChar <= 2e-139) {
                                      		tmp = NdChar / (Math.exp((Ec / -KbT)) + 1.0);
                                      	} else {
                                      		tmp = t_0;
                                      	}
                                      	return tmp;
                                      }
                                      
                                      def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                      	t_0 = NaChar / (math.exp(((Ev + (Vef + EAccept)) / KbT)) + 1.0)
                                      	tmp = 0
                                      	if NaChar <= -1e-213:
                                      		tmp = t_0
                                      	elif NaChar <= 1.7e-252:
                                      		tmp = NdChar / (math.exp((EDonor / KbT)) + 1.0)
                                      	elif NaChar <= 2e-139:
                                      		tmp = NdChar / (math.exp((Ec / -KbT)) + 1.0)
                                      	else:
                                      		tmp = t_0
                                      	return tmp
                                      
                                      function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                      	t_0 = Float64(NaChar / Float64(exp(Float64(Float64(Ev + Float64(Vef + EAccept)) / KbT)) + 1.0))
                                      	tmp = 0.0
                                      	if (NaChar <= -1e-213)
                                      		tmp = t_0;
                                      	elseif (NaChar <= 1.7e-252)
                                      		tmp = Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) + 1.0));
                                      	elseif (NaChar <= 2e-139)
                                      		tmp = Float64(NdChar / Float64(exp(Float64(Ec / Float64(-KbT))) + 1.0));
                                      	else
                                      		tmp = t_0;
                                      	end
                                      	return tmp
                                      end
                                      
                                      function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                      	t_0 = NaChar / (exp(((Ev + (Vef + EAccept)) / KbT)) + 1.0);
                                      	tmp = 0.0;
                                      	if (NaChar <= -1e-213)
                                      		tmp = t_0;
                                      	elseif (NaChar <= 1.7e-252)
                                      		tmp = NdChar / (exp((EDonor / KbT)) + 1.0);
                                      	elseif (NaChar <= 2e-139)
                                      		tmp = NdChar / (exp((Ec / -KbT)) + 1.0);
                                      	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[(N[Exp[N[(N[(Ev + N[(Vef + EAccept), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NaChar, -1e-213], t$95$0, If[LessEqual[NaChar, 1.7e-252], N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[NaChar, 2e-139], N[(NdChar / N[(N[Exp[N[(Ec / (-KbT)), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
                                      
                                      \begin{array}{l}
                                      
                                      \\
                                      \begin{array}{l}
                                      t_0 := \frac{NaChar}{e^{\frac{Ev + \left(Vef + EAccept\right)}{KbT}} + 1}\\
                                      \mathbf{if}\;NaChar \leq -1 \cdot 10^{-213}:\\
                                      \;\;\;\;t\_0\\
                                      
                                      \mathbf{elif}\;NaChar \leq 1.7 \cdot 10^{-252}:\\
                                      \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\
                                      
                                      \mathbf{elif}\;NaChar \leq 2 \cdot 10^{-139}:\\
                                      \;\;\;\;\frac{NdChar}{e^{\frac{Ec}{-KbT}} + 1}\\
                                      
                                      \mathbf{else}:\\
                                      \;\;\;\;t\_0\\
                                      
                                      
                                      \end{array}
                                      \end{array}
                                      
                                      Derivation
                                      1. Split input into 3 regimes
                                      2. if NaChar < -9.9999999999999995e-214 or 2.00000000000000006e-139 < 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 mu around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \frac{NaChar}{\color{blue}{1 + e^{\frac{EAccept + \left(Ev + Vef\right)}{KbT}}}} \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites62.0%

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

                                          if -9.9999999999999995e-214 < NaChar < 1.7e-252

                                          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 inf

                                            \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                                          4. 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} \]
                                          7. Step-by-step derivation
                                            1. Applied rewrites62.1%

                                              \[\leadsto \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} \]

                                            if 1.7e-252 < NaChar < 2.00000000000000006e-139

                                            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 NdChar around inf

                                              \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                                            4. 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              \[\leadsto \frac{NdChar}{1 + e^{-1 \cdot \frac{Ec}{KbT}}} \]
                                            7. Step-by-step derivation
                                              1. Applied rewrites67.9%

                                                \[\leadsto \frac{NdChar}{1 + e^{\frac{-Ec}{KbT}}} \]
                                            8. Recombined 3 regimes into one program.
                                            9. Final simplification62.6%

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

                                            Alternative 12: 69.1% accurate, 1.9× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NaChar}{e^{\frac{\left(Ev + EAccept\right) + \left(Vef - mu\right)}{KbT}} + 1}\\ \mathbf{if}\;NaChar \leq -1.6 \cdot 10^{-29}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;NaChar \leq 0.32:\\ \;\;\;\;\frac{NdChar}{e^{\frac{\left(mu - Ec\right) + \left(Vef + EDonor\right)}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                            (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                             :precision binary64
                                             (let* ((t_0 (/ NaChar (+ (exp (/ (+ (+ Ev EAccept) (- Vef mu)) KbT)) 1.0))))
                                               (if (<= NaChar -1.6e-29)
                                                 t_0
                                                 (if (<= NaChar 0.32)
                                                   (/ NdChar (+ (exp (/ (+ (- mu Ec) (+ Vef EDonor)) KbT)) 1.0))
                                                   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 / (exp((((Ev + EAccept) + (Vef - mu)) / KbT)) + 1.0);
                                            	double tmp;
                                            	if (NaChar <= -1.6e-29) {
                                            		tmp = t_0;
                                            	} else if (NaChar <= 0.32) {
                                            		tmp = NdChar / (exp((((mu - Ec) + (Vef + EDonor)) / KbT)) + 1.0);
                                            	} 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 / (exp((((ev + eaccept) + (vef - mu)) / kbt)) + 1.0d0)
                                                if (nachar <= (-1.6d-29)) then
                                                    tmp = t_0
                                                else if (nachar <= 0.32d0) then
                                                    tmp = ndchar / (exp((((mu - ec) + (vef + edonor)) / kbt)) + 1.0d0)
                                                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 / (Math.exp((((Ev + EAccept) + (Vef - mu)) / KbT)) + 1.0);
                                            	double tmp;
                                            	if (NaChar <= -1.6e-29) {
                                            		tmp = t_0;
                                            	} else if (NaChar <= 0.32) {
                                            		tmp = NdChar / (Math.exp((((mu - Ec) + (Vef + EDonor)) / KbT)) + 1.0);
                                            	} else {
                                            		tmp = t_0;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                            	t_0 = NaChar / (math.exp((((Ev + EAccept) + (Vef - mu)) / KbT)) + 1.0)
                                            	tmp = 0
                                            	if NaChar <= -1.6e-29:
                                            		tmp = t_0
                                            	elif NaChar <= 0.32:
                                            		tmp = NdChar / (math.exp((((mu - Ec) + (Vef + EDonor)) / KbT)) + 1.0)
                                            	else:
                                            		tmp = t_0
                                            	return tmp
                                            
                                            function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                            	t_0 = Float64(NaChar / Float64(exp(Float64(Float64(Float64(Ev + EAccept) + Float64(Vef - mu)) / KbT)) + 1.0))
                                            	tmp = 0.0
                                            	if (NaChar <= -1.6e-29)
                                            		tmp = t_0;
                                            	elseif (NaChar <= 0.32)
                                            		tmp = Float64(NdChar / Float64(exp(Float64(Float64(Float64(mu - Ec) + Float64(Vef + EDonor)) / KbT)) + 1.0));
                                            	else
                                            		tmp = t_0;
                                            	end
                                            	return tmp
                                            end
                                            
                                            function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                            	t_0 = NaChar / (exp((((Ev + EAccept) + (Vef - mu)) / KbT)) + 1.0);
                                            	tmp = 0.0;
                                            	if (NaChar <= -1.6e-29)
                                            		tmp = t_0;
                                            	elseif (NaChar <= 0.32)
                                            		tmp = NdChar / (exp((((mu - Ec) + (Vef + EDonor)) / KbT)) + 1.0);
                                            	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[(N[Exp[N[(N[(N[(Ev + EAccept), $MachinePrecision] + N[(Vef - mu), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NaChar, -1.6e-29], t$95$0, If[LessEqual[NaChar, 0.32], N[(NdChar / N[(N[Exp[N[(N[(N[(mu - Ec), $MachinePrecision] + N[(Vef + EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            t_0 := \frac{NaChar}{e^{\frac{\left(Ev + EAccept\right) + \left(Vef - mu\right)}{KbT}} + 1}\\
                                            \mathbf{if}\;NaChar \leq -1.6 \cdot 10^{-29}:\\
                                            \;\;\;\;t\_0\\
                                            
                                            \mathbf{elif}\;NaChar \leq 0.32:\\
                                            \;\;\;\;\frac{NdChar}{e^{\frac{\left(mu - Ec\right) + \left(Vef + EDonor\right)}{KbT}} + 1}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;t\_0\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if NaChar < -1.6e-29 or 0.320000000000000007 < 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              if -1.6e-29 < NaChar < 0.320000000000000007

                                              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 inf

                                                \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                                              4. 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            Alternative 13: 41.8% accurate, 1.9× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NdChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{if}\;Vef \leq -3.55 \cdot 10^{+19}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;Vef \leq -1.52 \cdot 10^{-226}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;Vef \leq 3.7 \cdot 10^{+26}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                            (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                             :precision binary64
                                             (let* ((t_0 (/ NdChar (+ (exp (/ Vef KbT)) 1.0))))
                                               (if (<= Vef -3.55e+19)
                                                 t_0
                                                 (if (<= Vef -1.52e-226)
                                                   (* 0.5 (+ NdChar NaChar))
                                                   (if (<= Vef 3.7e+26) (/ NdChar (+ (exp (/ EDonor KbT)) 1.0)) 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 / (exp((Vef / KbT)) + 1.0);
                                            	double tmp;
                                            	if (Vef <= -3.55e+19) {
                                            		tmp = t_0;
                                            	} else if (Vef <= -1.52e-226) {
                                            		tmp = 0.5 * (NdChar + NaChar);
                                            	} else if (Vef <= 3.7e+26) {
                                            		tmp = NdChar / (exp((EDonor / KbT)) + 1.0);
                                            	} 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 = ndchar / (exp((vef / kbt)) + 1.0d0)
                                                if (vef <= (-3.55d+19)) then
                                                    tmp = t_0
                                                else if (vef <= (-1.52d-226)) then
                                                    tmp = 0.5d0 * (ndchar + nachar)
                                                else if (vef <= 3.7d+26) then
                                                    tmp = ndchar / (exp((edonor / kbt)) + 1.0d0)
                                                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 = NdChar / (Math.exp((Vef / KbT)) + 1.0);
                                            	double tmp;
                                            	if (Vef <= -3.55e+19) {
                                            		tmp = t_0;
                                            	} else if (Vef <= -1.52e-226) {
                                            		tmp = 0.5 * (NdChar + NaChar);
                                            	} else if (Vef <= 3.7e+26) {
                                            		tmp = NdChar / (Math.exp((EDonor / KbT)) + 1.0);
                                            	} else {
                                            		tmp = t_0;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                            	t_0 = NdChar / (math.exp((Vef / KbT)) + 1.0)
                                            	tmp = 0
                                            	if Vef <= -3.55e+19:
                                            		tmp = t_0
                                            	elif Vef <= -1.52e-226:
                                            		tmp = 0.5 * (NdChar + NaChar)
                                            	elif Vef <= 3.7e+26:
                                            		tmp = NdChar / (math.exp((EDonor / KbT)) + 1.0)
                                            	else:
                                            		tmp = t_0
                                            	return tmp
                                            
                                            function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                            	t_0 = Float64(NdChar / Float64(exp(Float64(Vef / KbT)) + 1.0))
                                            	tmp = 0.0
                                            	if (Vef <= -3.55e+19)
                                            		tmp = t_0;
                                            	elseif (Vef <= -1.52e-226)
                                            		tmp = Float64(0.5 * Float64(NdChar + NaChar));
                                            	elseif (Vef <= 3.7e+26)
                                            		tmp = Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) + 1.0));
                                            	else
                                            		tmp = t_0;
                                            	end
                                            	return tmp
                                            end
                                            
                                            function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                            	t_0 = NdChar / (exp((Vef / KbT)) + 1.0);
                                            	tmp = 0.0;
                                            	if (Vef <= -3.55e+19)
                                            		tmp = t_0;
                                            	elseif (Vef <= -1.52e-226)
                                            		tmp = 0.5 * (NdChar + NaChar);
                                            	elseif (Vef <= 3.7e+26)
                                            		tmp = NdChar / (exp((EDonor / KbT)) + 1.0);
                                            	else
                                            		tmp = t_0;
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Vef, -3.55e+19], t$95$0, If[LessEqual[Vef, -1.52e-226], N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision], If[LessEqual[Vef, 3.7e+26], N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            t_0 := \frac{NdChar}{e^{\frac{Vef}{KbT}} + 1}\\
                                            \mathbf{if}\;Vef \leq -3.55 \cdot 10^{+19}:\\
                                            \;\;\;\;t\_0\\
                                            
                                            \mathbf{elif}\;Vef \leq -1.52 \cdot 10^{-226}:\\
                                            \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\
                                            
                                            \mathbf{elif}\;Vef \leq 3.7 \cdot 10^{+26}:\\
                                            \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;t\_0\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 3 regimes
                                            2. if Vef < -3.55e19 or 3.69999999999999988e26 < 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 NdChar around inf

                                                \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                                              4. 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \frac{NdChar}{1 + e^{\frac{Vef}{KbT}}} \]
                                              7. Step-by-step derivation
                                                1. Applied rewrites56.5%

                                                  \[\leadsto \frac{NdChar}{1 + e^{\frac{Vef}{KbT}}} \]

                                                if -3.55e19 < Vef < -1.52000000000000004e-226

                                                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. distribute-lft-outN/A

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

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

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

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

                                                if -1.52000000000000004e-226 < Vef < 3.69999999999999988e26

                                                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 inf

                                                  \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                                                4. 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  \[\leadsto \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} \]
                                                7. Step-by-step derivation
                                                  1. Applied rewrites41.3%

                                                    \[\leadsto \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} \]
                                                8. Recombined 3 regimes into one program.
                                                9. Final simplification47.3%

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;Vef \leq -3.55 \cdot 10^{+19}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{elif}\;Vef \leq -1.52 \cdot 10^{-226}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;Vef \leq 3.7 \cdot 10^{+26}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} + 1}\\ \end{array} \]
                                                10. Add Preprocessing

                                                Alternative 14: 22.3% accurate, 15.3× speedup?

                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;NaChar \leq -8.5 \cdot 10^{-128}:\\ \;\;\;\;NaChar \cdot 0.5\\ \mathbf{elif}\;NaChar \leq 2.6 \cdot 10^{-139}:\\ \;\;\;\;NdChar \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;NaChar \cdot 0.5\\ \end{array} \end{array} \]
                                                (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                 :precision binary64
                                                 (if (<= NaChar -8.5e-128)
                                                   (* NaChar 0.5)
                                                   (if (<= NaChar 2.6e-139) (* NdChar 0.5) (* NaChar 0.5))))
                                                double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                	double tmp;
                                                	if (NaChar <= -8.5e-128) {
                                                		tmp = NaChar * 0.5;
                                                	} else if (NaChar <= 2.6e-139) {
                                                		tmp = NdChar * 0.5;
                                                	} else {
                                                		tmp = NaChar * 0.5;
                                                	}
                                                	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 <= (-8.5d-128)) then
                                                        tmp = nachar * 0.5d0
                                                    else if (nachar <= 2.6d-139) then
                                                        tmp = ndchar * 0.5d0
                                                    else
                                                        tmp = nachar * 0.5d0
                                                    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 <= -8.5e-128) {
                                                		tmp = NaChar * 0.5;
                                                	} else if (NaChar <= 2.6e-139) {
                                                		tmp = NdChar * 0.5;
                                                	} else {
                                                		tmp = NaChar * 0.5;
                                                	}
                                                	return tmp;
                                                }
                                                
                                                def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                                	tmp = 0
                                                	if NaChar <= -8.5e-128:
                                                		tmp = NaChar * 0.5
                                                	elif NaChar <= 2.6e-139:
                                                		tmp = NdChar * 0.5
                                                	else:
                                                		tmp = NaChar * 0.5
                                                	return tmp
                                                
                                                function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                	tmp = 0.0
                                                	if (NaChar <= -8.5e-128)
                                                		tmp = Float64(NaChar * 0.5);
                                                	elseif (NaChar <= 2.6e-139)
                                                		tmp = Float64(NdChar * 0.5);
                                                	else
                                                		tmp = Float64(NaChar * 0.5);
                                                	end
                                                	return tmp
                                                end
                                                
                                                function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                	tmp = 0.0;
                                                	if (NaChar <= -8.5e-128)
                                                		tmp = NaChar * 0.5;
                                                	elseif (NaChar <= 2.6e-139)
                                                		tmp = NdChar * 0.5;
                                                	else
                                                		tmp = NaChar * 0.5;
                                                	end
                                                	tmp_2 = tmp;
                                                end
                                                
                                                code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[NaChar, -8.5e-128], N[(NaChar * 0.5), $MachinePrecision], If[LessEqual[NaChar, 2.6e-139], N[(NdChar * 0.5), $MachinePrecision], N[(NaChar * 0.5), $MachinePrecision]]]
                                                
                                                \begin{array}{l}
                                                
                                                \\
                                                \begin{array}{l}
                                                \mathbf{if}\;NaChar \leq -8.5 \cdot 10^{-128}:\\
                                                \;\;\;\;NaChar \cdot 0.5\\
                                                
                                                \mathbf{elif}\;NaChar \leq 2.6 \cdot 10^{-139}:\\
                                                \;\;\;\;NdChar \cdot 0.5\\
                                                
                                                \mathbf{else}:\\
                                                \;\;\;\;NaChar \cdot 0.5\\
                                                
                                                
                                                \end{array}
                                                \end{array}
                                                
                                                Derivation
                                                1. Split input into 2 regimes
                                                2. if NaChar < -8.4999999999999996e-128 or 2.5999999999999998e-139 < 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. distribute-lft-outN/A

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

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

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

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

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

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

                                                    if -8.4999999999999996e-128 < NaChar < 2.5999999999999998e-139

                                                    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 inf

                                                      \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}}}} \]
                                                    4. 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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                    Alternative 15: 27.5% accurate, 30.7× speedup?

                                                    \[\begin{array}{l} \\ 0.5 \cdot \left(NdChar + NaChar\right) \end{array} \]
                                                    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                     :precision binary64
                                                     (* 0.5 (+ NdChar NaChar)))
                                                    double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                    	return 0.5 * (NdChar + 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 * (ndchar + 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 * (NdChar + NaChar);
                                                    }
                                                    
                                                    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                                    	return 0.5 * (NdChar + NaChar)
                                                    
                                                    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                    	return Float64(0.5 * Float64(NdChar + NaChar))
                                                    end
                                                    
                                                    function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                    	tmp = 0.5 * (NdChar + NaChar);
                                                    end
                                                    
                                                    code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]
                                                    
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    0.5 \cdot \left(NdChar + NaChar\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. 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. distribute-lft-outN/A

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

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

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

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

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

                                                    Alternative 16: 18.7% accurate, 46.0× speedup?

                                                    \[\begin{array}{l} \\ NaChar \cdot 0.5 \end{array} \]
                                                    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                     :precision binary64
                                                     (* NaChar 0.5))
                                                    double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                    	return NaChar * 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 * 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 * 0.5;
                                                    }
                                                    
                                                    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                                    	return NaChar * 0.5
                                                    
                                                    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                    	return Float64(NaChar * 0.5)
                                                    end
                                                    
                                                    function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                    	tmp = NaChar * 0.5;
                                                    end
                                                    
                                                    code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(NaChar * 0.5), $MachinePrecision]
                                                    
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    NaChar \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. distribute-lft-outN/A

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

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

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

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

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

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

                                                      Reproduce

                                                      ?
                                                      herbie shell --seed 2024221 
                                                      (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))))))