Bulmash initializePoisson

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

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

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

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

Alternative 2: 46.5% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-301}:\\
\;\;\;\;t\_3\\

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-277}:\\
\;\;\;\;\frac{NdChar}{2 - \frac{\mathsf{fma}\left(\frac{t\_1 \cdot t\_1}{KbT}, -0.5, t\_1\right)}{KbT}}\\

\mathbf{elif}\;t\_2 \leq 10^{-75}:\\
\;\;\;\;t\_3\\

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


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

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -2e113 < (+.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.00000000000000007e-301 or 5e-277 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 9.9999999999999996e-76

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{NaChar}{e^{\frac{Ev}{KbT}} + 1} \]
    7. Step-by-step derivation
      1. Applied rewrites29.4%

        \[\leadsto \frac{NaChar}{e^{\frac{Ev}{KbT}} + 1} \]

      if -1.00000000000000007e-301 < (+.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))))) < 5e-277

      1. Initial program 100.0%

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

        \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 3: 45.4% accurate, 0.3× speedup?

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

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1} \]
        7. Step-by-step derivation
          1. Applied rewrites38.8%

            \[\leadsto \frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1} \]

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

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

            \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

          Alternative 4: 74.7% accurate, 0.3× speedup?

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

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

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

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

            if -2.00000000000000008e-153 < (+.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.9999999999999998e-71

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

              \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

          Alternative 5: 44.0% accurate, 0.4× speedup?

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

              \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

              if -5.00000000000000029e-289 < (+.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 NaChar around 0

                \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

              Alternative 6: 44.1% accurate, 0.4× speedup?

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

                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

                  \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                Alternative 7: 35.9% accurate, 0.4× speedup?

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

                  1. Initial program 100.0%

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

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

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

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

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

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

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

                  if -2.00000000000000006e-206 < (+.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))))) < 1e-190

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 8: 29.4% accurate, 0.5× speedup?

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

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

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

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

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

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

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

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

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

                    1. Initial program 100.0%

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

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

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

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

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

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

                      \[\leadsto -1 \cdot \color{blue}{\left(NaChar \cdot \left(\frac{1}{4} \cdot \frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT} - \frac{1}{2}\right)\right)} \]
                    7. Step-by-step derivation
                      1. Applied rewrites3.8%

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

                        \[\leadsto \frac{1}{4} \cdot \frac{NaChar \cdot mu}{\color{blue}{KbT}} \]
                      3. Step-by-step derivation
                        1. Applied rewrites19.0%

                          \[\leadsto \left(NaChar \cdot \frac{mu}{KbT}\right) \cdot 0.25 \]
                      4. Recombined 2 regimes into one program.
                      5. Final simplification30.3%

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

                      Alternative 9: 66.6% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

                        if -4.80000000000000011e111 < NaChar < 2.5000000000000001e160

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

                          \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 10: 60.2% accurate, 1.9× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

                        if -1.7499999999999999e-134 < NaChar < 9.0000000000000007e-155

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

                          \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Alternative 11: 43.0% accurate, 1.9× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\ t_1 := e^{\frac{Vef}{KbT}}\\ \mathbf{if}\;EDonor \leq -4.4 \cdot 10^{+68}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;EDonor \leq -2.15 \cdot 10^{+24}:\\ \;\;\;\;0.5 \cdot NdChar - \frac{NaChar}{-1 - t\_1}\\ \mathbf{elif}\;EDonor \leq 5.2 \cdot 10^{+40}:\\ \;\;\;\;\frac{NdChar}{1 + t\_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 (+ 1.0 (exp (/ EDonor KbT))))) (t_1 (exp (/ Vef KbT))))
                           (if (<= EDonor -4.4e+68)
                             t_0
                             (if (<= EDonor -2.15e+24)
                               (- (* 0.5 NdChar) (/ NaChar (- -1.0 t_1)))
                               (if (<= EDonor 5.2e+40) (/ NdChar (+ 1.0 t_1)) t_0)))))
                        double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                        	double t_0 = NdChar / (1.0 + exp((EDonor / KbT)));
                        	double t_1 = exp((Vef / KbT));
                        	double tmp;
                        	if (EDonor <= -4.4e+68) {
                        		tmp = t_0;
                        	} else if (EDonor <= -2.15e+24) {
                        		tmp = (0.5 * NdChar) - (NaChar / (-1.0 - t_1));
                        	} else if (EDonor <= 5.2e+40) {
                        		tmp = NdChar / (1.0 + t_1);
                        	} 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 = ndchar / (1.0d0 + exp((edonor / kbt)))
                            t_1 = exp((vef / kbt))
                            if (edonor <= (-4.4d+68)) then
                                tmp = t_0
                            else if (edonor <= (-2.15d+24)) then
                                tmp = (0.5d0 * ndchar) - (nachar / ((-1.0d0) - t_1))
                            else if (edonor <= 5.2d+40) then
                                tmp = ndchar / (1.0d0 + t_1)
                            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 / (1.0 + Math.exp((EDonor / KbT)));
                        	double t_1 = Math.exp((Vef / KbT));
                        	double tmp;
                        	if (EDonor <= -4.4e+68) {
                        		tmp = t_0;
                        	} else if (EDonor <= -2.15e+24) {
                        		tmp = (0.5 * NdChar) - (NaChar / (-1.0 - t_1));
                        	} else if (EDonor <= 5.2e+40) {
                        		tmp = NdChar / (1.0 + t_1);
                        	} else {
                        		tmp = t_0;
                        	}
                        	return tmp;
                        }
                        
                        def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                        	t_0 = NdChar / (1.0 + math.exp((EDonor / KbT)))
                        	t_1 = math.exp((Vef / KbT))
                        	tmp = 0
                        	if EDonor <= -4.4e+68:
                        		tmp = t_0
                        	elif EDonor <= -2.15e+24:
                        		tmp = (0.5 * NdChar) - (NaChar / (-1.0 - t_1))
                        	elif EDonor <= 5.2e+40:
                        		tmp = NdChar / (1.0 + t_1)
                        	else:
                        		tmp = t_0
                        	return tmp
                        
                        function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                        	t_0 = Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT))))
                        	t_1 = exp(Float64(Vef / KbT))
                        	tmp = 0.0
                        	if (EDonor <= -4.4e+68)
                        		tmp = t_0;
                        	elseif (EDonor <= -2.15e+24)
                        		tmp = Float64(Float64(0.5 * NdChar) - Float64(NaChar / Float64(-1.0 - t_1)));
                        	elseif (EDonor <= 5.2e+40)
                        		tmp = Float64(NdChar / Float64(1.0 + t_1));
                        	else
                        		tmp = t_0;
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                        	t_0 = NdChar / (1.0 + exp((EDonor / KbT)));
                        	t_1 = exp((Vef / KbT));
                        	tmp = 0.0;
                        	if (EDonor <= -4.4e+68)
                        		tmp = t_0;
                        	elseif (EDonor <= -2.15e+24)
                        		tmp = (0.5 * NdChar) - (NaChar / (-1.0 - t_1));
                        	elseif (EDonor <= 5.2e+40)
                        		tmp = NdChar / (1.0 + t_1);
                        	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[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[EDonor, -4.4e+68], t$95$0, If[LessEqual[EDonor, -2.15e+24], N[(N[(0.5 * NdChar), $MachinePrecision] - N[(NaChar / N[(-1.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[EDonor, 5.2e+40], N[(NdChar / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\
                        t_1 := e^{\frac{Vef}{KbT}}\\
                        \mathbf{if}\;EDonor \leq -4.4 \cdot 10^{+68}:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{elif}\;EDonor \leq -2.15 \cdot 10^{+24}:\\
                        \;\;\;\;0.5 \cdot NdChar - \frac{NaChar}{-1 - t\_1}\\
                        
                        \mathbf{elif}\;EDonor \leq 5.2 \cdot 10^{+40}:\\
                        \;\;\;\;\frac{NdChar}{1 + t\_1}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_0\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 3 regimes
                        2. if EDonor < -4.39999999999999974e68 or 5.2000000000000001e40 < EDonor

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

                            \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                            if -4.39999999999999974e68 < EDonor < -2.14999999999999994e24

                            1. Initial program 100.0%

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

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

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

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

                              \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} \]
                            7. Step-by-step derivation
                              1. lower-*.f6488.4

                                \[\leadsto \color{blue}{0.5 \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} \]
                            8. Applied rewrites88.4%

                              \[\leadsto \color{blue}{0.5 \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} \]

                            if -2.14999999999999994e24 < EDonor < 5.2000000000000001e40

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

                              \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                              \[\leadsto \begin{array}{l} \mathbf{if}\;EDonor \leq -4.4 \cdot 10^{+68}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\ \mathbf{elif}\;EDonor \leq -2.15 \cdot 10^{+24}:\\ \;\;\;\;0.5 \cdot NdChar - \frac{NaChar}{-1 - e^{\frac{Vef}{KbT}}}\\ \mathbf{elif}\;EDonor \leq 5.2 \cdot 10^{+40}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{Vef}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\ \end{array} \]
                            10. Add Preprocessing

                            Alternative 12: 43.3% accurate, 1.9× speedup?

                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\ \mathbf{if}\;EDonor \leq -1.25 \cdot 10^{+74}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;EDonor \leq -5.5 \cdot 10^{+27}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} - -1}\\ \mathbf{elif}\;EDonor \leq 5.2 \cdot 10^{+40}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{Vef}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                            (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                             :precision binary64
                             (let* ((t_0 (/ NdChar (+ 1.0 (exp (/ EDonor KbT))))))
                               (if (<= EDonor -1.25e+74)
                                 t_0
                                 (if (<= EDonor -5.5e+27)
                                   (/ NaChar (- (exp (/ EAccept KbT)) -1.0))
                                   (if (<= EDonor 5.2e+40) (/ NdChar (+ 1.0 (exp (/ Vef KbT)))) t_0)))))
                            double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                            	double t_0 = NdChar / (1.0 + exp((EDonor / KbT)));
                            	double tmp;
                            	if (EDonor <= -1.25e+74) {
                            		tmp = t_0;
                            	} else if (EDonor <= -5.5e+27) {
                            		tmp = NaChar / (exp((EAccept / KbT)) - -1.0);
                            	} else if (EDonor <= 5.2e+40) {
                            		tmp = NdChar / (1.0 + exp((Vef / KbT)));
                            	} else {
                            		tmp = t_0;
                            	}
                            	return tmp;
                            }
                            
                            real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                                real(8), intent (in) :: ndchar
                                real(8), intent (in) :: ec
                                real(8), intent (in) :: vef
                                real(8), intent (in) :: edonor
                                real(8), intent (in) :: mu
                                real(8), intent (in) :: kbt
                                real(8), intent (in) :: nachar
                                real(8), intent (in) :: ev
                                real(8), intent (in) :: eaccept
                                real(8) :: t_0
                                real(8) :: tmp
                                t_0 = ndchar / (1.0d0 + exp((edonor / kbt)))
                                if (edonor <= (-1.25d+74)) then
                                    tmp = t_0
                                else if (edonor <= (-5.5d+27)) then
                                    tmp = nachar / (exp((eaccept / kbt)) - (-1.0d0))
                                else if (edonor <= 5.2d+40) then
                                    tmp = ndchar / (1.0d0 + exp((vef / 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 = NdChar / (1.0 + Math.exp((EDonor / KbT)));
                            	double tmp;
                            	if (EDonor <= -1.25e+74) {
                            		tmp = t_0;
                            	} else if (EDonor <= -5.5e+27) {
                            		tmp = NaChar / (Math.exp((EAccept / KbT)) - -1.0);
                            	} else if (EDonor <= 5.2e+40) {
                            		tmp = NdChar / (1.0 + Math.exp((Vef / KbT)));
                            	} else {
                            		tmp = t_0;
                            	}
                            	return tmp;
                            }
                            
                            def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                            	t_0 = NdChar / (1.0 + math.exp((EDonor / KbT)))
                            	tmp = 0
                            	if EDonor <= -1.25e+74:
                            		tmp = t_0
                            	elif EDonor <= -5.5e+27:
                            		tmp = NaChar / (math.exp((EAccept / KbT)) - -1.0)
                            	elif EDonor <= 5.2e+40:
                            		tmp = NdChar / (1.0 + math.exp((Vef / KbT)))
                            	else:
                            		tmp = t_0
                            	return tmp
                            
                            function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                            	t_0 = Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT))))
                            	tmp = 0.0
                            	if (EDonor <= -1.25e+74)
                            		tmp = t_0;
                            	elseif (EDonor <= -5.5e+27)
                            		tmp = Float64(NaChar / Float64(exp(Float64(EAccept / KbT)) - -1.0));
                            	elseif (EDonor <= 5.2e+40)
                            		tmp = Float64(NdChar / Float64(1.0 + exp(Float64(Vef / KbT))));
                            	else
                            		tmp = t_0;
                            	end
                            	return tmp
                            end
                            
                            function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                            	t_0 = NdChar / (1.0 + exp((EDonor / KbT)));
                            	tmp = 0.0;
                            	if (EDonor <= -1.25e+74)
                            		tmp = t_0;
                            	elseif (EDonor <= -5.5e+27)
                            		tmp = NaChar / (exp((EAccept / KbT)) - -1.0);
                            	elseif (EDonor <= 5.2e+40)
                            		tmp = NdChar / (1.0 + exp((Vef / 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[(NdChar / N[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[EDonor, -1.25e+74], t$95$0, If[LessEqual[EDonor, -5.5e+27], N[(NaChar / N[(N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[EDonor, 5.2e+40], N[(NdChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
                            
                            \begin{array}{l}
                            
                            \\
                            \begin{array}{l}
                            t_0 := \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\
                            \mathbf{if}\;EDonor \leq -1.25 \cdot 10^{+74}:\\
                            \;\;\;\;t\_0\\
                            
                            \mathbf{elif}\;EDonor \leq -5.5 \cdot 10^{+27}:\\
                            \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} - -1}\\
                            
                            \mathbf{elif}\;EDonor \leq 5.2 \cdot 10^{+40}:\\
                            \;\;\;\;\frac{NdChar}{1 + e^{\frac{Vef}{KbT}}}\\
                            
                            \mathbf{else}:\\
                            \;\;\;\;t\_0\\
                            
                            
                            \end{array}
                            \end{array}
                            
                            Derivation
                            1. Split input into 3 regimes
                            2. if EDonor < -1.24999999999999991e74 or 5.2000000000000001e40 < EDonor

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

                                \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                if -1.24999999999999991e74 < EDonor < -5.49999999999999966e27

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

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

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

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

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

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

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

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

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

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

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

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

                                  \[\leadsto \frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1} \]
                                7. Step-by-step derivation
                                  1. Applied rewrites71.2%

                                    \[\leadsto \frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1} \]

                                  if -5.49999999999999966e27 < EDonor < 5.2000000000000001e40

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

                                    \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \begin{array}{l} \mathbf{if}\;EDonor \leq -1.25 \cdot 10^{+74}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\ \mathbf{elif}\;EDonor \leq -5.5 \cdot 10^{+27}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} - -1}\\ \mathbf{elif}\;EDonor \leq 5.2 \cdot 10^{+40}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{Vef}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\ \end{array} \]
                                  10. Add Preprocessing

                                  Alternative 13: 20.6% accurate, 23.0× speedup?

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

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

                                      \[\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. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

                                      if 1.0499999999999999e104 < NaChar

                                      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

                                      Alternative 14: 27.7% accurate, 30.7× speedup?

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

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

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

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

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

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

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

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

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

                                      Alternative 15: 18.3% accurate, 46.0× speedup?

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

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

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

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

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

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

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

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

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

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

                                        Reproduce

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