Bulmash initializePoisson

Percentage Accurate: 100.0% → 100.0%
Time: 17.0s
Alternatives: 20
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 20 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 2: 42.6% accurate, 1.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{\frac{Vef}{KbT}} + 1\\ t_1 := \frac{NaChar}{e^{0 - \frac{mu}{KbT}} + 1}\\ \mathbf{if}\;mu \leq -1.06 \cdot 10^{+40}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;mu \leq 5.3 \cdot 10^{-250}:\\ \;\;\;\;\frac{NdChar}{t\_0}\\ \mathbf{elif}\;mu \leq 5.6 \cdot 10^{-36}:\\ \;\;\;\;\frac{NaChar}{t\_0}\\ \mathbf{elif}\;mu \leq 3.2 \cdot 10^{+79}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
 :precision binary64
 (let* ((t_0 (+ (exp (/ Vef KbT)) 1.0))
        (t_1 (/ NaChar (+ (exp (- 0.0 (/ mu KbT))) 1.0))))
   (if (<= mu -1.06e+40)
     t_1
     (if (<= mu 5.3e-250)
       (/ NdChar t_0)
       (if (<= mu 5.6e-36)
         (/ NaChar t_0)
         (if (<= mu 3.2e+79) (/ NdChar (+ (exp (/ EDonor KbT)) 1.0)) t_1))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
	double t_0 = exp((Vef / KbT)) + 1.0;
	double t_1 = NaChar / (exp((0.0 - (mu / KbT))) + 1.0);
	double tmp;
	if (mu <= -1.06e+40) {
		tmp = t_1;
	} else if (mu <= 5.3e-250) {
		tmp = NdChar / t_0;
	} else if (mu <= 5.6e-36) {
		tmp = NaChar / t_0;
	} else if (mu <= 3.2e+79) {
		tmp = NdChar / (exp((EDonor / KbT)) + 1.0);
	} 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) :: tmp
    t_0 = exp((vef / kbt)) + 1.0d0
    t_1 = nachar / (exp((0.0d0 - (mu / kbt))) + 1.0d0)
    if (mu <= (-1.06d+40)) then
        tmp = t_1
    else if (mu <= 5.3d-250) then
        tmp = ndchar / t_0
    else if (mu <= 5.6d-36) then
        tmp = nachar / t_0
    else if (mu <= 3.2d+79) then
        tmp = ndchar / (exp((edonor / kbt)) + 1.0d0)
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
	double t_0 = Math.exp((Vef / KbT)) + 1.0;
	double t_1 = NaChar / (Math.exp((0.0 - (mu / KbT))) + 1.0);
	double tmp;
	if (mu <= -1.06e+40) {
		tmp = t_1;
	} else if (mu <= 5.3e-250) {
		tmp = NdChar / t_0;
	} else if (mu <= 5.6e-36) {
		tmp = NaChar / t_0;
	} else if (mu <= 3.2e+79) {
		tmp = NdChar / (Math.exp((EDonor / KbT)) + 1.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
	t_0 = math.exp((Vef / KbT)) + 1.0
	t_1 = NaChar / (math.exp((0.0 - (mu / KbT))) + 1.0)
	tmp = 0
	if mu <= -1.06e+40:
		tmp = t_1
	elif mu <= 5.3e-250:
		tmp = NdChar / t_0
	elif mu <= 5.6e-36:
		tmp = NaChar / t_0
	elif mu <= 3.2e+79:
		tmp = NdChar / (math.exp((EDonor / KbT)) + 1.0)
	else:
		tmp = t_1
	return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	t_0 = Float64(exp(Float64(Vef / KbT)) + 1.0)
	t_1 = Float64(NaChar / Float64(exp(Float64(0.0 - Float64(mu / KbT))) + 1.0))
	tmp = 0.0
	if (mu <= -1.06e+40)
		tmp = t_1;
	elseif (mu <= 5.3e-250)
		tmp = Float64(NdChar / t_0);
	elseif (mu <= 5.6e-36)
		tmp = Float64(NaChar / t_0);
	elseif (mu <= 3.2e+79)
		tmp = Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) + 1.0));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	t_0 = exp((Vef / KbT)) + 1.0;
	t_1 = NaChar / (exp((0.0 - (mu / KbT))) + 1.0);
	tmp = 0.0;
	if (mu <= -1.06e+40)
		tmp = t_1;
	elseif (mu <= 5.3e-250)
		tmp = NdChar / t_0;
	elseif (mu <= 5.6e-36)
		tmp = NaChar / t_0;
	elseif (mu <= 3.2e+79)
		tmp = NdChar / (exp((EDonor / KbT)) + 1.0);
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(NaChar / N[(N[Exp[N[(0.0 - N[(mu / KbT), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[mu, -1.06e+40], t$95$1, If[LessEqual[mu, 5.3e-250], N[(NdChar / t$95$0), $MachinePrecision], If[LessEqual[mu, 5.6e-36], N[(NaChar / t$95$0), $MachinePrecision], If[LessEqual[mu, 3.2e+79], N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{\frac{Vef}{KbT}} + 1\\
t_1 := \frac{NaChar}{e^{0 - \frac{mu}{KbT}} + 1}\\
\mathbf{if}\;mu \leq -1.06 \cdot 10^{+40}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;mu \leq 5.3 \cdot 10^{-250}:\\
\;\;\;\;\frac{NdChar}{t\_0}\\

\mathbf{elif}\;mu \leq 5.6 \cdot 10^{-36}:\\
\;\;\;\;\frac{NaChar}{t\_0}\\

\mathbf{elif}\;mu \leq 3.2 \cdot 10^{+79}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if mu < -1.05999999999999996e40 or 3.20000000000000003e79 < mu

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
      5. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      7. associate-+r+N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      9. associate-+r+N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      11. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      12. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef - mu\right)\right), KbT\right)\right)\right)\right) \]
      14. --lowering--.f6465.1%

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \mathsf{\_.f64}\left(Vef, mu\right)\right), KbT\right)\right)\right)\right) \]
    6. Simplified65.1%

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

      \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot \frac{mu}{KbT}\right)}\right)\right)\right) \]
    8. Step-by-step derivation
      1. associate-*r/N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{-1 \cdot mu}{KbT}\right)\right)\right)\right) \]
      2. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\mathsf{neg}\left(mu\right)}{KbT}\right)\right)\right)\right) \]
      3. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(mu\right)\right), KbT\right)\right)\right)\right) \]
      4. neg-lowering-neg.f6456.8%

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{neg.f64}\left(mu\right), KbT\right)\right)\right)\right) \]
    9. Simplified56.8%

      \[\leadsto \frac{NaChar}{1 + e^{\color{blue}{\frac{-mu}{KbT}}}} \]

    if -1.05999999999999996e40 < mu < 5.3000000000000001e-250

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
      5. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      8. associate-+r+N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu - Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      13. --lowering--.f6472.6%

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
    6. Simplified72.6%

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

      \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Vef}{KbT}\right)}\right)\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f6457.2%

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right)\right)\right)\right) \]
    9. Simplified57.2%

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

    if 5.3000000000000001e-250 < mu < 5.6000000000000002e-36

    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. Simplified100.0%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
      5. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      7. associate-+r+N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      9. associate-+r+N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      11. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      12. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef - mu\right)\right), KbT\right)\right)\right)\right) \]
      14. --lowering--.f6470.4%

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \mathsf{\_.f64}\left(Vef, mu\right)\right), KbT\right)\right)\right)\right) \]
    6. Simplified70.4%

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

      \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Vef}{KbT}\right)}\right)\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f6456.4%

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right)\right)\right)\right) \]
    9. Simplified56.4%

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

    if 5.6000000000000002e-36 < mu < 3.20000000000000003e79

    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. Simplified100.0%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
      5. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      8. associate-+r+N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu - Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      13. --lowering--.f6467.8%

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
    6. Simplified67.8%

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

      \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EDonor}{KbT}\right)}\right)\right)\right) \]
    8. Step-by-step derivation
      1. /-lowering-/.f6465.1%

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right) \]
    9. Simplified65.1%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;mu \leq -1.06 \cdot 10^{+40}:\\ \;\;\;\;\frac{NaChar}{e^{0 - \frac{mu}{KbT}} + 1}\\ \mathbf{elif}\;mu \leq 5.3 \cdot 10^{-250}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{elif}\;mu \leq 5.6 \cdot 10^{-36}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{elif}\;mu \leq 3.2 \cdot 10^{+79}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{e^{0 - \frac{mu}{KbT}} + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 67.7% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{NdChar}{e^{\frac{EDonor + \left(Vef + \left(mu - Ec\right)\right)}{KbT}} + 1}\\
\mathbf{if}\;NdChar \leq -1.25 \cdot 10^{+122}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;NdChar \leq 7.2 \cdot 10^{-168}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{\left(EAccept + Ev\right) + \left(Vef - mu\right)}{KbT}} + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if NdChar < -1.24999999999999997e122 or 7.1999999999999998e-168 < NdChar

    1. Initial program 100.0%

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
      5. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
      6. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
      7. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      8. associate-+r+N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      9. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      12. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu - Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      13. --lowering--.f6473.5%

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
    6. Simplified73.5%

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

    if -1.24999999999999997e122 < NdChar < 7.1999999999999998e-168

    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. Simplified100.0%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
      5. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      7. associate-+r+N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      9. associate-+r+N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      11. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      12. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef - mu\right)\right), KbT\right)\right)\right)\right) \]
      14. --lowering--.f6476.7%

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \mathsf{\_.f64}\left(Vef, mu\right)\right), KbT\right)\right)\right)\right) \]
    6. Simplified76.7%

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

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

