Bulmash initializePoisson

Percentage Accurate: 100.0% → 100.0%
Time: 17.9s
Alternatives: 21
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 21 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(Ev - mu\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 (- Ev mu))) KbT)) 1.0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
	return (NdChar / (exp(((Vef + (mu + (EDonor - Ec))) / KbT)) + 1.0)) + (NaChar / (exp(((Vef + (EAccept + (Ev - mu))) / KbT)) + 1.0));
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
    real(8), intent (in) :: ndchar
    real(8), intent (in) :: ec
    real(8), intent (in) :: vef
    real(8), intent (in) :: edonor
    real(8), intent (in) :: mu
    real(8), intent (in) :: kbt
    real(8), intent (in) :: nachar
    real(8), intent (in) :: ev
    real(8), intent (in) :: eaccept
    code = (ndchar / (exp(((vef + (mu + (edonor - ec))) / kbt)) + 1.0d0)) + (nachar / (exp(((vef + (eaccept + (ev - mu))) / kbt)) + 1.0d0))
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
	return (NdChar / (Math.exp(((Vef + (mu + (EDonor - Ec))) / KbT)) + 1.0)) + (NaChar / (Math.exp(((Vef + (EAccept + (Ev - mu))) / 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 + (Ev - mu))) / 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(Ev - mu))) / 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 + (Ev - mu))) / 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[(Ev - mu), $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(Ev - mu\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(Ev - mu\right)\right)}{KbT}} + 1} \]
  5. Add Preprocessing

Alternative 2: 37.7% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{\frac{Vef}{KbT}} + 1\\ \mathbf{if}\;Ev \leq -5 \cdot 10^{+125}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\ \mathbf{elif}\;Ev \leq -2.5 \cdot 10^{-134}:\\ \;\;\;\;\frac{NaChar}{t\_0}\\ \mathbf{elif}\;Ev \leq -1.1 \cdot 10^{-227}:\\ \;\;\;\;\frac{NdChar}{t\_0}\\ \mathbf{elif}\;Ev \leq 1.55 \cdot 10^{-134}:\\ \;\;\;\;\frac{NaChar}{e^{0 - \frac{mu}{KbT}} + 1}\\ \mathbf{elif}\;Ev \leq 3.7:\\ \;\;\;\;\frac{NdChar}{e^{\frac{mu}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 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)))
   (if (<= Ev -5e+125)
     (/ NaChar (+ (exp (/ Ev KbT)) 1.0))
     (if (<= Ev -2.5e-134)
       (/ NaChar t_0)
       (if (<= Ev -1.1e-227)
         (/ NdChar t_0)
         (if (<= Ev 1.55e-134)
           (/ NaChar (+ (exp (- 0.0 (/ mu KbT))) 1.0))
           (if (<= Ev 3.7)
             (/ NdChar (+ (exp (/ mu KbT)) 1.0))
             (/ NaChar (+ (exp (/ EAccept KbT)) 1.0)))))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
	double t_0 = exp((Vef / KbT)) + 1.0;
	double tmp;
	if (Ev <= -5e+125) {
		tmp = NaChar / (exp((Ev / KbT)) + 1.0);
	} else if (Ev <= -2.5e-134) {
		tmp = NaChar / t_0;
	} else if (Ev <= -1.1e-227) {
		tmp = NdChar / t_0;
	} else if (Ev <= 1.55e-134) {
		tmp = NaChar / (exp((0.0 - (mu / KbT))) + 1.0);
	} else if (Ev <= 3.7) {
		tmp = NdChar / (exp((mu / KbT)) + 1.0);
	} else {
		tmp = NaChar / (exp((EAccept / KbT)) + 1.0);
	}
	return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
    real(8), intent (in) :: ndchar
    real(8), intent (in) :: ec
    real(8), intent (in) :: vef
    real(8), intent (in) :: edonor
    real(8), intent (in) :: mu
    real(8), intent (in) :: kbt
    real(8), intent (in) :: nachar
    real(8), intent (in) :: ev
    real(8), intent (in) :: eaccept
    real(8) :: t_0
    real(8) :: tmp
    t_0 = exp((vef / kbt)) + 1.0d0
    if (ev <= (-5d+125)) then
        tmp = nachar / (exp((ev / kbt)) + 1.0d0)
    else if (ev <= (-2.5d-134)) then
        tmp = nachar / t_0
    else if (ev <= (-1.1d-227)) then
        tmp = ndchar / t_0
    else if (ev <= 1.55d-134) then
        tmp = nachar / (exp((0.0d0 - (mu / kbt))) + 1.0d0)
    else if (ev <= 3.7d0) then
        tmp = ndchar / (exp((mu / kbt)) + 1.0d0)
    else
        tmp = nachar / (exp((eaccept / kbt)) + 1.0d0)
    end if
    code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
	double t_0 = Math.exp((Vef / KbT)) + 1.0;
	double tmp;
	if (Ev <= -5e+125) {
		tmp = NaChar / (Math.exp((Ev / KbT)) + 1.0);
	} else if (Ev <= -2.5e-134) {
		tmp = NaChar / t_0;
	} else if (Ev <= -1.1e-227) {
		tmp = NdChar / t_0;
	} else if (Ev <= 1.55e-134) {
		tmp = NaChar / (Math.exp((0.0 - (mu / KbT))) + 1.0);
	} else if (Ev <= 3.7) {
		tmp = NdChar / (Math.exp((mu / KbT)) + 1.0);
	} else {
		tmp = NaChar / (Math.exp((EAccept / KbT)) + 1.0);
	}
	return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
	t_0 = math.exp((Vef / KbT)) + 1.0
	tmp = 0
	if Ev <= -5e+125:
		tmp = NaChar / (math.exp((Ev / KbT)) + 1.0)
	elif Ev <= -2.5e-134:
		tmp = NaChar / t_0
	elif Ev <= -1.1e-227:
		tmp = NdChar / t_0
	elif Ev <= 1.55e-134:
		tmp = NaChar / (math.exp((0.0 - (mu / KbT))) + 1.0)
	elif Ev <= 3.7:
		tmp = NdChar / (math.exp((mu / KbT)) + 1.0)
	else:
		tmp = NaChar / (math.exp((EAccept / KbT)) + 1.0)
	return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	t_0 = Float64(exp(Float64(Vef / KbT)) + 1.0)
	tmp = 0.0
	if (Ev <= -5e+125)
		tmp = Float64(NaChar / Float64(exp(Float64(Ev / KbT)) + 1.0));
	elseif (Ev <= -2.5e-134)
		tmp = Float64(NaChar / t_0);
	elseif (Ev <= -1.1e-227)
		tmp = Float64(NdChar / t_0);
	elseif (Ev <= 1.55e-134)
		tmp = Float64(NaChar / Float64(exp(Float64(0.0 - Float64(mu / KbT))) + 1.0));
	elseif (Ev <= 3.7)
		tmp = Float64(NdChar / Float64(exp(Float64(mu / KbT)) + 1.0));
	else
		tmp = Float64(NaChar / Float64(exp(Float64(EAccept / KbT)) + 1.0));
	end
	return tmp
end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	t_0 = exp((Vef / KbT)) + 1.0;
	tmp = 0.0;
	if (Ev <= -5e+125)
		tmp = NaChar / (exp((Ev / KbT)) + 1.0);
	elseif (Ev <= -2.5e-134)
		tmp = NaChar / t_0;
	elseif (Ev <= -1.1e-227)
		tmp = NdChar / t_0;
	elseif (Ev <= 1.55e-134)
		tmp = NaChar / (exp((0.0 - (mu / KbT))) + 1.0);
	elseif (Ev <= 3.7)
		tmp = NdChar / (exp((mu / KbT)) + 1.0);
	else
		tmp = NaChar / (exp((EAccept / KbT)) + 1.0);
	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]}, If[LessEqual[Ev, -5e+125], N[(NaChar / N[(N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[Ev, -2.5e-134], N[(NaChar / t$95$0), $MachinePrecision], If[LessEqual[Ev, -1.1e-227], N[(NdChar / t$95$0), $MachinePrecision], If[LessEqual[Ev, 1.55e-134], N[(NaChar / N[(N[Exp[N[(0.0 - N[(mu / KbT), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[Ev, 3.7], N[(NdChar / N[(N[Exp[N[(mu / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(NaChar / N[(N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{\frac{Vef}{KbT}} + 1\\
\mathbf{if}\;Ev \leq -5 \cdot 10^{+125}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\

\mathbf{elif}\;Ev \leq -2.5 \cdot 10^{-134}:\\
\;\;\;\;\frac{NaChar}{t\_0}\\

\mathbf{elif}\;Ev \leq -1.1 \cdot 10^{-227}:\\
\;\;\;\;\frac{NdChar}{t\_0}\\

\mathbf{elif}\;Ev \leq 1.55 \cdot 10^{-134}:\\
\;\;\;\;\frac{NaChar}{e^{0 - \frac{mu}{KbT}} + 1}\\

\mathbf{elif}\;Ev \leq 3.7:\\
\;\;\;\;\frac{NdChar}{e^{\frac{mu}{KbT}} + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 6 regimes
  2. if Ev < -4.99999999999999962e125

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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-/.f6462.5%

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

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

    if -4.99999999999999962e125 < Ev < -2.5000000000000002e-134

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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-/.f6450.7%

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

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

    if -2.5000000000000002e-134 < Ev < -1.0999999999999999e-227

    1. Initial program 99.9%

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

      \[\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.0%

        \[\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.0%

      \[\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-/.f6446.1%

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

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

    if -1.0999999999999999e-227 < Ev < 1.55000000000000003e-134

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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.f6451.7%

        \[\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. Simplified51.7%

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

    if 1.55000000000000003e-134 < Ev < 3.7000000000000002

    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--.f6456.4%

        \[\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. Simplified56.4%

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

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

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

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

    if 3.7000000000000002 < Ev

    1. Initial program 100.0%

      \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
    2. 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. +-lowering-+.f64N/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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.9%

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

      \[\leadsto \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
  3. Recombined 6 regimes into one program.
  4. Final simplification45.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;Ev \leq -5 \cdot 10^{+125}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\ \mathbf{elif}\;Ev \leq -2.5 \cdot 10^{-134}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{elif}\;Ev \leq -1.1 \cdot 10^{-227}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{elif}\;Ev \leq 1.55 \cdot 10^{-134}:\\ \;\;\;\;\frac{NaChar}{e^{0 - \frac{mu}{KbT}} + 1}\\ \mathbf{elif}\;Ev \leq 3.7:\\ \;\;\;\;\frac{NdChar}{e^{\frac{mu}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 37.4% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;Ev \leq -3.4 \cdot 10^{+122}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\

\mathbf{elif}\;Ev \leq -8 \cdot 10^{-101}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\

\mathbf{elif}\;Ev \leq -2.35 \cdot 10^{-281}:\\
\;\;\;\;\frac{NdChar}{e^{0 - \frac{Ec}{KbT}} + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if Ev < -3.4e122

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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-/.f6462.5%

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

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

    if -3.4e122 < Ev < -8.00000000000000041e-101

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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-/.f6451.5%

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

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

    if -8.00000000000000041e-101 < Ev < -2.3500000000000001e-281

    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--.f6469.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. Simplified69.8%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(Ec\right)\right), KbT\right)\right)\right)\right) \]
      4. neg-lowering-neg.f6449.0%

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{neg.f64}\left(Ec\right), KbT\right)\right)\right)\right) \]
    9. Simplified49.0%

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

    if -2.3500000000000001e-281 < Ev

    1. Initial program 100.0%

      \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
    2. 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. +-lowering-+.f64N/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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-/.f6442.9%

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

      \[\leadsto \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification48.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;Ev \leq -3.4 \cdot 10^{+122}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\ \mathbf{elif}\;Ev \leq -8 \cdot 10^{-101}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{elif}\;Ev \leq -2.35 \cdot 10^{-281}:\\ \;\;\;\;\frac{NdChar}{e^{0 - \frac{Ec}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 70.8% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NdChar}{e^{\frac{EDonor - \left(\left(Ec - mu\right) - Vef\right)}{KbT}} + 1}\\ \mathbf{if}\;NdChar \leq -2100000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;NdChar \leq 6.2 \cdot 10^{-46}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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 (- (- Ec mu) Vef)) KbT)) 1.0))))
   (if (<= NdChar -2100000.0)
     t_0
     (if (<= NdChar 6.2e-46)
       (/ 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 - ((Ec - mu) - Vef)) / KbT)) + 1.0);
	double tmp;
	if (NdChar <= -2100000.0) {
		tmp = t_0;
	} else if (NdChar <= 6.2e-46) {
		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 - ((ec - mu) - vef)) / kbt)) + 1.0d0)
    if (ndchar <= (-2100000.0d0)) then
        tmp = t_0
    else if (ndchar <= 6.2d-46) 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 - ((Ec - mu) - Vef)) / KbT)) + 1.0);
	double tmp;
	if (NdChar <= -2100000.0) {
		tmp = t_0;
	} else if (NdChar <= 6.2e-46) {
		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 - ((Ec - mu) - Vef)) / KbT)) + 1.0)
	tmp = 0
	if NdChar <= -2100000.0:
		tmp = t_0
	elif NdChar <= 6.2e-46:
		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(Float64(Ec - mu) - Vef)) / KbT)) + 1.0))
	tmp = 0.0
	if (NdChar <= -2100000.0)
		tmp = t_0;
	elseif (NdChar <= 6.2e-46)
		tmp = Float64(NaChar / Float64(exp(Float64(Float64(EAccept + Float64(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 - ((Ec - mu) - Vef)) / KbT)) + 1.0);
	tmp = 0.0;
	if (NdChar <= -2100000.0)
		tmp = t_0;
	elseif (NdChar <= 6.2e-46)
		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[(N[(Ec - mu), $MachinePrecision] - Vef), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NdChar, -2100000.0], t$95$0, If[LessEqual[NdChar, 6.2e-46], N[(NaChar / N[(N[Exp[N[(N[(EAccept + N[(Ev + N[(Vef - mu), $MachinePrecision]), $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(\left(Ec - mu\right) - Vef\right)}{KbT}} + 1}\\
\mathbf{if}\;NdChar \leq -2100000:\\
\;\;\;\;t\_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if NdChar < -2.1e6 or 6.2000000000000002e-46 < 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--.f6470.3%

        \[\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.3%

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

    if -2.1e6 < NdChar < 6.2000000000000002e-46

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

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

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

Alternative 5: 63.8% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -8.4 \cdot 10^{+232}:\\ \;\;\;\;t\_0 - 0.25 \cdot \left(Vef \cdot \frac{NdChar + NaChar}{KbT}\right)\\ \mathbf{elif}\;KbT \leq 1.95 \cdot 10^{+223}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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 (* 0.5 (+ NdChar NaChar))))
   (if (<= KbT -8.4e+232)
     (- t_0 (* 0.25 (* Vef (/ (+ NdChar NaChar) KbT))))
     (if (<= KbT 1.95e+223)
       (/ 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 = 0.5 * (NdChar + NaChar);
	double tmp;
	if (KbT <= -8.4e+232) {
		tmp = t_0 - (0.25 * (Vef * ((NdChar + NaChar) / KbT)));
	} else if (KbT <= 1.95e+223) {
		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 = 0.5d0 * (ndchar + nachar)
    if (kbt <= (-8.4d+232)) then
        tmp = t_0 - (0.25d0 * (vef * ((ndchar + nachar) / kbt)))
    else if (kbt <= 1.95d+223) 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 = 0.5 * (NdChar + NaChar);
	double tmp;
	if (KbT <= -8.4e+232) {
		tmp = t_0 - (0.25 * (Vef * ((NdChar + NaChar) / KbT)));
	} else if (KbT <= 1.95e+223) {
		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 = 0.5 * (NdChar + NaChar)
	tmp = 0
	if KbT <= -8.4e+232:
		tmp = t_0 - (0.25 * (Vef * ((NdChar + NaChar) / KbT)))
	elif KbT <= 1.95e+223:
		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(0.5 * Float64(NdChar + NaChar))
	tmp = 0.0
	if (KbT <= -8.4e+232)
		tmp = Float64(t_0 - Float64(0.25 * Float64(Vef * Float64(Float64(NdChar + NaChar) / KbT))));
	elseif (KbT <= 1.95e+223)
		tmp = Float64(NaChar / Float64(exp(Float64(Float64(EAccept + Float64(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 = 0.5 * (NdChar + NaChar);
	tmp = 0.0;
	if (KbT <= -8.4e+232)
		tmp = t_0 - (0.25 * (Vef * ((NdChar + NaChar) / KbT)));
	elseif (KbT <= 1.95e+223)
		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[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -8.4e+232], N[(t$95$0 - N[(0.25 * N[(Vef * N[(N[(NdChar + NaChar), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 1.95e+223], N[(NaChar / N[(N[Exp[N[(N[(EAccept + N[(Ev + N[(Vef - mu), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
\mathbf{if}\;KbT \leq -8.4 \cdot 10^{+232}:\\
\;\;\;\;t\_0 - 0.25 \cdot \left(Vef \cdot \frac{NdChar + NaChar}{KbT}\right)\\

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

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


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

    1. Initial program 99.9%

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

      \[\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. Simplified48.0%

      \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right) - \frac{0.25 \cdot \left(NaChar \cdot \left(EAccept + \left(Ev + \left(Vef - mu\right)\right)\right) + NdChar \cdot \left(EDonor + \left(Vef + \left(mu - Ec\right)\right)\right)\right)}{KbT}} \]
    6. Taylor expanded in Vef 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{Vef \cdot \left(NaChar + NdChar\right)}{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{Vef \cdot \left(NaChar + NdChar\right)}{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(Vef \cdot \color{blue}{\frac{NaChar + 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(Vef, \color{blue}{\left(\frac{NaChar + NdChar}{KbT}\right)}\right)\right)\right) \]
      4. /-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(Vef, \mathsf{/.f64}\left(\left(NaChar + NdChar\right), \color{blue}{KbT}\right)\right)\right)\right) \]
      5. +-lowering-+.f6490.1%

        \[\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(Vef, \mathsf{/.f64}\left(\mathsf{+.f64}\left(NaChar, NdChar\right), KbT\right)\right)\right)\right) \]
    8. Simplified90.1%

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

    if -8.39999999999999965e232 < KbT < 1.9499999999999999e223

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

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

    if 1.9499999999999999e223 < 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-+.f64100.0%

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

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

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

Alternative 6: 37.7% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;Ev \leq -1.5 \cdot 10^{+125}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\

\mathbf{elif}\;Ev \leq -3.9 \cdot 10^{-135}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\

\mathbf{elif}\;Ev \leq -1.25 \cdot 10^{-281}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if Ev < -1.50000000000000008e125

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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-/.f6462.5%

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

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

    if -1.50000000000000008e125 < Ev < -3.90000000000000022e-135

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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-/.f6450.7%

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

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

    if -3.90000000000000022e-135 < Ev < -1.2499999999999999e-281

    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--.f6468.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. Simplified68.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-/.f6437.8%

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

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

    if -1.2499999999999999e-281 < Ev

    1. Initial program 100.0%

      \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
    2. 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. +-lowering-+.f64N/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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-/.f6442.9%

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

      \[\leadsto \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification46.3%

    \[\leadsto \begin{array}{l} \mathbf{if}\;Ev \leq -1.5 \cdot 10^{+125}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\ \mathbf{elif}\;Ev \leq -3.9 \cdot 10^{-135}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{elif}\;Ev \leq -1.25 \cdot 10^{-281}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 40.5% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
t_0 := \left(EDonor + \left(Vef + mu\right)\right) - Ec\\
t_1 := t\_0 \cdot t\_0\\
t_2 := \frac{NdChar}{2 + \frac{t\_0 + \frac{\frac{0.16666666666666666 \cdot \left(t\_0 \cdot t\_1\right)}{KbT} + 0.5 \cdot t\_1}{KbT}}{KbT}}\\
t_3 := 0.5 \cdot \left(NdChar + NaChar\right)\\
\mathbf{if}\;KbT \leq -7 \cdot 10^{+136}:\\
\;\;\;\;t\_3 - 0.25 \cdot \left(Vef \cdot \frac{NdChar + NaChar}{KbT}\right)\\

\mathbf{elif}\;KbT \leq -6.4 \cdot 10^{-15}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;KbT \leq 3.85 \cdot 10^{-87}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\

\mathbf{elif}\;KbT \leq 7.6 \cdot 10^{+111}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if KbT < -7.00000000000000002e136

    1. Initial program 99.9%

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

      \[\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. Simplified38.3%

      \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right) - \frac{0.25 \cdot \left(NaChar \cdot \left(EAccept + \left(Ev + \left(Vef - mu\right)\right)\right) + NdChar \cdot \left(EDonor + \left(Vef + \left(mu - Ec\right)\right)\right)\right)}{KbT}} \]
    6. Taylor expanded in Vef 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{Vef \cdot \left(NaChar + NdChar\right)}{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{Vef \cdot \left(NaChar + NdChar\right)}{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(Vef \cdot \color{blue}{\frac{NaChar + 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(Vef, \color{blue}{\left(\frac{NaChar + NdChar}{KbT}\right)}\right)\right)\right) \]
      4. /-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(Vef, \mathsf{/.f64}\left(\left(NaChar + NdChar\right), \color{blue}{KbT}\right)\right)\right)\right) \]
      5. +-lowering-+.f6463.7%

        \[\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(Vef, \mathsf{/.f64}\left(\mathsf{+.f64}\left(NaChar, NdChar\right), KbT\right)\right)\right)\right) \]
    8. Simplified63.7%

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

    if -7.00000000000000002e136 < KbT < -6.3999999999999999e-15 or 3.8499999999999999e-87 < KbT < 7.59999999999999951e111

    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--.f6469.7%

        \[\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. Simplified69.7%

      \[\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) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\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) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\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) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\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) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\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) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{2}}{KbT}\right), KbT\right)\right)\right)\right) \]
    9. Simplified39.4%

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

    if -6.3999999999999999e-15 < KbT < 3.8499999999999999e-87

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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-/.f6437.7%

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

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

    if 7.59999999999999951e111 < KbT

    1. Initial program 99.9%

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

      \[\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-+.f6461.3%

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

      \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification45.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -7 \cdot 10^{+136}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right) - 0.25 \cdot \left(Vef \cdot \frac{NdChar + NaChar}{KbT}\right)\\ \mathbf{elif}\;KbT \leq -6.4 \cdot 10^{-15}:\\ \;\;\;\;\frac{NdChar}{2 + \frac{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) + \frac{\frac{0.16666666666666666 \cdot \left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) \cdot \left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)\right)\right)}{KbT} + 0.5 \cdot \left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)\right)}{KbT}}{KbT}}\\ \mathbf{elif}\;KbT \leq 3.85 \cdot 10^{-87}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\ \mathbf{elif}\;KbT \leq 7.6 \cdot 10^{+111}:\\ \;\;\;\;\frac{NdChar}{2 + \frac{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) + \frac{\frac{0.16666666666666666 \cdot \left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) \cdot \left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)\right)\right)}{KbT} + 0.5 \cdot \left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)\right)}{KbT}}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 55.3% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NdChar}{e^{0 - \frac{Ec}{KbT}} + 1}\\ \mathbf{if}\;NdChar \leq -1.55 \cdot 10^{+135}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;NdChar \leq 5.5 \cdot 10^{+167}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{\left(Vef + Ev\right) - mu}{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 (- 0.0 (/ Ec KbT))) 1.0))))
   (if (<= NdChar -1.55e+135)
     t_0
     (if (<= NdChar 5.5e+167)
       (/ NaChar (+ (exp (/ (- (+ Vef Ev) 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((0.0 - (Ec / KbT))) + 1.0);
	double tmp;
	if (NdChar <= -1.55e+135) {
		tmp = t_0;
	} else if (NdChar <= 5.5e+167) {
		tmp = NaChar / (exp((((Vef + Ev) - 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((0.0d0 - (ec / kbt))) + 1.0d0)
    if (ndchar <= (-1.55d+135)) then
        tmp = t_0
    else if (ndchar <= 5.5d+167) then
        tmp = nachar / (exp((((vef + ev) - 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((0.0 - (Ec / KbT))) + 1.0);
	double tmp;
	if (NdChar <= -1.55e+135) {
		tmp = t_0;
	} else if (NdChar <= 5.5e+167) {
		tmp = NaChar / (Math.exp((((Vef + Ev) - 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((0.0 - (Ec / KbT))) + 1.0)
	tmp = 0
	if NdChar <= -1.55e+135:
		tmp = t_0
	elif NdChar <= 5.5e+167:
		tmp = NaChar / (math.exp((((Vef + Ev) - 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(0.0 - Float64(Ec / KbT))) + 1.0))
	tmp = 0.0
	if (NdChar <= -1.55e+135)
		tmp = t_0;
	elseif (NdChar <= 5.5e+167)
		tmp = Float64(NaChar / Float64(exp(Float64(Float64(Float64(Vef + Ev) - 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((0.0 - (Ec / KbT))) + 1.0);
	tmp = 0.0;
	if (NdChar <= -1.55e+135)
		tmp = t_0;
	elseif (NdChar <= 5.5e+167)
		tmp = NaChar / (exp((((Vef + Ev) - 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[(0.0 - N[(Ec / KbT), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NdChar, -1.55e+135], t$95$0, If[LessEqual[NdChar, 5.5e+167], N[(NaChar / N[(N[Exp[N[(N[(N[(Vef + Ev), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{NdChar}{e^{0 - \frac{Ec}{KbT}} + 1}\\
\mathbf{if}\;NdChar \leq -1.55 \cdot 10^{+135}:\\
\;\;\;\;t\_0\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if NdChar < -1.55000000000000011e135 or 5.5000000000000005e167 < 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--.f6478.4%

        \[\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. Simplified78.4%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(Ec\right)\right), KbT\right)\right)\right)\right) \]
      4. neg-lowering-neg.f6457.0%

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

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

    if -1.55000000000000011e135 < NdChar < 5.5000000000000005e167

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{\frac{\left(Ev + Vef\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(Ev + Vef\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(Ev + Vef\right) - mu\right), KbT\right)\right)\right)\right) \]
      5. --lowering--.f64N/A

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

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

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

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

Alternative 9: 48.2% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;EAccept \leq 1.35 \cdot 10^{+79}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Vef + Ev}{KbT}} + 1}\\

\mathbf{elif}\;EAccept \leq 8.2 \cdot 10^{+171}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if EAccept < 1.35e79

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{\frac{\left(Ev + Vef\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(Ev + Vef\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(Ev + Vef\right) - mu\right), KbT\right)\right)\right)\right) \]
      5. --lowering--.f64N/A

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{Ev + Vef}{KbT}}}} \]
    11. Step-by-step derivation
      1. /-lowering-/.f64N/A

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{\frac{Ev + Vef}{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{Ev + Vef}{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(Ev + Vef\right), KbT\right)\right)\right)\right) \]
      5. +-lowering-+.f6451.0%

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Ev, Vef\right), KbT\right)\right)\right)\right) \]
    12. Simplified51.0%

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

    if 1.35e79 < EAccept < 8.1999999999999992e171

    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--.f6481.7%

        \[\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. Simplified81.7%

      \[\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-/.f6451.5%

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

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

    if 8.1999999999999992e171 < EAccept

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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-/.f6457.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;EAccept \leq 1.35 \cdot 10^{+79}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef + Ev}{KbT}} + 1}\\ \mathbf{elif}\;EAccept \leq 8.2 \cdot 10^{+171}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 10: 39.1% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;Ev \leq -1.5 \cdot 10^{+122}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\

\mathbf{elif}\;Ev \leq -7.2 \cdot 10^{-268}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if Ev < -1.49999999999999993e122

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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-/.f6462.5%

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

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

    if -1.49999999999999993e122 < Ev < -7.2000000000000002e-268

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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-/.f6445.3%

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

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

    if -7.2000000000000002e-268 < Ev

    1. Initial program 100.0%

      \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
    2. 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. +-lowering-+.f64N/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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-/.f6441.8%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;Ev \leq -1.5 \cdot 10^{+122}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\ \mathbf{elif}\;Ev \leq -7.2 \cdot 10^{-268}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 11: 37.7% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;EAccept \leq 2.9 \cdot 10^{+93}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\

\mathbf{elif}\;EAccept \leq 1.46 \cdot 10^{+172}:\\
\;\;\;\;\frac{NdChar}{2 + \frac{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) - \frac{-0.5 \cdot \left(mu \cdot mu\right)}{KbT}}{KbT}}\\

\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if EAccept < 2.8999999999999998e93

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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-/.f6437.2%

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

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

    if 2.8999999999999998e93 < EAccept < 1.46e172

    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--.f6474.7%

        \[\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. Simplified74.7%

      \[\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. Simplified61.8%

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

      \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, mu\right)\right), Ec\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({mu}^{2}\right)}\right), KbT\right)\right), KbT\right)\right)\right)\right) \]
    11. Step-by-step derivation
      1. 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(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, mu\right)\right), Ec\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(mu \cdot mu\right)\right), KbT\right)\right), KbT\right)\right)\right)\right) \]
      2. *-lowering-*.f6455.7%

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, mu\right)\right), Ec\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(mu, mu\right)\right), KbT\right)\right), KbT\right)\right)\right)\right) \]
    12. Simplified55.7%

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

    if 1.46e172 < EAccept

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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-/.f6459.4%

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

      \[\leadsto \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification41.0%

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

Alternative 12: 35.6% accurate, 3.2× speedup?

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

\\
\begin{array}{l}
t_0 := \left(EDonor + \left(Vef + mu\right)\right) - Ec\\
t_1 := t\_0 \cdot t\_0\\
t_2 := 0.5 \cdot \left(NdChar + NaChar\right)\\
\mathbf{if}\;KbT \leq -7 \cdot 10^{+136}:\\
\;\;\;\;t\_2 - 0.25 \cdot \left(Vef \cdot \frac{NdChar + NaChar}{KbT}\right)\\

\mathbf{elif}\;KbT \leq 1.5 \cdot 10^{+112}:\\
\;\;\;\;\frac{NdChar}{2 + \frac{t\_0 + \frac{\frac{0.16666666666666666 \cdot \left(t\_0 \cdot t\_1\right)}{KbT} + 0.5 \cdot t\_1}{KbT}}{KbT}}\\

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


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

    1. Initial program 99.9%

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

      \[\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. Simplified38.3%

      \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right) - \frac{0.25 \cdot \left(NaChar \cdot \left(EAccept + \left(Ev + \left(Vef - mu\right)\right)\right) + NdChar \cdot \left(EDonor + \left(Vef + \left(mu - Ec\right)\right)\right)\right)}{KbT}} \]
    6. Taylor expanded in Vef 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{Vef \cdot \left(NaChar + NdChar\right)}{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{Vef \cdot \left(NaChar + NdChar\right)}{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(Vef \cdot \color{blue}{\frac{NaChar + 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(Vef, \color{blue}{\left(\frac{NaChar + NdChar}{KbT}\right)}\right)\right)\right) \]
      4. /-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(Vef, \mathsf{/.f64}\left(\left(NaChar + NdChar\right), \color{blue}{KbT}\right)\right)\right)\right) \]
      5. +-lowering-+.f6463.7%

        \[\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(Vef, \mathsf{/.f64}\left(\mathsf{+.f64}\left(NaChar, NdChar\right), KbT\right)\right)\right)\right) \]
    8. Simplified63.7%

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

    if -7.00000000000000002e136 < KbT < 1.4999999999999999e112

    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--.f6464.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. Simplified64.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) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\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) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\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) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\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) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\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) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{2}}{KbT}\right), KbT\right)\right)\right)\right) \]
    9. Simplified28.9%

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

    if 1.4999999999999999e112 < KbT

    1. Initial program 99.9%

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

      \[\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-+.f6461.3%

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

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

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

Alternative 13: 35.9% accurate, 5.3× speedup?

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

\\
\begin{array}{l}
t_0 := EDonor + \left(Vef + mu\right)\\
t_1 := t\_0 - Ec\\
t_2 := 0.5 \cdot \left(NdChar + NaChar\right)\\
\mathbf{if}\;KbT \leq -9 \cdot 10^{+197}:\\
\;\;\;\;t\_2 - 0.25 \cdot \left(Vef \cdot \frac{NdChar + NaChar}{KbT}\right)\\

\mathbf{elif}\;KbT \leq 8.8 \cdot 10^{+111}:\\
\;\;\;\;\frac{NdChar}{2 + \frac{t\_1 + \frac{-0.5 \cdot \left(t\_1 \cdot \left(Ec - t\_0\right)\right)}{KbT}}{KbT}}\\

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


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

    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. Simplified46.1%

      \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right) - \frac{0.25 \cdot \left(NaChar \cdot \left(EAccept + \left(Ev + \left(Vef - mu\right)\right)\right) + NdChar \cdot \left(EDonor + \left(Vef + \left(mu - Ec\right)\right)\right)\right)}{KbT}} \]
    6. Taylor expanded in Vef 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{Vef \cdot \left(NaChar + NdChar\right)}{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{Vef \cdot \left(NaChar + NdChar\right)}{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(Vef \cdot \color{blue}{\frac{NaChar + 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(Vef, \color{blue}{\left(\frac{NaChar + NdChar}{KbT}\right)}\right)\right)\right) \]
      4. /-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(Vef, \mathsf{/.f64}\left(\left(NaChar + NdChar\right), \color{blue}{KbT}\right)\right)\right)\right) \]
      5. +-lowering-+.f6477.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(Vef, \mathsf{/.f64}\left(\mathsf{+.f64}\left(NaChar, NdChar\right), KbT\right)\right)\right)\right) \]
    8. Simplified77.2%

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

    if -9.0000000000000006e197 < KbT < 8.79999999999999994e111

    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--.f6463.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. Simplified63.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}{\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. Simplified28.6%

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

    if 8.79999999999999994e111 < KbT

    1. Initial program 99.9%

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

      \[\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-+.f6461.3%

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

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

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

Alternative 14: 35.6% accurate, 5.3× speedup?

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

\\
\begin{array}{l}
t_0 := EAccept + \left(\left(Vef + Ev\right) - mu\right)\\
t_1 := 0.5 \cdot \left(NdChar + NaChar\right)\\
\mathbf{if}\;KbT \leq -8.5 \cdot 10^{+197}:\\
\;\;\;\;t\_1 - 0.25 \cdot \left(Vef \cdot \frac{NdChar + NaChar}{KbT}\right)\\

\mathbf{elif}\;KbT \leq 5 \cdot 10^{+120}:\\
\;\;\;\;\frac{NaChar}{2 + \frac{t\_0 + \frac{-0.5 \cdot \left(t\_0 \cdot \left(\left(mu - \left(Vef + Ev\right)\right) - EAccept\right)\right)}{KbT}}{KbT}}\\

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


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

    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. Simplified46.1%

      \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right) - \frac{0.25 \cdot \left(NaChar \cdot \left(EAccept + \left(Ev + \left(Vef - mu\right)\right)\right) + NdChar \cdot \left(EDonor + \left(Vef + \left(mu - Ec\right)\right)\right)\right)}{KbT}} \]
    6. Taylor expanded in Vef 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{Vef \cdot \left(NaChar + NdChar\right)}{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{Vef \cdot \left(NaChar + NdChar\right)}{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(Vef \cdot \color{blue}{\frac{NaChar + 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(Vef, \color{blue}{\left(\frac{NaChar + NdChar}{KbT}\right)}\right)\right)\right) \]
      4. /-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(Vef, \mathsf{/.f64}\left(\left(NaChar + NdChar\right), \color{blue}{KbT}\right)\right)\right)\right) \]
      5. +-lowering-+.f6477.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(Vef, \mathsf{/.f64}\left(\mathsf{+.f64}\left(NaChar, NdChar\right), KbT\right)\right)\right)\right) \]
    8. Simplified77.2%

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

    if -8.5000000000000001e197 < KbT < 5.00000000000000019e120

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      11. mul-1-negN/A

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(-1 \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right) + \frac{-1}{2} \cdot \frac{{\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}^{2}}{KbT}\right), KbT\right)\right)\right)\right) \]
    9. Simplified26.3%

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

    if 5.00000000000000019e120 < KbT

    1. Initial program 99.9%

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

      \[\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-+.f6463.5%

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

      \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification36.7%

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

Alternative 15: 32.8% accurate, 7.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -3.8 \cdot 10^{+94}:\\ \;\;\;\;t\_0 - 0.25 \cdot \left(Vef \cdot \frac{NdChar + NaChar}{KbT}\right)\\ \mathbf{elif}\;KbT \leq 2.3 \cdot 10^{+76}:\\ \;\;\;\;\frac{NdChar}{2 + \frac{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) - \frac{-0.5 \cdot \left(mu \cdot mu\right)}{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 -3.8e+94)
     (- t_0 (* 0.25 (* Vef (/ (+ NdChar NaChar) KbT))))
     (if (<= KbT 2.3e+76)
       (/
        NdChar
        (+
         2.0
         (/ (- (- (+ EDonor (+ Vef mu)) Ec) (/ (* -0.5 (* mu mu)) 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 <= -3.8e+94) {
		tmp = t_0 - (0.25 * (Vef * ((NdChar + NaChar) / KbT)));
	} else if (KbT <= 2.3e+76) {
		tmp = NdChar / (2.0 + ((((EDonor + (Vef + mu)) - Ec) - ((-0.5 * (mu * mu)) / 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 <= (-3.8d+94)) then
        tmp = t_0 - (0.25d0 * (vef * ((ndchar + nachar) / kbt)))
    else if (kbt <= 2.3d+76) then
        tmp = ndchar / (2.0d0 + ((((edonor + (vef + mu)) - ec) - (((-0.5d0) * (mu * mu)) / 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 <= -3.8e+94) {
		tmp = t_0 - (0.25 * (Vef * ((NdChar + NaChar) / KbT)));
	} else if (KbT <= 2.3e+76) {
		tmp = NdChar / (2.0 + ((((EDonor + (Vef + mu)) - Ec) - ((-0.5 * (mu * mu)) / 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 <= -3.8e+94:
		tmp = t_0 - (0.25 * (Vef * ((NdChar + NaChar) / KbT)))
	elif KbT <= 2.3e+76:
		tmp = NdChar / (2.0 + ((((EDonor + (Vef + mu)) - Ec) - ((-0.5 * (mu * mu)) / 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 <= -3.8e+94)
		tmp = Float64(t_0 - Float64(0.25 * Float64(Vef * Float64(Float64(NdChar + NaChar) / KbT))));
	elseif (KbT <= 2.3e+76)
		tmp = Float64(NdChar / Float64(2.0 + Float64(Float64(Float64(Float64(EDonor + Float64(Vef + mu)) - Ec) - Float64(Float64(-0.5 * Float64(mu * mu)) / 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 <= -3.8e+94)
		tmp = t_0 - (0.25 * (Vef * ((NdChar + NaChar) / KbT)));
	elseif (KbT <= 2.3e+76)
		tmp = NdChar / (2.0 + ((((EDonor + (Vef + mu)) - Ec) - ((-0.5 * (mu * mu)) / 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, -3.8e+94], N[(t$95$0 - N[(0.25 * N[(Vef * N[(N[(NdChar + NaChar), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 2.3e+76], N[(NdChar / N[(2.0 + N[(N[(N[(N[(EDonor + N[(Vef + mu), $MachinePrecision]), $MachinePrecision] - Ec), $MachinePrecision] - N[(N[(-0.5 * N[(mu * mu), $MachinePrecision]), $MachinePrecision] / KbT), $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 -3.8 \cdot 10^{+94}:\\
\;\;\;\;t\_0 - 0.25 \cdot \left(Vef \cdot \frac{NdChar + NaChar}{KbT}\right)\\

\mathbf{elif}\;KbT \leq 2.3 \cdot 10^{+76}:\\
\;\;\;\;\frac{NdChar}{2 + \frac{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) - \frac{-0.5 \cdot \left(mu \cdot mu\right)}{KbT}}{KbT}}\\

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


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

    1. Initial program 99.9%

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

      \[\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. Simplified34.9%

      \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right) - \frac{0.25 \cdot \left(NaChar \cdot \left(EAccept + \left(Ev + \left(Vef - mu\right)\right)\right) + NdChar \cdot \left(EDonor + \left(Vef + \left(mu - Ec\right)\right)\right)\right)}{KbT}} \]
    6. Taylor expanded in Vef 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{Vef \cdot \left(NaChar + NdChar\right)}{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{Vef \cdot \left(NaChar + NdChar\right)}{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(Vef \cdot \color{blue}{\frac{NaChar + 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(Vef, \color{blue}{\left(\frac{NaChar + NdChar}{KbT}\right)}\right)\right)\right) \]
      4. /-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(Vef, \mathsf{/.f64}\left(\left(NaChar + NdChar\right), \color{blue}{KbT}\right)\right)\right)\right) \]
      5. +-lowering-+.f6459.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(Vef, \mathsf{/.f64}\left(\mathsf{+.f64}\left(NaChar, NdChar\right), KbT\right)\right)\right)\right) \]
    8. Simplified59.0%

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

    if -3.7999999999999996e94 < KbT < 2.30000000000000001e76

    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--.f6465.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. Simplified65.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. Simplified26.7%

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

      \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, mu\right)\right), Ec\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \color{blue}{\left({mu}^{2}\right)}\right), KbT\right)\right), KbT\right)\right)\right)\right) \]
    11. Step-by-step derivation
      1. 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(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, mu\right)\right), Ec\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(mu \cdot mu\right)\right), KbT\right)\right), KbT\right)\right)\right)\right) \]
      2. *-lowering-*.f6421.7%

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{neg.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(EDonor, \mathsf{+.f64}\left(Vef, mu\right)\right), Ec\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{*.f64}\left(mu, mu\right)\right), KbT\right)\right), KbT\right)\right)\right)\right) \]
    12. Simplified21.7%

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

    if 2.30000000000000001e76 < 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-+.f6447.9%

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

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

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

Alternative 16: 31.9% accurate, 9.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -1500000000000:\\ \;\;\;\;t\_0 - 0.25 \cdot \left(Vef \cdot \frac{NdChar + NaChar}{KbT}\right)\\ \mathbf{elif}\;KbT \leq 1.15 \cdot 10^{+76}:\\ \;\;\;\;\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 -1500000000000.0)
     (- t_0 (* 0.25 (* Vef (/ (+ NdChar NaChar) KbT))))
     (if (<= KbT 1.15e+76)
       (/ 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 <= -1500000000000.0) {
		tmp = t_0 - (0.25 * (Vef * ((NdChar + NaChar) / KbT)));
	} else if (KbT <= 1.15e+76) {
		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 <= (-1500000000000.0d0)) then
        tmp = t_0 - (0.25d0 * (vef * ((ndchar + nachar) / kbt)))
    else if (kbt <= 1.15d+76) 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 <= -1500000000000.0) {
		tmp = t_0 - (0.25 * (Vef * ((NdChar + NaChar) / KbT)));
	} else if (KbT <= 1.15e+76) {
		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 <= -1500000000000.0:
		tmp = t_0 - (0.25 * (Vef * ((NdChar + NaChar) / KbT)))
	elif KbT <= 1.15e+76:
		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 <= -1500000000000.0)
		tmp = Float64(t_0 - Float64(0.25 * Float64(Vef * Float64(Float64(NdChar + NaChar) / KbT))));
	elseif (KbT <= 1.15e+76)
		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 <= -1500000000000.0)
		tmp = t_0 - (0.25 * (Vef * ((NdChar + NaChar) / KbT)));
	elseif (KbT <= 1.15e+76)
		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, -1500000000000.0], N[(t$95$0 - N[(0.25 * N[(Vef * N[(N[(NdChar + NaChar), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 1.15e+76], 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 -1500000000000:\\
\;\;\;\;t\_0 - 0.25 \cdot \left(Vef \cdot \frac{NdChar + NaChar}{KbT}\right)\\

\mathbf{elif}\;KbT \leq 1.15 \cdot 10^{+76}:\\
\;\;\;\;\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 3 regimes
  2. if KbT < -1.5e12

    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. Simplified30.9%

      \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right) - \frac{0.25 \cdot \left(NaChar \cdot \left(EAccept + \left(Ev + \left(Vef - mu\right)\right)\right) + NdChar \cdot \left(EDonor + \left(Vef + \left(mu - Ec\right)\right)\right)\right)}{KbT}} \]
    6. Taylor expanded in Vef 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{Vef \cdot \left(NaChar + NdChar\right)}{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{Vef \cdot \left(NaChar + NdChar\right)}{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(Vef \cdot \color{blue}{\frac{NaChar + 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(Vef, \color{blue}{\left(\frac{NaChar + NdChar}{KbT}\right)}\right)\right)\right) \]
      4. /-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(Vef, \mathsf{/.f64}\left(\left(NaChar + NdChar\right), \color{blue}{KbT}\right)\right)\right)\right) \]
      5. +-lowering-+.f6449.3%

        \[\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(Vef, \mathsf{/.f64}\left(\mathsf{+.f64}\left(NaChar, NdChar\right), KbT\right)\right)\right)\right) \]
    8. Simplified49.3%

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

    if -1.5e12 < KbT < 1.15000000000000001e76

    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--.f6464.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. Simplified64.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. Simplified26.2%

      \[\leadsto \frac{NdChar}{\color{blue}{2 + \left(-\frac{\left(-\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)\right) + \frac{-0.5 \cdot \left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\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-+.f6421.2%

        \[\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. Simplified21.2%

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

    if 1.15000000000000001e76 < 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-+.f6447.9%

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

      \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification33.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -1500000000000:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right) - 0.25 \cdot \left(Vef \cdot \frac{NdChar + NaChar}{KbT}\right)\\ \mathbf{elif}\;KbT \leq 1.15 \cdot 10^{+76}:\\ \;\;\;\;\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 17: 32.2% accurate, 9.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -64000000000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 1.55 \cdot 10^{+76}:\\ \;\;\;\;\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 -64000000000000.0)
     t_0
     (if (<= KbT 1.55e+76)
       (/ 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 <= -64000000000000.0) {
		tmp = t_0;
	} else if (KbT <= 1.55e+76) {
		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 <= (-64000000000000.0d0)) then
        tmp = t_0
    else if (kbt <= 1.55d+76) 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 <= -64000000000000.0) {
		tmp = t_0;
	} else if (KbT <= 1.55e+76) {
		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 <= -64000000000000.0:
		tmp = t_0
	elif KbT <= 1.55e+76:
		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 <= -64000000000000.0)
		tmp = t_0;
	elseif (KbT <= 1.55e+76)
		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 <= -64000000000000.0)
		tmp = t_0;
	elseif (KbT <= 1.55e+76)
		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, -64000000000000.0], t$95$0, If[LessEqual[KbT, 1.55e+76], 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 -64000000000000:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;KbT \leq 1.55 \cdot 10^{+76}:\\
\;\;\;\;\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.4e13 or 1.55000000000000006e76 < 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-+.f6448.6%

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

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

    if -6.4e13 < KbT < 1.55000000000000006e76

    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--.f6464.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. Simplified64.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. Simplified26.2%

      \[\leadsto \frac{NdChar}{\color{blue}{2 + \left(-\frac{\left(-\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)\right) + \frac{-0.5 \cdot \left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\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-+.f6421.2%

        \[\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. Simplified21.2%

      \[\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 simplification33.7%

    \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -64000000000000:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq 1.55 \cdot 10^{+76}:\\ \;\;\;\;\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 18: 27.2% accurate, 14.3× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;EDonor \leq -4.5 \cdot 10^{+167}:\\
\;\;\;\;\frac{NdChar}{\frac{0.5 \cdot \left(EDonor \cdot EDonor\right)}{KbT \cdot KbT}}\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if EDonor < -4.4999999999999999e167

    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--.f6463.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. Simplified63.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. Simplified37.5%

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

      \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{\left(\frac{1}{2} \cdot \frac{{EDonor}^{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 {EDonor}^{2}}{\color{blue}{{KbT}^{2}}}\right)\right) \]
      2. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{/.f64}\left(\left(\frac{1}{2} \cdot {EDonor}^{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({EDonor}^{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(EDonor \cdot EDonor\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(EDonor, EDonor\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(EDonor, EDonor\right)\right), \left(KbT \cdot \color{blue}{KbT}\right)\right)\right) \]
      7. *-lowering-*.f6433.7%

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

      \[\leadsto \frac{NdChar}{\color{blue}{\frac{0.5 \cdot \left(EDonor \cdot EDonor\right)}{KbT \cdot KbT}}} \]

    if -4.4999999999999999e167 < EDonor

    1. Initial program 100.0%

      \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
    2. 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-+.f6430.5%

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

      \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification30.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;EDonor \leq -4.5 \cdot 10^{+167}:\\ \;\;\;\;\frac{NdChar}{\frac{0.5 \cdot \left(EDonor \cdot EDonor\right)}{KbT \cdot KbT}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
  5. Add Preprocessing

Alternative 19: 22.9% accurate, 17.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;NdChar \leq -6 \cdot 10^{+134}:\\ \;\;\;\;\frac{NdChar}{2}\\ \mathbf{elif}\;NdChar \leq 1.15 \cdot 10^{-48}:\\ \;\;\;\;\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 -6e+134)
   (/ NdChar 2.0)
   (if (<= NdChar 1.15e-48) (/ 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 <= -6e+134) {
		tmp = NdChar / 2.0;
	} else if (NdChar <= 1.15e-48) {
		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 <= (-6d+134)) then
        tmp = ndchar / 2.0d0
    else if (ndchar <= 1.15d-48) 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 <= -6e+134) {
		tmp = NdChar / 2.0;
	} else if (NdChar <= 1.15e-48) {
		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 <= -6e+134:
		tmp = NdChar / 2.0
	elif NdChar <= 1.15e-48:
		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 <= -6e+134)
		tmp = Float64(NdChar / 2.0);
	elseif (NdChar <= 1.15e-48)
		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 <= -6e+134)
		tmp = NdChar / 2.0;
	elseif (NdChar <= 1.15e-48)
		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, -6e+134], N[(NdChar / 2.0), $MachinePrecision], If[LessEqual[NdChar, 1.15e-48], N[(NaChar / 2.0), $MachinePrecision], N[(NdChar / 2.0), $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;NdChar \leq -6 \cdot 10^{+134}:\\
\;\;\;\;\frac{NdChar}{2}\\

\mathbf{elif}\;NdChar \leq 1.15 \cdot 10^{-48}:\\
\;\;\;\;\frac{NaChar}{2}\\

\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if NdChar < -5.99999999999999993e134 or 1.15e-48 < 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.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. Simplified72.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}{2}\right) \]
    8. Step-by-step derivation
      1. Simplified30.9%

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

      if -5.99999999999999993e134 < NdChar < 1.15e-48

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
        11. mul-1-negN/A

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

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

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

        \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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.1%

          \[\leadsto \frac{NaChar}{\color{blue}{2}} \]
      9. Recombined 2 regimes into one program.
      10. Add Preprocessing

      Alternative 20: 27.7% 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-+.f6428.7%

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

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

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

      Alternative 21: 18.1% 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. +-lowering-+.f64N/A

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\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(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
        11. mul-1-negN/A

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

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

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

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

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

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

        Reproduce

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