Alternative 4: 63.6% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;KbT \leq -9.8 \cdot 10^{+204}:\\
\;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\

\mathbf{elif}\;KbT \leq 1.4 \cdot 10^{+189}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{\left(EAccept + Ev\right) + \left(Vef - mu\right)}{KbT}} + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{2} + \frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if KbT < -9.7999999999999995e204

    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. Simplified100.0%

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

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

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

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
      3. +-lowering-+.f6478.1%

        \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
    6. Simplified78.1%

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

    if -9.7999999999999995e204 < KbT < 1.40000000000000003e189

    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. Simplified100.0%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
      5. associate--l+N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
      6. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      7. associate-+r+N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      8. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      9. associate-+r+N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      10. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      11. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      12. mul-1-negN/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
      13. sub-negN/A

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef - mu\right)\right), KbT\right)\right)\right)\right) \]
      14. --lowering--.f6465.3%

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \mathsf{\_.f64}\left(Vef, mu\right)\right), KbT\right)\right)\right)\right) \]
    6. Simplified65.3%

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

    if 1.40000000000000003e189 < 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. Simplified100.0%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \color{blue}{2}\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. Simplified83.0%

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Ev}{KbT}\right)}\right)\right)\right)\right) \]
      3. Step-by-step derivation
        1. /-lowering-/.f6474.5%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Ev, KbT\right)\right)\right)\right)\right) \]
      4. Simplified74.5%

        \[\leadsto \frac{NdChar}{2} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Ev}{KbT}}}} \]
    6. Recombined 3 regimes into one program.
    7. Final simplification67.7%

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

    Alternative 5: 40.5% accurate, 1.9× speedup?

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

      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. Simplified100.0%

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
        3. +-lowering-+.f6464.7%

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
      6. Simplified64.7%

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

      if -1.7e117 < KbT < -2.15000000000000003e-194

      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. Simplified100.0%

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
        6. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        7. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        11. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        12. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef - mu\right)\right), KbT\right)\right)\right)\right) \]
        14. --lowering--.f6469.2%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \mathsf{\_.f64}\left(Vef, mu\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified69.2%

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EAccept}{KbT}\right)}\right)\right)\right) \]
      8. Step-by-step derivation
        1. /-lowering-/.f6426.8%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right)\right)\right)\right) \]
      9. Simplified26.8%

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

      if -2.15000000000000003e-194 < KbT < 9.19999999999999978e-117

      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. Simplified100.0%

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
        6. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        7. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        11. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        12. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef - mu\right)\right), KbT\right)\right)\right)\right) \]
        14. --lowering--.f6472.9%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \mathsf{\_.f64}\left(Vef, mu\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified72.9%

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Ev}{KbT}\right)}\right)\right)\right) \]
      8. Step-by-step derivation
        1. /-lowering-/.f6440.8%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Ev, KbT\right)\right)\right)\right) \]
      9. Simplified40.8%

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

      if 9.19999999999999978e-117 < KbT < 3.60000000000000003e208

      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. Simplified100.0%

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        7. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        11. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        12. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu - Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. --lowering--.f6470.2%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified70.2%

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{\left(2 + -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}\right)}\right) \]
      8. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \color{blue}{\left(-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}\right)}\right)\right) \]
        2. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(\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}\right)\right)\right)\right) \]
        3. neg-lowering-neg.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\left(\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}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(-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}\right), KbT\right)\right)\right)\right) \]
      9. Simplified32.7%

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

      if 3.60000000000000003e208 < 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. Simplified100.0%

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \color{blue}{\left(\frac{-1}{4} \cdot \frac{Ec \cdot NdChar}{KbT}\right)}\right) \]
      7. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \color{blue}{\left(\frac{Ec \cdot NdChar}{KbT}\right)}\right)\right) \]
        2. associate-/l*N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \left(Ec \cdot \color{blue}{\frac{NdChar}{KbT}}\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(Ec, \color{blue}{\left(\frac{NdChar}{KbT}\right)}\right)\right)\right) \]
        4. /-lowering-/.f6474.0%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(Ec, \mathsf{/.f64}\left(NdChar, \color{blue}{KbT}\right)\right)\right)\right) \]
      8. Simplified74.0%

        \[\leadsto 0.5 \cdot \left(NaChar + NdChar\right) - \color{blue}{-0.25 \cdot \left(Ec \cdot \frac{NdChar}{KbT}\right)} \]
    3. Recombined 5 regimes into one program.
    4. Final simplification43.7%

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

    Alternative 6: 45.9% accurate, 2.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{\frac{Vef}{KbT}} + 1\\ t_1 := \frac{NaChar}{t\_0}\\ \mathbf{if}\;NaChar \leq -5200000000:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;NaChar \leq 7 \cdot 10^{-20}:\\ \;\;\;\;\frac{NdChar}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
     :precision binary64
     (let* ((t_0 (+ (exp (/ Vef KbT)) 1.0)) (t_1 (/ NaChar t_0)))
       (if (<= NaChar -5200000000.0)
         t_1
         (if (<= NaChar 7e-20) (/ NdChar t_0) t_1))))
    double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
    	double t_0 = exp((Vef / KbT)) + 1.0;
    	double t_1 = NaChar / t_0;
    	double tmp;
    	if (NaChar <= -5200000000.0) {
    		tmp = t_1;
    	} else if (NaChar <= 7e-20) {
    		tmp = NdChar / t_0;
    	} 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) :: tmp
        t_0 = exp((vef / kbt)) + 1.0d0
        t_1 = nachar / t_0
        if (nachar <= (-5200000000.0d0)) then
            tmp = t_1
        else if (nachar <= 7d-20) then
            tmp = ndchar / t_0
        else
            tmp = t_1
        end if
        code = tmp
    end function
    
    public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
    	double t_0 = Math.exp((Vef / KbT)) + 1.0;
    	double t_1 = NaChar / t_0;
    	double tmp;
    	if (NaChar <= -5200000000.0) {
    		tmp = t_1;
    	} else if (NaChar <= 7e-20) {
    		tmp = NdChar / t_0;
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
    	t_0 = math.exp((Vef / KbT)) + 1.0
    	t_1 = NaChar / t_0
    	tmp = 0
    	if NaChar <= -5200000000.0:
    		tmp = t_1
    	elif NaChar <= 7e-20:
    		tmp = NdChar / t_0
    	else:
    		tmp = t_1
    	return tmp
    
    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = Float64(exp(Float64(Vef / KbT)) + 1.0)
    	t_1 = Float64(NaChar / t_0)
    	tmp = 0.0
    	if (NaChar <= -5200000000.0)
    		tmp = t_1;
    	elseif (NaChar <= 7e-20)
    		tmp = Float64(NdChar / t_0);
    	else
    		tmp = t_1;
    	end
    	return tmp
    end
    
    function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = exp((Vef / KbT)) + 1.0;
    	t_1 = NaChar / t_0;
    	tmp = 0.0;
    	if (NaChar <= -5200000000.0)
    		tmp = t_1;
    	elseif (NaChar <= 7e-20)
    		tmp = NdChar / t_0;
    	else
    		tmp = t_1;
    	end
    	tmp_2 = tmp;
    end
    
    code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(NaChar / t$95$0), $MachinePrecision]}, If[LessEqual[NaChar, -5200000000.0], t$95$1, If[LessEqual[NaChar, 7e-20], N[(NdChar / t$95$0), $MachinePrecision], t$95$1]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := e^{\frac{Vef}{KbT}} + 1\\
    t_1 := \frac{NaChar}{t\_0}\\
    \mathbf{if}\;NaChar \leq -5200000000:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;NaChar \leq 7 \cdot 10^{-20}:\\
    \;\;\;\;\frac{NdChar}{t\_0}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if NaChar < -5.2e9 or 7.00000000000000007e-20 < 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. Simplified100.0%

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
        6. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        7. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        11. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        12. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef - mu\right)\right), KbT\right)\right)\right)\right) \]
        14. --lowering--.f6471.7%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \mathsf{\_.f64}\left(Vef, mu\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified71.7%

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Vef}{KbT}\right)}\right)\right)\right) \]
      8. Step-by-step derivation
        1. /-lowering-/.f6448.2%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right)\right)\right)\right) \]
      9. Simplified48.2%

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

      if -5.2e9 < NaChar < 7.00000000000000007e-20

      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. Simplified100.0%

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        7. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        11. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        12. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu - Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. --lowering--.f6473.9%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified73.9%

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Vef}{KbT}\right)}\right)\right)\right) \]
      8. Step-by-step derivation
        1. /-lowering-/.f6454.8%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right)\right)\right)\right) \]
      9. Simplified54.8%

        \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification51.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;NaChar \leq -5200000000:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{elif}\;NaChar \leq 7 \cdot 10^{-20}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 7: 44.3% accurate, 2.0× speedup?

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

      1. Initial program 100.0%

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
        6. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        7. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        11. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        12. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef - mu\right)\right), KbT\right)\right)\right)\right) \]
        14. --lowering--.f6471.6%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \mathsf{\_.f64}\left(Vef, mu\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified71.6%

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Vef}{KbT}\right)}\right)\right)\right) \]
      8. Step-by-step derivation
        1. /-lowering-/.f6457.4%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right)\right)\right)\right) \]
      9. Simplified57.4%

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

      if -2.3e23 < Vef < 2.6500000000000001e84

      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. Simplified100.0%

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        7. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        11. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        12. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu - Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. --lowering--.f6461.2%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified61.2%

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EDonor}{KbT}\right)}\right)\right)\right) \]
      8. Step-by-step derivation
        1. /-lowering-/.f6445.3%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right) \]
      9. Simplified45.3%

        \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{EDonor}{KbT}}}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification50.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;Vef \leq -2.3 \cdot 10^{+23}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{elif}\;Vef \leq 2.65 \cdot 10^{+84}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 8: 43.8% accurate, 2.0× speedup?

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

      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. Simplified100.0%

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
        3. +-lowering-+.f6466.1%

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
      6. Simplified66.1%

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

      if -6.5000000000000004e117 < KbT < 1.2999999999999999e187

      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. Simplified100.0%

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
        6. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        7. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        11. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        12. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef - mu\right)\right), KbT\right)\right)\right)\right) \]
        14. --lowering--.f6466.6%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \mathsf{\_.f64}\left(Vef, mu\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified66.6%

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Vef}{KbT}\right)}\right)\right)\right) \]
      8. Step-by-step derivation
        1. /-lowering-/.f6438.5%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right)\right)\right)\right) \]
      9. Simplified38.5%

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

      if 1.2999999999999999e187 < 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. Simplified100.0%

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \color{blue}{\left(\frac{-1}{4} \cdot \frac{Ec \cdot NdChar}{KbT}\right)}\right) \]
      7. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \color{blue}{\left(\frac{Ec \cdot NdChar}{KbT}\right)}\right)\right) \]
        2. associate-/l*N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \left(Ec \cdot \color{blue}{\frac{NdChar}{KbT}}\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(Ec, \color{blue}{\left(\frac{NdChar}{KbT}\right)}\right)\right)\right) \]
        4. /-lowering-/.f6467.2%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(Ec, \mathsf{/.f64}\left(NdChar, \color{blue}{KbT}\right)\right)\right)\right) \]
      8. Simplified67.2%

        \[\leadsto 0.5 \cdot \left(NaChar + NdChar\right) - \color{blue}{-0.25 \cdot \left(Ec \cdot \frac{NdChar}{KbT}\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification47.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -6.5 \cdot 10^{+117}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq 1.3 \cdot 10^{+187}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right) - \left(Ec \cdot \frac{NdChar}{KbT}\right) \cdot -0.25\\ \end{array} \]
    5. Add Preprocessing

    Alternative 9: 42.3% accurate, 2.0× speedup?

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

      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. Simplified100.0%

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
        3. +-lowering-+.f6464.7%

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
      6. Simplified64.7%

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

      if -2.35000000000000003e117 < KbT < 1.02e163

      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. Simplified100.0%

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
        6. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        7. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        11. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        12. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef - mu\right)\right), KbT\right)\right)\right)\right) \]
        14. --lowering--.f6466.9%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \mathsf{\_.f64}\left(Vef, mu\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified66.9%

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EAccept}{KbT}\right)}\right)\right)\right) \]
      8. Step-by-step derivation
        1. /-lowering-/.f6435.6%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right)\right)\right)\right) \]
      9. Simplified35.6%

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

      if 1.02e163 < 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. Simplified100.0%

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \color{blue}{\left(\frac{-1}{4} \cdot \frac{Ec \cdot NdChar}{KbT}\right)}\right) \]
      7. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \color{blue}{\left(\frac{Ec \cdot NdChar}{KbT}\right)}\right)\right) \]
        2. associate-/l*N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \left(Ec \cdot \color{blue}{\frac{NdChar}{KbT}}\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(Ec, \color{blue}{\left(\frac{NdChar}{KbT}\right)}\right)\right)\right) \]
        4. /-lowering-/.f6464.5%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(Ec, \mathsf{/.f64}\left(NdChar, \color{blue}{KbT}\right)\right)\right)\right) \]
      8. Simplified64.5%

        \[\leadsto 0.5 \cdot \left(NaChar + NdChar\right) - \color{blue}{-0.25 \cdot \left(Ec \cdot \frac{NdChar}{KbT}\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification44.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -2.35 \cdot 10^{+117}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq 1.02 \cdot 10^{+163}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right) - \left(Ec \cdot \frac{NdChar}{KbT}\right) \cdot -0.25\\ \end{array} \]
    5. Add Preprocessing

    Alternative 10: 36.4% accurate, 5.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := EDonor + \left(Vef + \left(mu - Ec\right)\right)\\ t_1 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -6.5 \cdot 10^{+165}:\\ \;\;\;\;t\_1 - \frac{Ev}{KbT} \cdot \left(NaChar \cdot 0.25\right)\\ \mathbf{elif}\;KbT \leq 3.6 \cdot 10^{+208}:\\ \;\;\;\;\frac{NdChar}{2 - \frac{\left(\left(\left(Ec - mu\right) - Vef\right) - EDonor\right) + \frac{-0.5 \cdot \left(t\_0 \cdot t\_0\right)}{KbT}}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;t\_1 - \left(Ec \cdot \frac{NdChar}{KbT}\right) \cdot -0.25\\ \end{array} \end{array} \]
    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
     :precision binary64
     (let* ((t_0 (+ EDonor (+ Vef (- mu Ec)))) (t_1 (* 0.5 (+ NdChar NaChar))))
       (if (<= KbT -6.5e+165)
         (- t_1 (* (/ Ev KbT) (* NaChar 0.25)))
         (if (<= KbT 3.6e+208)
           (/
            NdChar
            (-
             2.0
             (/
              (+ (- (- (- Ec mu) Vef) EDonor) (/ (* -0.5 (* t_0 t_0)) KbT))
              KbT)))
           (- t_1 (* (* Ec (/ NdChar KbT)) -0.25))))))
    double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
    	double t_0 = EDonor + (Vef + (mu - Ec));
    	double t_1 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -6.5e+165) {
    		tmp = t_1 - ((Ev / KbT) * (NaChar * 0.25));
    	} else if (KbT <= 3.6e+208) {
    		tmp = NdChar / (2.0 - (((((Ec - mu) - Vef) - EDonor) + ((-0.5 * (t_0 * t_0)) / KbT)) / KbT));
    	} else {
    		tmp = t_1 - ((Ec * (NdChar / KbT)) * -0.25);
    	}
    	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 = edonor + (vef + (mu - ec))
        t_1 = 0.5d0 * (ndchar + nachar)
        if (kbt <= (-6.5d+165)) then
            tmp = t_1 - ((ev / kbt) * (nachar * 0.25d0))
        else if (kbt <= 3.6d+208) then
            tmp = ndchar / (2.0d0 - (((((ec - mu) - vef) - edonor) + (((-0.5d0) * (t_0 * t_0)) / kbt)) / kbt))
        else
            tmp = t_1 - ((ec * (ndchar / kbt)) * (-0.25d0))
        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 = EDonor + (Vef + (mu - Ec));
    	double t_1 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -6.5e+165) {
    		tmp = t_1 - ((Ev / KbT) * (NaChar * 0.25));
    	} else if (KbT <= 3.6e+208) {
    		tmp = NdChar / (2.0 - (((((Ec - mu) - Vef) - EDonor) + ((-0.5 * (t_0 * t_0)) / KbT)) / KbT));
    	} else {
    		tmp = t_1 - ((Ec * (NdChar / KbT)) * -0.25);
    	}
    	return tmp;
    }
    
    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
    	t_0 = EDonor + (Vef + (mu - Ec))
    	t_1 = 0.5 * (NdChar + NaChar)
    	tmp = 0
    	if KbT <= -6.5e+165:
    		tmp = t_1 - ((Ev / KbT) * (NaChar * 0.25))
    	elif KbT <= 3.6e+208:
    		tmp = NdChar / (2.0 - (((((Ec - mu) - Vef) - EDonor) + ((-0.5 * (t_0 * t_0)) / KbT)) / KbT))
    	else:
    		tmp = t_1 - ((Ec * (NdChar / KbT)) * -0.25)
    	return tmp
    
    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = Float64(EDonor + Float64(Vef + Float64(mu - Ec)))
    	t_1 = Float64(0.5 * Float64(NdChar + NaChar))
    	tmp = 0.0
    	if (KbT <= -6.5e+165)
    		tmp = Float64(t_1 - Float64(Float64(Ev / KbT) * Float64(NaChar * 0.25)));
    	elseif (KbT <= 3.6e+208)
    		tmp = Float64(NdChar / Float64(2.0 - Float64(Float64(Float64(Float64(Float64(Ec - mu) - Vef) - EDonor) + Float64(Float64(-0.5 * Float64(t_0 * t_0)) / KbT)) / KbT)));
    	else
    		tmp = Float64(t_1 - Float64(Float64(Ec * Float64(NdChar / KbT)) * -0.25));
    	end
    	return tmp
    end
    
    function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = EDonor + (Vef + (mu - Ec));
    	t_1 = 0.5 * (NdChar + NaChar);
    	tmp = 0.0;
    	if (KbT <= -6.5e+165)
    		tmp = t_1 - ((Ev / KbT) * (NaChar * 0.25));
    	elseif (KbT <= 3.6e+208)
    		tmp = NdChar / (2.0 - (((((Ec - mu) - Vef) - EDonor) + ((-0.5 * (t_0 * t_0)) / KbT)) / KbT));
    	else
    		tmp = t_1 - ((Ec * (NdChar / KbT)) * -0.25);
    	end
    	tmp_2 = tmp;
    end
    
    code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(EDonor + N[(Vef + N[(mu - Ec), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -6.5e+165], N[(t$95$1 - N[(N[(Ev / KbT), $MachinePrecision] * N[(NaChar * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 3.6e+208], N[(NdChar / N[(2.0 - N[(N[(N[(N[(N[(Ec - mu), $MachinePrecision] - Vef), $MachinePrecision] - EDonor), $MachinePrecision] + N[(N[(-0.5 * N[(t$95$0 * t$95$0), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$1 - N[(N[(Ec * N[(NdChar / KbT), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := EDonor + \left(Vef + \left(mu - Ec\right)\right)\\
    t_1 := 0.5 \cdot \left(NdChar + NaChar\right)\\
    \mathbf{if}\;KbT \leq -6.5 \cdot 10^{+165}:\\
    \;\;\;\;t\_1 - \frac{Ev}{KbT} \cdot \left(NaChar \cdot 0.25\right)\\
    
    \mathbf{elif}\;KbT \leq 3.6 \cdot 10^{+208}:\\
    \;\;\;\;\frac{NdChar}{2 - \frac{\left(\left(\left(Ec - mu\right) - Vef\right) - EDonor\right) + \frac{-0.5 \cdot \left(t\_0 \cdot t\_0\right)}{KbT}}{KbT}}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1 - \left(Ec \cdot \frac{NdChar}{KbT}\right) \cdot -0.25\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if KbT < -6.4999999999999999e165

      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. Simplified100.0%

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \color{blue}{\left(\frac{1}{4} \cdot \frac{Ev \cdot NaChar}{KbT}\right)}\right) \]
      7. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \left(\frac{\frac{1}{4} \cdot \left(Ev \cdot NaChar\right)}{\color{blue}{KbT}}\right)\right) \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{/.f64}\left(\left(\frac{1}{4} \cdot \left(Ev \cdot NaChar\right)\right), \color{blue}{KbT}\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \left(Ev \cdot NaChar\right)\right), KbT\right)\right) \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \left(NaChar \cdot Ev\right)\right), KbT\right)\right) \]
        5. *-lowering-*.f6466.3%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(NaChar, Ev\right)\right), KbT\right)\right) \]
      8. Simplified66.3%

        \[\leadsto 0.5 \cdot \left(NaChar + NdChar\right) - \color{blue}{\frac{0.25 \cdot \left(NaChar \cdot Ev\right)}{KbT}} \]
      9. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \left(\frac{\left(\frac{1}{4} \cdot NaChar\right) \cdot Ev}{KbT}\right)\right) \]
        2. associate-/l*N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \left(\left(\frac{1}{4} \cdot NaChar\right) \cdot \color{blue}{\frac{Ev}{KbT}}\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\left(\frac{1}{4} \cdot NaChar\right), \color{blue}{\left(\frac{Ev}{KbT}\right)}\right)\right) \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\left(NaChar \cdot \frac{1}{4}\right), \left(\frac{\color{blue}{Ev}}{KbT}\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(NaChar, \frac{1}{4}\right), \left(\frac{\color{blue}{Ev}}{KbT}\right)\right)\right) \]
        6. /-lowering-/.f6468.8%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(NaChar, \frac{1}{4}\right), \mathsf{/.f64}\left(Ev, \color{blue}{KbT}\right)\right)\right) \]
      10. Applied egg-rr68.8%

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

      if -6.4999999999999999e165 < KbT < 3.60000000000000003e208

      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. Simplified100.0%

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        7. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        11. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        12. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu - Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. --lowering--.f6462.8%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified62.8%

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{\left(2 + -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}\right)}\right) \]
      8. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \color{blue}{\left(-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}\right)}\right)\right) \]
        2. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(\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}\right)\right)\right)\right) \]
        3. neg-lowering-neg.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\left(\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}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(-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}\right), KbT\right)\right)\right)\right) \]
      9. Simplified30.9%

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

      if 3.60000000000000003e208 < 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. Simplified100.0%

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \color{blue}{\left(\frac{-1}{4} \cdot \frac{Ec \cdot NdChar}{KbT}\right)}\right) \]
      7. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \color{blue}{\left(\frac{Ec \cdot NdChar}{KbT}\right)}\right)\right) \]
        2. associate-/l*N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \left(Ec \cdot \color{blue}{\frac{NdChar}{KbT}}\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(Ec, \color{blue}{\left(\frac{NdChar}{KbT}\right)}\right)\right)\right) \]
        4. /-lowering-/.f6474.0%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(Ec, \mathsf{/.f64}\left(NdChar, \color{blue}{KbT}\right)\right)\right)\right) \]
      8. Simplified74.0%

        \[\leadsto 0.5 \cdot \left(NaChar + NdChar\right) - \color{blue}{-0.25 \cdot \left(Ec \cdot \frac{NdChar}{KbT}\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification40.9%

      \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -6.5 \cdot 10^{+165}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right) - \frac{Ev}{KbT} \cdot \left(NaChar \cdot 0.25\right)\\ \mathbf{elif}\;KbT \leq 3.6 \cdot 10^{+208}:\\ \;\;\;\;\frac{NdChar}{2 - \frac{\left(\left(\left(Ec - mu\right) - Vef\right) - EDonor\right) + \frac{-0.5 \cdot \left(\left(EDonor + \left(Vef + \left(mu - Ec\right)\right)\right) \cdot \left(EDonor + \left(Vef + \left(mu - Ec\right)\right)\right)\right)}{KbT}}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right) - \left(Ec \cdot \frac{NdChar}{KbT}\right) \cdot -0.25\\ \end{array} \]
    5. Add Preprocessing

    Alternative 11: 34.5% accurate, 8.5× speedup?

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

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
        3. +-lowering-+.f6445.2%

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
      6. Simplified45.2%

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

      if -4.80000000000000009e26 < KbT < 1.10000000000000005e-52

      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. Simplified100.0%

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        7. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        11. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        12. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu - Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. --lowering--.f6460.9%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified60.9%

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Vef}{KbT}\right)}\right)\right)\right) \]
      8. Step-by-step derivation
        1. /-lowering-/.f6439.1%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right)\right)\right)\right) \]
      9. Simplified39.1%

        \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
      10. Taylor expanded in Vef around 0

        \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{\left(2 + Vef \cdot \left(\frac{1}{2} \cdot \frac{Vef}{{KbT}^{2}} + \frac{1}{KbT}\right)\right)}\right) \]
      11. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \color{blue}{\left(Vef \cdot \left(\frac{1}{2} \cdot \frac{Vef}{{KbT}^{2}} + \frac{1}{KbT}\right)\right)}\right)\right) \]
        2. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(Vef, \color{blue}{\left(\frac{1}{2} \cdot \frac{Vef}{{KbT}^{2}} + \frac{1}{KbT}\right)}\right)\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(Vef, \mathsf{+.f64}\left(\left(\frac{1}{2} \cdot \frac{Vef}{{KbT}^{2}}\right), \color{blue}{\left(\frac{1}{KbT}\right)}\right)\right)\right)\right) \]
        4. associate-*r/N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(Vef, \mathsf{+.f64}\left(\left(\frac{\frac{1}{2} \cdot Vef}{{KbT}^{2}}\right), \left(\frac{\color{blue}{1}}{KbT}\right)\right)\right)\right)\right) \]
        5. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(Vef, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\left(\frac{1}{2} \cdot Vef\right), \left({KbT}^{2}\right)\right), \left(\frac{\color{blue}{1}}{KbT}\right)\right)\right)\right)\right) \]
        6. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(Vef, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, Vef\right), \left({KbT}^{2}\right)\right), \left(\frac{1}{KbT}\right)\right)\right)\right)\right) \]
        7. unpow2N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(Vef, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, Vef\right), \left(KbT \cdot KbT\right)\right), \left(\frac{1}{KbT}\right)\right)\right)\right)\right) \]
        8. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(Vef, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, Vef\right), \mathsf{*.f64}\left(KbT, KbT\right)\right), \left(\frac{1}{KbT}\right)\right)\right)\right)\right) \]
        9. /-lowering-/.f6431.4%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(Vef, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, Vef\right), \mathsf{*.f64}\left(KbT, KbT\right)\right), \mathsf{/.f64}\left(1, \color{blue}{KbT}\right)\right)\right)\right)\right) \]
      12. Simplified31.4%

        \[\leadsto \frac{NdChar}{\color{blue}{2 + Vef \cdot \left(\frac{0.5 \cdot Vef}{KbT \cdot KbT} + \frac{1}{KbT}\right)}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification39.1%

      \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -4.8 \cdot 10^{+26}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq 1.1 \cdot 10^{-52}:\\ \;\;\;\;\frac{NdChar}{2 + Vef \cdot \left(\frac{Vef \cdot 0.5}{KbT \cdot KbT} + \frac{1}{KbT}\right)}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 12: 32.9% accurate, 9.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -7.6 \cdot 10^{+165}:\\ \;\;\;\;t\_0 - \frac{Ev}{KbT} \cdot \left(NaChar \cdot 0.25\right)\\ \mathbf{elif}\;KbT \leq 3.95 \cdot 10^{+208}:\\ \;\;\;\;\frac{NdChar}{2 + \frac{Vef - \frac{-0.5 \cdot \left(Vef \cdot Vef\right)}{KbT}}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;t\_0 - \left(Ec \cdot \frac{NdChar}{KbT}\right) \cdot -0.25\\ \end{array} \end{array} \]
    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
     :precision binary64
     (let* ((t_0 (* 0.5 (+ NdChar NaChar))))
       (if (<= KbT -7.6e+165)
         (- t_0 (* (/ Ev KbT) (* NaChar 0.25)))
         (if (<= KbT 3.95e+208)
           (/ NdChar (+ 2.0 (/ (- Vef (/ (* -0.5 (* Vef Vef)) KbT)) KbT)))
           (- t_0 (* (* Ec (/ NdChar KbT)) -0.25))))))
    double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
    	double t_0 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -7.6e+165) {
    		tmp = t_0 - ((Ev / KbT) * (NaChar * 0.25));
    	} else if (KbT <= 3.95e+208) {
    		tmp = NdChar / (2.0 + ((Vef - ((-0.5 * (Vef * Vef)) / KbT)) / KbT));
    	} else {
    		tmp = t_0 - ((Ec * (NdChar / KbT)) * -0.25);
    	}
    	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 = 0.5d0 * (ndchar + nachar)
        if (kbt <= (-7.6d+165)) then
            tmp = t_0 - ((ev / kbt) * (nachar * 0.25d0))
        else if (kbt <= 3.95d+208) then
            tmp = ndchar / (2.0d0 + ((vef - (((-0.5d0) * (vef * vef)) / kbt)) / kbt))
        else
            tmp = t_0 - ((ec * (ndchar / kbt)) * (-0.25d0))
        end if
        code = tmp
    end function
    
    public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
    	double t_0 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -7.6e+165) {
    		tmp = t_0 - ((Ev / KbT) * (NaChar * 0.25));
    	} else if (KbT <= 3.95e+208) {
    		tmp = NdChar / (2.0 + ((Vef - ((-0.5 * (Vef * Vef)) / KbT)) / KbT));
    	} else {
    		tmp = t_0 - ((Ec * (NdChar / KbT)) * -0.25);
    	}
    	return tmp;
    }
    
    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
    	t_0 = 0.5 * (NdChar + NaChar)
    	tmp = 0
    	if KbT <= -7.6e+165:
    		tmp = t_0 - ((Ev / KbT) * (NaChar * 0.25))
    	elif KbT <= 3.95e+208:
    		tmp = NdChar / (2.0 + ((Vef - ((-0.5 * (Vef * Vef)) / KbT)) / KbT))
    	else:
    		tmp = t_0 - ((Ec * (NdChar / KbT)) * -0.25)
    	return tmp
    
    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = Float64(0.5 * Float64(NdChar + NaChar))
    	tmp = 0.0
    	if (KbT <= -7.6e+165)
    		tmp = Float64(t_0 - Float64(Float64(Ev / KbT) * Float64(NaChar * 0.25)));
    	elseif (KbT <= 3.95e+208)
    		tmp = Float64(NdChar / Float64(2.0 + Float64(Float64(Vef - Float64(Float64(-0.5 * Float64(Vef * Vef)) / KbT)) / KbT)));
    	else
    		tmp = Float64(t_0 - Float64(Float64(Ec * Float64(NdChar / KbT)) * -0.25));
    	end
    	return tmp
    end
    
    function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = 0.5 * (NdChar + NaChar);
    	tmp = 0.0;
    	if (KbT <= -7.6e+165)
    		tmp = t_0 - ((Ev / KbT) * (NaChar * 0.25));
    	elseif (KbT <= 3.95e+208)
    		tmp = NdChar / (2.0 + ((Vef - ((-0.5 * (Vef * Vef)) / KbT)) / KbT));
    	else
    		tmp = t_0 - ((Ec * (NdChar / KbT)) * -0.25);
    	end
    	tmp_2 = tmp;
    end
    
    code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -7.6e+165], N[(t$95$0 - N[(N[(Ev / KbT), $MachinePrecision] * N[(NaChar * 0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 3.95e+208], N[(NdChar / N[(2.0 + N[(N[(Vef - N[(N[(-0.5 * N[(Vef * Vef), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(t$95$0 - N[(N[(Ec * N[(NdChar / KbT), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
    \mathbf{if}\;KbT \leq -7.6 \cdot 10^{+165}:\\
    \;\;\;\;t\_0 - \frac{Ev}{KbT} \cdot \left(NaChar \cdot 0.25\right)\\
    
    \mathbf{elif}\;KbT \leq 3.95 \cdot 10^{+208}:\\
    \;\;\;\;\frac{NdChar}{2 + \frac{Vef - \frac{-0.5 \cdot \left(Vef \cdot Vef\right)}{KbT}}{KbT}}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0 - \left(Ec \cdot \frac{NdChar}{KbT}\right) \cdot -0.25\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if KbT < -7.59999999999999981e165

      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. Simplified100.0%

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \color{blue}{\left(\frac{1}{4} \cdot \frac{Ev \cdot NaChar}{KbT}\right)}\right) \]
      7. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \left(\frac{\frac{1}{4} \cdot \left(Ev \cdot NaChar\right)}{\color{blue}{KbT}}\right)\right) \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{/.f64}\left(\left(\frac{1}{4} \cdot \left(Ev \cdot NaChar\right)\right), \color{blue}{KbT}\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \left(Ev \cdot NaChar\right)\right), KbT\right)\right) \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \left(NaChar \cdot Ev\right)\right), KbT\right)\right) \]
        5. *-lowering-*.f6466.3%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{4}, \mathsf{*.f64}\left(NaChar, Ev\right)\right), KbT\right)\right) \]
      8. Simplified66.3%

        \[\leadsto 0.5 \cdot \left(NaChar + NdChar\right) - \color{blue}{\frac{0.25 \cdot \left(NaChar \cdot Ev\right)}{KbT}} \]
      9. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \left(\frac{\left(\frac{1}{4} \cdot NaChar\right) \cdot Ev}{KbT}\right)\right) \]
        2. associate-/l*N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \left(\left(\frac{1}{4} \cdot NaChar\right) \cdot \color{blue}{\frac{Ev}{KbT}}\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\left(\frac{1}{4} \cdot NaChar\right), \color{blue}{\left(\frac{Ev}{KbT}\right)}\right)\right) \]
        4. *-commutativeN/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\left(NaChar \cdot \frac{1}{4}\right), \left(\frac{\color{blue}{Ev}}{KbT}\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(NaChar, \frac{1}{4}\right), \left(\frac{\color{blue}{Ev}}{KbT}\right)\right)\right) \]
        6. /-lowering-/.f6468.8%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\mathsf{*.f64}\left(NaChar, \frac{1}{4}\right), \mathsf{/.f64}\left(Ev, \color{blue}{KbT}\right)\right)\right) \]
      10. Applied egg-rr68.8%

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

      if -7.59999999999999981e165 < KbT < 3.95e208

      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. Simplified100.0%

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        7. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        11. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        12. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu - Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. --lowering--.f6462.8%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified62.8%

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Vef}{KbT}\right)}\right)\right)\right) \]
      8. Step-by-step derivation
        1. /-lowering-/.f6439.4%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right)\right)\right)\right) \]
      9. Simplified39.4%

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{\left(2 + -1 \cdot \frac{-1 \cdot Vef + \frac{-1}{2} \cdot \frac{{Vef}^{2}}{KbT}}{KbT}\right)}\right) \]
      11. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \color{blue}{\left(-1 \cdot \frac{-1 \cdot Vef + \frac{-1}{2} \cdot \frac{{Vef}^{2}}{KbT}}{KbT}\right)}\right)\right) \]
        2. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(\frac{-1 \cdot Vef + \frac{-1}{2} \cdot \frac{{Vef}^{2}}{KbT}}{KbT}\right)\right)\right)\right) \]
        3. neg-lowering-neg.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\left(\frac{-1 \cdot Vef + \frac{-1}{2} \cdot \frac{{Vef}^{2}}{KbT}}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(-1 \cdot Vef + \frac{-1}{2} \cdot \frac{{Vef}^{2}}{KbT}\right), KbT\right)\right)\right)\right) \]
        5. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(-1 \cdot Vef\right), \left(\frac{-1}{2} \cdot \frac{{Vef}^{2}}{KbT}\right)\right), KbT\right)\right)\right)\right) \]
        6. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(\mathsf{neg}\left(Vef\right)\right), \left(\frac{-1}{2} \cdot \frac{{Vef}^{2}}{KbT}\right)\right), KbT\right)\right)\right)\right) \]
        7. neg-lowering-neg.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(Vef\right), \left(\frac{-1}{2} \cdot \frac{{Vef}^{2}}{KbT}\right)\right), KbT\right)\right)\right)\right) \]
        8. associate-*r/N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(Vef\right), \left(\frac{\frac{-1}{2} \cdot {Vef}^{2}}{KbT}\right)\right), KbT\right)\right)\right)\right) \]
        9. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(Vef\right), \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot {Vef}^{2}\right), KbT\right)\right), KbT\right)\right)\right)\right) \]
        10. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(Vef\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left({Vef}^{2}\right)\right), KbT\right)\right), KbT\right)\right)\right)\right) \]
        11. unpow2N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(Vef\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(Vef \cdot Vef\right)\right), KbT\right)\right), KbT\right)\right)\right)\right) \]
        12. *-lowering-*.f6427.9%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(Vef\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(Vef, Vef\right)\right), KbT\right)\right), KbT\right)\right)\right)\right) \]
      12. Simplified27.9%

        \[\leadsto \frac{NdChar}{\color{blue}{2 + \left(-\frac{\left(-Vef\right) + \frac{-0.5 \cdot \left(Vef \cdot Vef\right)}{KbT}}{KbT}\right)}} \]

      if 3.95e208 < 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. Simplified100.0%

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

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

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

        \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \color{blue}{\left(\frac{-1}{4} \cdot \frac{Ec \cdot NdChar}{KbT}\right)}\right) \]
      7. Step-by-step derivation
        1. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \color{blue}{\left(\frac{Ec \cdot NdChar}{KbT}\right)}\right)\right) \]
        2. associate-/l*N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \left(Ec \cdot \color{blue}{\frac{NdChar}{KbT}}\right)\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(Ec, \color{blue}{\left(\frac{NdChar}{KbT}\right)}\right)\right)\right) \]
        4. /-lowering-/.f6474.0%

          \[\leadsto \mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{*.f64}\left(Ec, \mathsf{/.f64}\left(NdChar, \color{blue}{KbT}\right)\right)\right)\right) \]
      8. Simplified74.0%

        \[\leadsto 0.5 \cdot \left(NaChar + NdChar\right) - \color{blue}{-0.25 \cdot \left(Ec \cdot \frac{NdChar}{KbT}\right)} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification38.6%

      \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -7.6 \cdot 10^{+165}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right) - \frac{Ev}{KbT} \cdot \left(NaChar \cdot 0.25\right)\\ \mathbf{elif}\;KbT \leq 3.95 \cdot 10^{+208}:\\ \;\;\;\;\frac{NdChar}{2 + \frac{Vef - \frac{-0.5 \cdot \left(Vef \cdot Vef\right)}{KbT}}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right) - \left(Ec \cdot \frac{NdChar}{KbT}\right) \cdot -0.25\\ \end{array} \]
    5. Add Preprocessing

    Alternative 13: 33.2% accurate, 9.1× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -5.4 \cdot 10^{+117}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 2.15 \cdot 10^{-54}:\\ \;\;\;\;\frac{NaChar}{2 + \frac{Vef - -0.5 \cdot \frac{Vef \cdot Vef}{KbT}}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
     :precision binary64
     (let* ((t_0 (* 0.5 (+ NdChar NaChar))))
       (if (<= KbT -5.4e+117)
         t_0
         (if (<= KbT 2.15e-54)
           (/ NaChar (+ 2.0 (/ (- Vef (* -0.5 (/ (* Vef Vef) KbT))) KbT)))
           t_0))))
    double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
    	double t_0 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -5.4e+117) {
    		tmp = t_0;
    	} else if (KbT <= 2.15e-54) {
    		tmp = NaChar / (2.0 + ((Vef - (-0.5 * ((Vef * Vef) / KbT))) / 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 = 0.5d0 * (ndchar + nachar)
        if (kbt <= (-5.4d+117)) then
            tmp = t_0
        else if (kbt <= 2.15d-54) then
            tmp = nachar / (2.0d0 + ((vef - ((-0.5d0) * ((vef * vef) / kbt))) / kbt))
        else
            tmp = t_0
        end if
        code = tmp
    end function
    
    public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
    	double t_0 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -5.4e+117) {
    		tmp = t_0;
    	} else if (KbT <= 2.15e-54) {
    		tmp = NaChar / (2.0 + ((Vef - (-0.5 * ((Vef * Vef) / KbT))) / KbT));
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
    	t_0 = 0.5 * (NdChar + NaChar)
    	tmp = 0
    	if KbT <= -5.4e+117:
    		tmp = t_0
    	elif KbT <= 2.15e-54:
    		tmp = NaChar / (2.0 + ((Vef - (-0.5 * ((Vef * Vef) / KbT))) / KbT))
    	else:
    		tmp = t_0
    	return tmp
    
    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = Float64(0.5 * Float64(NdChar + NaChar))
    	tmp = 0.0
    	if (KbT <= -5.4e+117)
    		tmp = t_0;
    	elseif (KbT <= 2.15e-54)
    		tmp = Float64(NaChar / Float64(2.0 + Float64(Float64(Vef - Float64(-0.5 * Float64(Float64(Vef * Vef) / KbT))) / KbT)));
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = 0.5 * (NdChar + NaChar);
    	tmp = 0.0;
    	if (KbT <= -5.4e+117)
    		tmp = t_0;
    	elseif (KbT <= 2.15e-54)
    		tmp = NaChar / (2.0 + ((Vef - (-0.5 * ((Vef * Vef) / KbT))) / KbT));
    	else
    		tmp = t_0;
    	end
    	tmp_2 = tmp;
    end
    
    code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -5.4e+117], t$95$0, If[LessEqual[KbT, 2.15e-54], N[(NaChar / N[(2.0 + N[(N[(Vef - N[(-0.5 * N[(N[(Vef * Vef), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
    \mathbf{if}\;KbT \leq -5.4 \cdot 10^{+117}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;KbT \leq 2.15 \cdot 10^{-54}:\\
    \;\;\;\;\frac{NaChar}{2 + \frac{Vef - -0.5 \cdot \frac{Vef \cdot Vef}{KbT}}{KbT}}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if KbT < -5.4000000000000005e117 or 2.15e-54 < 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. Simplified100.0%

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
        3. +-lowering-+.f6449.9%

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
      6. Simplified49.9%

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

      if -5.4000000000000005e117 < KbT < 2.15e-54

      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. Simplified100.0%

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
        6. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        7. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        11. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        12. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef - mu\right)\right), KbT\right)\right)\right)\right) \]
        14. --lowering--.f6471.9%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \mathsf{\_.f64}\left(Vef, mu\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified71.9%

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Vef}{KbT}\right)}\right)\right)\right) \]
      8. Step-by-step derivation
        1. /-lowering-/.f6442.8%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right)\right)\right)\right) \]
      9. Simplified42.8%

        \[\leadsto \frac{NaChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
      10. Taylor expanded in KbT around -inf

        \[\leadsto \mathsf{/.f64}\left(NaChar, \color{blue}{\left(2 + -1 \cdot \frac{-1 \cdot Vef + \frac{-1}{2} \cdot \frac{{Vef}^{2}}{KbT}}{KbT}\right)}\right) \]
      11. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \left(2 + \left(\mathsf{neg}\left(\frac{-1 \cdot Vef + \frac{-1}{2} \cdot \frac{{Vef}^{2}}{KbT}}{KbT}\right)\right)\right)\right) \]
        2. unsub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \left(2 - \color{blue}{\frac{-1 \cdot Vef + \frac{-1}{2} \cdot \frac{{Vef}^{2}}{KbT}}{KbT}}\right)\right) \]
        3. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \color{blue}{\left(\frac{-1 \cdot Vef + \frac{-1}{2} \cdot \frac{{Vef}^{2}}{KbT}}{KbT}\right)}\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(-1 \cdot Vef + \frac{-1}{2} \cdot \frac{{Vef}^{2}}{KbT}\right), \color{blue}{KbT}\right)\right)\right) \]
        5. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot \frac{{Vef}^{2}}{KbT} + -1 \cdot Vef\right), KbT\right)\right)\right) \]
        6. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot \frac{{Vef}^{2}}{KbT} + \left(\mathsf{neg}\left(Vef\right)\right)\right), KbT\right)\right)\right) \]
        7. unsub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot \frac{{Vef}^{2}}{KbT} - Vef\right), KbT\right)\right)\right) \]
        8. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\frac{-1}{2} \cdot \frac{{Vef}^{2}}{KbT}\right), Vef\right), KbT\right)\right)\right) \]
        9. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(\frac{{Vef}^{2}}{KbT}\right)\right), Vef\right), KbT\right)\right)\right) \]
        10. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\left({Vef}^{2}\right), KbT\right)\right), Vef\right), KbT\right)\right)\right) \]
        11. unpow2N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\left(Vef \cdot Vef\right), KbT\right)\right), Vef\right), KbT\right)\right)\right) \]
        12. *-lowering-*.f6427.5%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(Vef, Vef\right), KbT\right)\right), Vef\right), KbT\right)\right)\right) \]
      12. Simplified27.5%

        \[\leadsto \frac{NaChar}{\color{blue}{2 - \frac{-0.5 \cdot \frac{Vef \cdot Vef}{KbT} - Vef}{KbT}}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification38.3%

      \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -5.4 \cdot 10^{+117}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq 2.15 \cdot 10^{-54}:\\ \;\;\;\;\frac{NaChar}{2 + \frac{Vef - -0.5 \cdot \frac{Vef \cdot Vef}{KbT}}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 14: 33.5% accurate, 9.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -6.8 \cdot 10^{+25}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 2.15 \cdot 10^{-61}:\\ \;\;\;\;\frac{NdChar}{2 + \frac{EDonor + \left(\left(Vef + mu\right) - Ec\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 (* 0.5 (+ NdChar NaChar))))
       (if (<= KbT -6.8e+25)
         t_0
         (if (<= KbT 2.15e-61)
           (/ NdChar (+ 2.0 (/ (+ EDonor (- (+ Vef mu) 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 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -6.8e+25) {
    		tmp = t_0;
    	} else if (KbT <= 2.15e-61) {
    		tmp = NdChar / (2.0 + ((EDonor + ((Vef + mu) - 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 = 0.5d0 * (ndchar + nachar)
        if (kbt <= (-6.8d+25)) then
            tmp = t_0
        else if (kbt <= 2.15d-61) then
            tmp = ndchar / (2.0d0 + ((edonor + ((vef + mu) - 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 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -6.8e+25) {
    		tmp = t_0;
    	} else if (KbT <= 2.15e-61) {
    		tmp = NdChar / (2.0 + ((EDonor + ((Vef + mu) - Ec)) / KbT));
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
    	t_0 = 0.5 * (NdChar + NaChar)
    	tmp = 0
    	if KbT <= -6.8e+25:
    		tmp = t_0
    	elif KbT <= 2.15e-61:
    		tmp = NdChar / (2.0 + ((EDonor + ((Vef + mu) - Ec)) / KbT))
    	else:
    		tmp = t_0
    	return tmp
    
    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = Float64(0.5 * Float64(NdChar + NaChar))
    	tmp = 0.0
    	if (KbT <= -6.8e+25)
    		tmp = t_0;
    	elseif (KbT <= 2.15e-61)
    		tmp = Float64(NdChar / Float64(2.0 + Float64(Float64(EDonor + Float64(Float64(Vef + mu) - 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 = 0.5 * (NdChar + NaChar);
    	tmp = 0.0;
    	if (KbT <= -6.8e+25)
    		tmp = t_0;
    	elseif (KbT <= 2.15e-61)
    		tmp = NdChar / (2.0 + ((EDonor + ((Vef + mu) - 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[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -6.8e+25], t$95$0, If[LessEqual[KbT, 2.15e-61], N[(NdChar / N[(2.0 + N[(N[(EDonor + N[(N[(Vef + mu), $MachinePrecision] - Ec), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
    \mathbf{if}\;KbT \leq -6.8 \cdot 10^{+25}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;KbT \leq 2.15 \cdot 10^{-61}:\\
    \;\;\;\;\frac{NdChar}{2 + \frac{EDonor + \left(\left(Vef + mu\right) - Ec\right)}{KbT}}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if KbT < -6.79999999999999967e25 or 2.1500000000000002e-61 < 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. Simplified100.0%

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
        3. +-lowering-+.f6444.7%

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
      6. Simplified44.7%

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

      if -6.79999999999999967e25 < KbT < 2.1500000000000002e-61

      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. Simplified100.0%

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        7. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        11. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        12. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu - Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. --lowering--.f6461.1%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified61.1%

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{\left(2 + -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}\right)}\right) \]
      8. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \color{blue}{\left(-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}\right)}\right)\right) \]
        2. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(\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}\right)\right)\right)\right) \]
        3. neg-lowering-neg.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\left(\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}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(-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}\right), KbT\right)\right)\right)\right) \]
      9. Simplified30.1%

        \[\leadsto \frac{NdChar}{\color{blue}{2 + \left(-\frac{\left(-\left(EDonor + \left(Vef + \left(mu - Ec\right)\right)\right)\right) + \frac{-0.5 \cdot \left(\left(EDonor + \left(Vef + \left(mu - Ec\right)\right)\right) \cdot \left(EDonor + \left(Vef + \left(mu - Ec\right)\right)\right)\right)}{KbT}}{KbT}\right)}} \]
      10. Taylor expanded in KbT around inf

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \color{blue}{\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)}\right)\right) \]
      11. Step-by-step derivation
        1. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), \color{blue}{KbT}\right)\right)\right) \]
        2. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{/.f64}\left(\left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right) \]
        3. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right) \]
        4. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{\_.f64}\left(\left(Vef + mu\right), Ec\right)\right), KbT\right)\right)\right) \]
        5. +-lowering-+.f6428.8%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(Vef, mu\right), Ec\right)\right), KbT\right)\right)\right) \]
      12. Simplified28.8%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -6.8 \cdot 10^{+25}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq 2.15 \cdot 10^{-61}:\\ \;\;\;\;\frac{NdChar}{2 + \frac{EDonor + \left(\left(Vef + mu\right) - Ec\right)}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 15: 31.6% accurate, 10.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -2.8 \cdot 10^{+117}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 2.7 \cdot 10^{-53}:\\ \;\;\;\;\frac{NdChar}{\frac{0.5 \cdot \left(Vef \cdot Vef\right)}{KbT \cdot KbT}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
     :precision binary64
     (let* ((t_0 (* 0.5 (+ NdChar NaChar))))
       (if (<= KbT -2.8e+117)
         t_0
         (if (<= KbT 2.7e-53)
           (/ NdChar (/ (* 0.5 (* Vef Vef)) (* KbT KbT)))
           t_0))))
    double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
    	double t_0 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -2.8e+117) {
    		tmp = t_0;
    	} else if (KbT <= 2.7e-53) {
    		tmp = NdChar / ((0.5 * (Vef * Vef)) / (KbT * 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 = 0.5d0 * (ndchar + nachar)
        if (kbt <= (-2.8d+117)) then
            tmp = t_0
        else if (kbt <= 2.7d-53) then
            tmp = ndchar / ((0.5d0 * (vef * vef)) / (kbt * kbt))
        else
            tmp = t_0
        end if
        code = tmp
    end function
    
    public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
    	double t_0 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -2.8e+117) {
    		tmp = t_0;
    	} else if (KbT <= 2.7e-53) {
    		tmp = NdChar / ((0.5 * (Vef * Vef)) / (KbT * KbT));
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
    	t_0 = 0.5 * (NdChar + NaChar)
    	tmp = 0
    	if KbT <= -2.8e+117:
    		tmp = t_0
    	elif KbT <= 2.7e-53:
    		tmp = NdChar / ((0.5 * (Vef * Vef)) / (KbT * KbT))
    	else:
    		tmp = t_0
    	return tmp
    
    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = Float64(0.5 * Float64(NdChar + NaChar))
    	tmp = 0.0
    	if (KbT <= -2.8e+117)
    		tmp = t_0;
    	elseif (KbT <= 2.7e-53)
    		tmp = Float64(NdChar / Float64(Float64(0.5 * Float64(Vef * Vef)) / Float64(KbT * KbT)));
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = 0.5 * (NdChar + NaChar);
    	tmp = 0.0;
    	if (KbT <= -2.8e+117)
    		tmp = t_0;
    	elseif (KbT <= 2.7e-53)
    		tmp = NdChar / ((0.5 * (Vef * Vef)) / (KbT * KbT));
    	else
    		tmp = t_0;
    	end
    	tmp_2 = tmp;
    end
    
    code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -2.8e+117], t$95$0, If[LessEqual[KbT, 2.7e-53], N[(NdChar / N[(N[(0.5 * N[(Vef * Vef), $MachinePrecision]), $MachinePrecision] / N[(KbT * KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
    \mathbf{if}\;KbT \leq -2.8 \cdot 10^{+117}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;KbT \leq 2.7 \cdot 10^{-53}:\\
    \;\;\;\;\frac{NdChar}{\frac{0.5 \cdot \left(Vef \cdot Vef\right)}{KbT \cdot KbT}}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if KbT < -2.79999999999999997e117 or 2.6999999999999999e-53 < 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. Simplified100.0%

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
        3. +-lowering-+.f6449.9%

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
      6. Simplified49.9%

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

      if -2.79999999999999997e117 < KbT < 2.6999999999999999e-53

      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. Simplified100.0%

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        7. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        11. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        12. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu - Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. --lowering--.f6458.8%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified58.8%

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{\left(2 + -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}\right)}\right) \]
      8. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \color{blue}{\left(-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}\right)}\right)\right) \]
        2. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \left(\mathsf{neg}\left(\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}\right)\right)\right)\right) \]
        3. neg-lowering-neg.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\left(\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}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(-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}\right), KbT\right)\right)\right)\right) \]
      9. Simplified29.2%

        \[\leadsto \frac{NdChar}{\color{blue}{2 + \left(-\frac{\left(-\left(EDonor + \left(Vef + \left(mu - Ec\right)\right)\right)\right) + \frac{-0.5 \cdot \left(\left(EDonor + \left(Vef + \left(mu - Ec\right)\right)\right) \cdot \left(EDonor + \left(Vef + \left(mu - Ec\right)\right)\right)\right)}{KbT}}{KbT}\right)}} \]
      10. Taylor expanded in Vef around inf

        \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{\left(\frac{1}{2} \cdot \frac{{Vef}^{2}}{{KbT}^{2}}\right)}\right) \]
      11. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \left(\frac{\frac{1}{2} \cdot {Vef}^{2}}{\color{blue}{{KbT}^{2}}}\right)\right) \]
        2. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{/.f64}\left(\left(\frac{1}{2} \cdot {Vef}^{2}\right), \color{blue}{\left({KbT}^{2}\right)}\right)\right) \]
        3. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left({Vef}^{2}\right)\right), \left({\color{blue}{KbT}}^{2}\right)\right)\right) \]
        4. unpow2N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(Vef \cdot Vef\right)\right), \left({KbT}^{2}\right)\right)\right) \]
        5. *-lowering-*.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(Vef, Vef\right)\right), \left({KbT}^{2}\right)\right)\right) \]
        6. unpow2N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(Vef, Vef\right)\right), \left(KbT \cdot \color{blue}{KbT}\right)\right)\right) \]
        7. *-lowering-*.f6425.2%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(Vef, Vef\right)\right), \mathsf{*.f64}\left(KbT, \color{blue}{KbT}\right)\right)\right) \]
      12. Simplified25.2%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -2.8 \cdot 10^{+117}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq 2.7 \cdot 10^{-53}:\\ \;\;\;\;\frac{NdChar}{\frac{0.5 \cdot \left(Vef \cdot Vef\right)}{KbT \cdot KbT}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 16: 31.1% accurate, 13.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -9 \cdot 10^{+23}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 2 \cdot 10^{-83}:\\ \;\;\;\;\frac{NdChar}{2 + \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 (* 0.5 (+ NdChar NaChar))))
       (if (<= KbT -9e+23)
         t_0
         (if (<= KbT 2e-83) (/ NdChar (+ 2.0 (/ 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 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -9e+23) {
    		tmp = t_0;
    	} else if (KbT <= 2e-83) {
    		tmp = NdChar / (2.0 + (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 = 0.5d0 * (ndchar + nachar)
        if (kbt <= (-9d+23)) then
            tmp = t_0
        else if (kbt <= 2d-83) then
            tmp = ndchar / (2.0d0 + (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 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -9e+23) {
    		tmp = t_0;
    	} else if (KbT <= 2e-83) {
    		tmp = NdChar / (2.0 + (Vef / KbT));
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
    	t_0 = 0.5 * (NdChar + NaChar)
    	tmp = 0
    	if KbT <= -9e+23:
    		tmp = t_0
    	elif KbT <= 2e-83:
    		tmp = NdChar / (2.0 + (Vef / KbT))
    	else:
    		tmp = t_0
    	return tmp
    
    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = Float64(0.5 * Float64(NdChar + NaChar))
    	tmp = 0.0
    	if (KbT <= -9e+23)
    		tmp = t_0;
    	elseif (KbT <= 2e-83)
    		tmp = Float64(NdChar / Float64(2.0 + 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 = 0.5 * (NdChar + NaChar);
    	tmp = 0.0;
    	if (KbT <= -9e+23)
    		tmp = t_0;
    	elseif (KbT <= 2e-83)
    		tmp = NdChar / (2.0 + (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[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -9e+23], t$95$0, If[LessEqual[KbT, 2e-83], N[(NdChar / N[(2.0 + N[(Vef / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
    \mathbf{if}\;KbT \leq -9 \cdot 10^{+23}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;KbT \leq 2 \cdot 10^{-83}:\\
    \;\;\;\;\frac{NdChar}{2 + \frac{Vef}{KbT}}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if KbT < -8.99999999999999958e23 or 2.0000000000000001e-83 < 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. Simplified100.0%

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
        3. +-lowering-+.f6443.6%

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
      6. Simplified43.6%

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

      if -8.99999999999999958e23 < KbT < 2.0000000000000001e-83

      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. Simplified100.0%

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        7. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        11. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        12. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu - Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. --lowering--.f6461.1%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified61.1%

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Vef}{KbT}\right)}\right)\right)\right) \]
      8. Step-by-step derivation
        1. /-lowering-/.f6438.6%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right)\right)\right)\right) \]
      9. Simplified38.6%

        \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
      10. Taylor expanded in Vef around 0

        \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{\left(2 + \frac{Vef}{KbT}\right)}\right) \]
      11. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \left(\frac{Vef}{KbT} + \color{blue}{2}\right)\right) \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(\left(\frac{Vef}{KbT}\right), \color{blue}{2}\right)\right) \]
        3. /-lowering-/.f6422.2%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right), 2\right)\right) \]
      12. Simplified22.2%

        \[\leadsto \frac{NdChar}{\color{blue}{\frac{Vef}{KbT} + 2}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification34.7%

      \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -9 \cdot 10^{+23}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq 2 \cdot 10^{-83}:\\ \;\;\;\;\frac{NdChar}{2 + \frac{Vef}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 17: 31.1% accurate, 13.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -3.35 \cdot 10^{-15}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 7 \cdot 10^{-58}:\\ \;\;\;\;\frac{NaChar}{2 + \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 (* 0.5 (+ NdChar NaChar))))
       (if (<= KbT -3.35e-15)
         t_0
         (if (<= KbT 7e-58) (/ NaChar (+ 2.0 (/ 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 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -3.35e-15) {
    		tmp = t_0;
    	} else if (KbT <= 7e-58) {
    		tmp = NaChar / (2.0 + (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 = 0.5d0 * (ndchar + nachar)
        if (kbt <= (-3.35d-15)) then
            tmp = t_0
        else if (kbt <= 7d-58) then
            tmp = nachar / (2.0d0 + (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 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -3.35e-15) {
    		tmp = t_0;
    	} else if (KbT <= 7e-58) {
    		tmp = NaChar / (2.0 + (Vef / KbT));
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
    	t_0 = 0.5 * (NdChar + NaChar)
    	tmp = 0
    	if KbT <= -3.35e-15:
    		tmp = t_0
    	elif KbT <= 7e-58:
    		tmp = NaChar / (2.0 + (Vef / KbT))
    	else:
    		tmp = t_0
    	return tmp
    
    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = Float64(0.5 * Float64(NdChar + NaChar))
    	tmp = 0.0
    	if (KbT <= -3.35e-15)
    		tmp = t_0;
    	elseif (KbT <= 7e-58)
    		tmp = Float64(NaChar / Float64(2.0 + 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 = 0.5 * (NdChar + NaChar);
    	tmp = 0.0;
    	if (KbT <= -3.35e-15)
    		tmp = t_0;
    	elseif (KbT <= 7e-58)
    		tmp = NaChar / (2.0 + (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[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -3.35e-15], t$95$0, If[LessEqual[KbT, 7e-58], N[(NaChar / N[(2.0 + N[(Vef / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
    \mathbf{if}\;KbT \leq -3.35 \cdot 10^{-15}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;KbT \leq 7 \cdot 10^{-58}:\\
    \;\;\;\;\frac{NaChar}{2 + \frac{Vef}{KbT}}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if KbT < -3.35e-15 or 6.9999999999999998e-58 < 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. Simplified100.0%

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

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

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

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
        3. +-lowering-+.f6444.0%

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
      6. Simplified44.0%

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

      if -3.35e-15 < KbT < 6.9999999999999998e-58

      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. Simplified100.0%

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
        6. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        7. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        11. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        12. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef - mu\right)\right), KbT\right)\right)\right)\right) \]
        14. --lowering--.f6472.1%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \mathsf{\_.f64}\left(Vef, mu\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified72.1%

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Vef}{KbT}\right)}\right)\right)\right) \]
      8. Step-by-step derivation
        1. /-lowering-/.f6441.5%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right)\right)\right)\right) \]
      9. Simplified41.5%

        \[\leadsto \frac{NaChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
      10. Taylor expanded in Vef around 0

        \[\leadsto \mathsf{/.f64}\left(NaChar, \color{blue}{\left(2 + \frac{Vef}{KbT}\right)}\right) \]
      11. Step-by-step derivation
        1. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \left(\frac{Vef}{KbT} + \color{blue}{2}\right)\right) \]
        2. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(\left(\frac{Vef}{KbT}\right), \color{blue}{2}\right)\right) \]
        3. /-lowering-/.f6420.9%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right), 2\right)\right) \]
      12. Simplified20.9%

        \[\leadsto \frac{NaChar}{\color{blue}{\frac{Vef}{KbT} + 2}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification34.5%

      \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -3.35 \cdot 10^{-15}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq 7 \cdot 10^{-58}:\\ \;\;\;\;\frac{NaChar}{2 + \frac{Vef}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 18: 22.9% accurate, 17.6× speedup?

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

      1. Initial program 100.0%

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EDonor + \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) - Ec\right)\right), KbT\right)\right)\right)\right) \]
        7. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(\left(Vef + mu\right) + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \left(Vef + \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + -1 \cdot Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        11. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu + \left(\mathsf{neg}\left(Ec\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        12. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \left(mu - Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. --lowering--.f6472.6%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified72.6%

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{2}\right) \]
      8. Step-by-step derivation
        1. Simplified28.2%

          \[\leadsto \frac{NdChar}{\color{blue}{2}} \]

        if -3.0000000000000002e121 < NdChar < 9.49999999999999964e-85

        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. Simplified100.0%

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
          4. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
          5. associate--l+N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
          6. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
          7. associate-+r+N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
          8. mul-1-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
          9. associate-+r+N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          10. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          11. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          12. mul-1-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
          13. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef - mu\right)\right), KbT\right)\right)\right)\right) \]
          14. --lowering--.f6473.7%

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \mathsf{\_.f64}\left(Vef, mu\right)\right), KbT\right)\right)\right)\right) \]
        6. Simplified73.7%

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \color{blue}{2}\right) \]
        8. Step-by-step derivation
          1. Simplified25.2%

            \[\leadsto \frac{NaChar}{\color{blue}{2}} \]
        9. Recombined 2 regimes into one program.
        10. Add Preprocessing

        Alternative 19: 28.4% accurate, 45.8× speedup?

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
          3. +-lowering-+.f6429.5%

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
        6. Simplified29.5%

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

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

        Alternative 20: 18.8% accurate, 76.3× speedup?

        \[\begin{array}{l} \\ \frac{NaChar}{2} \end{array} \]
        (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
         :precision binary64
         (/ NaChar 2.0))
        double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
        	return NaChar / 2.0;
        }
        
        real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
            real(8), intent (in) :: ndchar
            real(8), intent (in) :: ec
            real(8), intent (in) :: vef
            real(8), intent (in) :: edonor
            real(8), intent (in) :: mu
            real(8), intent (in) :: kbt
            real(8), intent (in) :: nachar
            real(8), intent (in) :: ev
            real(8), intent (in) :: eaccept
            code = nachar / 2.0d0
        end function
        
        public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
        	return NaChar / 2.0;
        }
        
        def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
        	return NaChar / 2.0
        
        function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
        	return Float64(NaChar / 2.0)
        end
        
        function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
        	tmp = NaChar / 2.0;
        end
        
        code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(NaChar / 2.0), $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        \frac{NaChar}{2}
        \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. Simplified100.0%

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
          4. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
          5. associate--l+N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
          6. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
          7. associate-+r+N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
          8. mul-1-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
          9. associate-+r+N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          10. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          11. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          12. mul-1-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
          13. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef - mu\right)\right), KbT\right)\right)\right)\right) \]
          14. --lowering--.f6461.3%

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \mathsf{\_.f64}\left(Vef, mu\right)\right), KbT\right)\right)\right)\right) \]
        6. Simplified61.3%

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \color{blue}{2}\right) \]
        8. Step-by-step derivation
          1. Simplified18.1%

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

          Reproduce

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