Bulmash initializePoisson

Percentage Accurate: 100.0% → 100.0%
Time: 19.9s
Alternatives: 20
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 20 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{NdChar}{e^{\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}} + 1} + \frac{NaChar}{e^{\frac{Vef + \left(EAccept + \left(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 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. Final simplification99.9%

    \[\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: 68.7% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NdChar}{e^{\frac{EDonor - \left(\left(Ec - mu\right) - Vef\right)}{KbT}} + 1}\\ t_1 := \frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ t_2 := \frac{NaChar}{e^{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}} + 1} + t\_1\\ \mathbf{if}\;EDonor \leq -2.1 \cdot 10^{+101}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;EDonor \leq -8.5 \cdot 10^{-89}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;EDonor \leq -5.6 \cdot 10^{-173}:\\ \;\;\;\;t\_1 + \frac{NaChar}{e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}} + 1}\\ \mathbf{elif}\;EDonor \leq -3.5 \cdot 10^{-193}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;EDonor \leq 3.6 \cdot 10^{-179}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\right)}{KbT}} + 1}\\ \mathbf{elif}\;EDonor \leq 4.6 \cdot 10^{-20}:\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \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)))
        (t_1 (/ NdChar (+ (exp (/ EDonor KbT)) 1.0)))
        (t_2
         (+
          (/ NaChar (+ (exp (/ (+ Vef (+ EAccept (- Ev mu))) KbT)) 1.0))
          t_1)))
   (if (<= EDonor -2.1e+101)
     t_2
     (if (<= EDonor -8.5e-89)
       t_0
       (if (<= EDonor -5.6e-173)
         (+ t_1 (/ NaChar (+ (exp (/ (- (+ EAccept Ev) mu) KbT)) 1.0)))
         (if (<= EDonor -3.5e-193)
           t_0
           (if (<= EDonor 3.6e-179)
             (/ NaChar (+ (exp (/ (+ EAccept (+ Ev (- Vef mu))) KbT)) 1.0))
             (if (<= EDonor 4.6e-20) t_0 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 = NdChar / (exp(((EDonor - ((Ec - mu) - Vef)) / KbT)) + 1.0);
	double t_1 = NdChar / (exp((EDonor / KbT)) + 1.0);
	double t_2 = (NaChar / (exp(((Vef + (EAccept + (Ev - mu))) / KbT)) + 1.0)) + t_1;
	double tmp;
	if (EDonor <= -2.1e+101) {
		tmp = t_2;
	} else if (EDonor <= -8.5e-89) {
		tmp = t_0;
	} else if (EDonor <= -5.6e-173) {
		tmp = t_1 + (NaChar / (exp((((EAccept + Ev) - mu) / KbT)) + 1.0));
	} else if (EDonor <= -3.5e-193) {
		tmp = t_0;
	} else if (EDonor <= 3.6e-179) {
		tmp = NaChar / (exp(((EAccept + (Ev + (Vef - mu))) / KbT)) + 1.0);
	} else if (EDonor <= 4.6e-20) {
		tmp = t_0;
	} 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 = ndchar / (exp(((edonor - ((ec - mu) - vef)) / kbt)) + 1.0d0)
    t_1 = ndchar / (exp((edonor / kbt)) + 1.0d0)
    t_2 = (nachar / (exp(((vef + (eaccept + (ev - mu))) / kbt)) + 1.0d0)) + t_1
    if (edonor <= (-2.1d+101)) then
        tmp = t_2
    else if (edonor <= (-8.5d-89)) then
        tmp = t_0
    else if (edonor <= (-5.6d-173)) then
        tmp = t_1 + (nachar / (exp((((eaccept + ev) - mu) / kbt)) + 1.0d0))
    else if (edonor <= (-3.5d-193)) then
        tmp = t_0
    else if (edonor <= 3.6d-179) then
        tmp = nachar / (exp(((eaccept + (ev + (vef - mu))) / kbt)) + 1.0d0)
    else if (edonor <= 4.6d-20) then
        tmp = t_0
    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 = NdChar / (Math.exp(((EDonor - ((Ec - mu) - Vef)) / KbT)) + 1.0);
	double t_1 = NdChar / (Math.exp((EDonor / KbT)) + 1.0);
	double t_2 = (NaChar / (Math.exp(((Vef + (EAccept + (Ev - mu))) / KbT)) + 1.0)) + t_1;
	double tmp;
	if (EDonor <= -2.1e+101) {
		tmp = t_2;
	} else if (EDonor <= -8.5e-89) {
		tmp = t_0;
	} else if (EDonor <= -5.6e-173) {
		tmp = t_1 + (NaChar / (Math.exp((((EAccept + Ev) - mu) / KbT)) + 1.0));
	} else if (EDonor <= -3.5e-193) {
		tmp = t_0;
	} else if (EDonor <= 3.6e-179) {
		tmp = NaChar / (Math.exp(((EAccept + (Ev + (Vef - mu))) / KbT)) + 1.0);
	} else if (EDonor <= 4.6e-20) {
		tmp = t_0;
	} else {
		tmp = t_2;
	}
	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)
	t_1 = NdChar / (math.exp((EDonor / KbT)) + 1.0)
	t_2 = (NaChar / (math.exp(((Vef + (EAccept + (Ev - mu))) / KbT)) + 1.0)) + t_1
	tmp = 0
	if EDonor <= -2.1e+101:
		tmp = t_2
	elif EDonor <= -8.5e-89:
		tmp = t_0
	elif EDonor <= -5.6e-173:
		tmp = t_1 + (NaChar / (math.exp((((EAccept + Ev) - mu) / KbT)) + 1.0))
	elif EDonor <= -3.5e-193:
		tmp = t_0
	elif EDonor <= 3.6e-179:
		tmp = NaChar / (math.exp(((EAccept + (Ev + (Vef - mu))) / KbT)) + 1.0)
	elif EDonor <= 4.6e-20:
		tmp = t_0
	else:
		tmp = t_2
	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))
	t_1 = Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) + 1.0))
	t_2 = Float64(Float64(NaChar / Float64(exp(Float64(Float64(Vef + Float64(EAccept + Float64(Ev - mu))) / KbT)) + 1.0)) + t_1)
	tmp = 0.0
	if (EDonor <= -2.1e+101)
		tmp = t_2;
	elseif (EDonor <= -8.5e-89)
		tmp = t_0;
	elseif (EDonor <= -5.6e-173)
		tmp = Float64(t_1 + Float64(NaChar / Float64(exp(Float64(Float64(Float64(EAccept + Ev) - mu) / KbT)) + 1.0)));
	elseif (EDonor <= -3.5e-193)
		tmp = t_0;
	elseif (EDonor <= 3.6e-179)
		tmp = Float64(NaChar / Float64(exp(Float64(Float64(EAccept + Float64(Ev + Float64(Vef - mu))) / KbT)) + 1.0));
	elseif (EDonor <= 4.6e-20)
		tmp = t_0;
	else
		tmp = t_2;
	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);
	t_1 = NdChar / (exp((EDonor / KbT)) + 1.0);
	t_2 = (NaChar / (exp(((Vef + (EAccept + (Ev - mu))) / KbT)) + 1.0)) + t_1;
	tmp = 0.0;
	if (EDonor <= -2.1e+101)
		tmp = t_2;
	elseif (EDonor <= -8.5e-89)
		tmp = t_0;
	elseif (EDonor <= -5.6e-173)
		tmp = t_1 + (NaChar / (exp((((EAccept + Ev) - mu) / KbT)) + 1.0));
	elseif (EDonor <= -3.5e-193)
		tmp = t_0;
	elseif (EDonor <= 3.6e-179)
		tmp = NaChar / (exp(((EAccept + (Ev + (Vef - mu))) / KbT)) + 1.0);
	elseif (EDonor <= 4.6e-20)
		tmp = t_0;
	else
		tmp = t_2;
	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]}, Block[{t$95$1 = N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(NaChar / N[(N[Exp[N[(N[(Vef + N[(EAccept + N[(Ev - mu), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[EDonor, -2.1e+101], t$95$2, If[LessEqual[EDonor, -8.5e-89], t$95$0, If[LessEqual[EDonor, -5.6e-173], N[(t$95$1 + N[(NaChar / N[(N[Exp[N[(N[(N[(EAccept + Ev), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[EDonor, -3.5e-193], t$95$0, If[LessEqual[EDonor, 3.6e-179], N[(NaChar / N[(N[Exp[N[(N[(EAccept + N[(Ev + N[(Vef - mu), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[EDonor, 4.6e-20], t$95$0, t$95$2]]]]]]]]]
\begin{array}{l}

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

\mathbf{elif}\;EDonor \leq -8.5 \cdot 10^{-89}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;EDonor \leq -5.6 \cdot 10^{-173}:\\
\;\;\;\;t\_1 + \frac{NaChar}{e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}} + 1}\\

\mathbf{elif}\;EDonor \leq -3.5 \cdot 10^{-193}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;EDonor \leq 4.6 \cdot 10^{-20}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if EDonor < -2.1e101 or 4.5999999999999998e-20 < 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 EDonor around inf

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

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

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

    if -2.1e101 < EDonor < -8.49999999999999937e-89 or -5.5999999999999998e-173 < EDonor < -3.50000000000000005e-193 or 3.60000000000000007e-179 < EDonor < 4.5999999999999998e-20

    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--.f6480.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. Simplified80.6%

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

    if -8.49999999999999937e-89 < EDonor < -5.5999999999999998e-173

    1. Initial program 99.8%

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

      \[\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 EDonor around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(EAccept + Ev\right), mu\right), KbT\right)\right)\right)\right)\right) \]
      12. +-lowering-+.f6494.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), mu\right), KbT\right)\right)\right)\right)\right) \]
    9. Simplified94.8%

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

    if -3.50000000000000005e-193 < EDonor < 3.60000000000000007e-179

    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--.f6473.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. Simplified73.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;EDonor \leq -2.1 \cdot 10^{+101}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}} + 1} + \frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{elif}\;EDonor \leq -8.5 \cdot 10^{-89}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor - \left(\left(Ec - mu\right) - Vef\right)}{KbT}} + 1}\\ \mathbf{elif}\;EDonor \leq -5.6 \cdot 10^{-173}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}} + 1}\\ \mathbf{elif}\;EDonor \leq -3.5 \cdot 10^{-193}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor - \left(\left(Ec - mu\right) - Vef\right)}{KbT}} + 1}\\ \mathbf{elif}\;EDonor \leq 3.6 \cdot 10^{-179}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\right)}{KbT}} + 1}\\ \mathbf{elif}\;EDonor \leq 4.6 \cdot 10^{-20}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor - \left(\left(Ec - mu\right) - Vef\right)}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}} + 1} + \frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 65.5% accurate, 0.9× speedup?

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

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

\mathbf{elif}\;EDonor \leq -9 \cdot 10^{-89}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;EDonor \leq -1.7 \cdot 10^{-172}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;EDonor \leq -1.05 \cdot 10^{-192}:\\
\;\;\;\;t\_0\\

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

\mathbf{elif}\;EDonor \leq 1.5 \cdot 10^{-21}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if EDonor < -2.2000000000000001e101 or -8.9999999999999998e-89 < EDonor < -1.6999999999999999e-172 or 1.49999999999999996e-21 < 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 EDonor around inf

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(EAccept + Ev\right), mu\right), KbT\right)\right)\right)\right)\right) \]
      12. +-lowering-+.f6487.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), mu\right), KbT\right)\right)\right)\right)\right) \]
    9. Simplified87.4%

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

    if -2.2000000000000001e101 < EDonor < -8.9999999999999998e-89 or -1.6999999999999999e-172 < EDonor < -1.04999999999999997e-192 or 2.8999999999999999e-179 < EDonor < 1.49999999999999996e-21

    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--.f6480.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. Simplified80.6%

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

    if -1.04999999999999997e-192 < EDonor < 2.8999999999999999e-179

    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--.f6473.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. Simplified73.5%

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;EDonor \leq -2.2 \cdot 10^{+101}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}} + 1}\\ \mathbf{elif}\;EDonor \leq -9 \cdot 10^{-89}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor - \left(\left(Ec - mu\right) - Vef\right)}{KbT}} + 1}\\ \mathbf{elif}\;EDonor \leq -1.7 \cdot 10^{-172}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}} + 1}\\ \mathbf{elif}\;EDonor \leq -1.05 \cdot 10^{-192}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor - \left(\left(Ec - mu\right) - Vef\right)}{KbT}} + 1}\\ \mathbf{elif}\;EDonor \leq 2.9 \cdot 10^{-179}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\right)}{KbT}} + 1}\\ \mathbf{elif}\;EDonor \leq 1.5 \cdot 10^{-21}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor - \left(\left(Ec - mu\right) - Vef\right)}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}} + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 41.8% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\ t_1 := \frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ t_2 := \frac{NdChar}{2} + t\_0\\ \mathbf{if}\;KbT \leq -22000000000000:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;KbT \leq -7.5 \cdot 10^{-245}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;KbT \leq 4 \cdot 10^{+32}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 2.15 \cdot 10^{+138}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;t\_2\\ \end{array} \end{array} \]
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
 :precision binary64
 (let* ((t_0 (/ NaChar (+ (exp (/ Ev KbT)) 1.0)))
        (t_1 (/ NdChar (+ (exp (/ EDonor KbT)) 1.0)))
        (t_2 (+ (/ NdChar 2.0) t_0)))
   (if (<= KbT -22000000000000.0)
     t_2
     (if (<= KbT -7.5e-245)
       t_1
       (if (<= KbT 4e+32) t_0 (if (<= KbT 2.15e+138) t_1 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 = NaChar / (exp((Ev / KbT)) + 1.0);
	double t_1 = NdChar / (exp((EDonor / KbT)) + 1.0);
	double t_2 = (NdChar / 2.0) + t_0;
	double tmp;
	if (KbT <= -22000000000000.0) {
		tmp = t_2;
	} else if (KbT <= -7.5e-245) {
		tmp = t_1;
	} else if (KbT <= 4e+32) {
		tmp = t_0;
	} else if (KbT <= 2.15e+138) {
		tmp = t_1;
	} 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 = nachar / (exp((ev / kbt)) + 1.0d0)
    t_1 = ndchar / (exp((edonor / kbt)) + 1.0d0)
    t_2 = (ndchar / 2.0d0) + t_0
    if (kbt <= (-22000000000000.0d0)) then
        tmp = t_2
    else if (kbt <= (-7.5d-245)) then
        tmp = t_1
    else if (kbt <= 4d+32) then
        tmp = t_0
    else if (kbt <= 2.15d+138) then
        tmp = t_1
    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 = NaChar / (Math.exp((Ev / KbT)) + 1.0);
	double t_1 = NdChar / (Math.exp((EDonor / KbT)) + 1.0);
	double t_2 = (NdChar / 2.0) + t_0;
	double tmp;
	if (KbT <= -22000000000000.0) {
		tmp = t_2;
	} else if (KbT <= -7.5e-245) {
		tmp = t_1;
	} else if (KbT <= 4e+32) {
		tmp = t_0;
	} else if (KbT <= 2.15e+138) {
		tmp = t_1;
	} else {
		tmp = t_2;
	}
	return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
	t_0 = NaChar / (math.exp((Ev / KbT)) + 1.0)
	t_1 = NdChar / (math.exp((EDonor / KbT)) + 1.0)
	t_2 = (NdChar / 2.0) + t_0
	tmp = 0
	if KbT <= -22000000000000.0:
		tmp = t_2
	elif KbT <= -7.5e-245:
		tmp = t_1
	elif KbT <= 4e+32:
		tmp = t_0
	elif KbT <= 2.15e+138:
		tmp = t_1
	else:
		tmp = t_2
	return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	t_0 = Float64(NaChar / Float64(exp(Float64(Ev / KbT)) + 1.0))
	t_1 = Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) + 1.0))
	t_2 = Float64(Float64(NdChar / 2.0) + t_0)
	tmp = 0.0
	if (KbT <= -22000000000000.0)
		tmp = t_2;
	elseif (KbT <= -7.5e-245)
		tmp = t_1;
	elseif (KbT <= 4e+32)
		tmp = t_0;
	elseif (KbT <= 2.15e+138)
		tmp = t_1;
	else
		tmp = t_2;
	end
	return tmp
end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	t_0 = NaChar / (exp((Ev / KbT)) + 1.0);
	t_1 = NdChar / (exp((EDonor / KbT)) + 1.0);
	t_2 = (NdChar / 2.0) + t_0;
	tmp = 0.0;
	if (KbT <= -22000000000000.0)
		tmp = t_2;
	elseif (KbT <= -7.5e-245)
		tmp = t_1;
	elseif (KbT <= 4e+32)
		tmp = t_0;
	elseif (KbT <= 2.15e+138)
		tmp = t_1;
	else
		tmp = t_2;
	end
	tmp_2 = tmp;
end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NaChar / N[(N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(NdChar / 2.0), $MachinePrecision] + t$95$0), $MachinePrecision]}, If[LessEqual[KbT, -22000000000000.0], t$95$2, If[LessEqual[KbT, -7.5e-245], t$95$1, If[LessEqual[KbT, 4e+32], t$95$0, If[LessEqual[KbT, 2.15e+138], t$95$1, t$95$2]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\
t_1 := \frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\
t_2 := \frac{NdChar}{2} + t\_0\\
\mathbf{if}\;KbT \leq -22000000000000:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;KbT \leq -7.5 \cdot 10^{-245}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;KbT \leq 4 \cdot 10^{+32}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;KbT \leq 2.15 \cdot 10^{+138}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if KbT < -2.2e13 or 2.1499999999999999e138 < 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 \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \color{blue}{2}\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. Simplified75.9%

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

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

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

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

      if -2.2e13 < KbT < -7.5000000000000003e-245 or 4.00000000000000021e32 < KbT < 2.1499999999999999e138

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

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

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

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

        \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}} \]
      8. Step-by-step derivation
        1. /-lowering-/.f64N/A

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{\frac{EDonor}{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{EDonor}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f6451.9%

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

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

      if -7.5000000000000003e-245 < KbT < 4.00000000000000021e32

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

        \[\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-/.f6436.6%

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -22000000000000:\\ \;\;\;\;\frac{NdChar}{2} + \frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\ \mathbf{elif}\;KbT \leq -7.5 \cdot 10^{-245}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{elif}\;KbT \leq 4 \cdot 10^{+32}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\ \mathbf{elif}\;KbT \leq 2.15 \cdot 10^{+138}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{2} + \frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\ \end{array} \]
    8. Add Preprocessing

    Alternative 5: 66.3% accurate, 1.8× speedup?

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

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

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

      if -1.80000000000000009e261 < NaChar < -1.6499999999999999e131 or 1.7500000000000001e135 < NaChar

      1. Initial program 100.0%

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
        6. +-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--.f6479.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. Simplified79.5%

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

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

    Alternative 6: 42.3% accurate, 1.8× speedup?

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
        6. +-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.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. Simplified72.9%

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

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

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

      if -4.10000000000000014e177 < Vef < 5.8e-304 or 2.20000000000000008e-187 < Vef < 3.80000000000000012e145

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

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

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

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

        \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}} \]
      8. Step-by-step derivation
        1. /-lowering-/.f64N/A

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{\frac{EDonor}{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{EDonor}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f6448.3%

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

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

      if 5.8e-304 < Vef < 2.20000000000000008e-187

      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.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. Simplified70.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-/.f6452.0%

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;Vef \leq -4.1 \cdot 10^{+177}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{elif}\;Vef \leq 5.8 \cdot 10^{-304}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{elif}\;Vef \leq 2.2 \cdot 10^{-187}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\ \mathbf{elif}\;Vef \leq 3.8 \cdot 10^{+145}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 7: 59.4% accurate, 1.9× speedup?

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

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

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

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

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

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

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

        if -1.05e155 < NdChar

        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 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}}}} \]
      9. Recombined 2 regimes into one program.
      10. Final simplification62.4%

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

      Alternative 8: 41.2% accurate, 2.0× speedup?

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

        1. Initial program 99.8%

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

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

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

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

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

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

            \[\leadsto \frac{NdChar}{2} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Ev}{KbT}}}} \]
          5. Taylor expanded in Ev around 0

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

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

              \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{/.f64}\left(Ev, \color{blue}{KbT}\right)\right)\right)\right) \]
          7. Simplified53.2%

            \[\leadsto \frac{NdChar}{2} + \frac{NaChar}{\color{blue}{2 + \frac{Ev}{KbT}}} \]

          if -7.1999999999999996e-14 < KbT < 2.8999999999999998e103

          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 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-/.f6437.5%

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

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

          if 2.8999999999999998e103 < 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 \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \color{blue}{2}\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
          5. Step-by-step derivation
            1. Simplified71.5%

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

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

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

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \left(\frac{EAccept}{KbT} + \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right)\right), \left(\frac{\color{blue}{mu}}{KbT}\right)\right)\right)\right) \]
              3. associate-+r+N/A

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

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(\frac{EAccept}{KbT} + \frac{Ev}{KbT}\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
              5. +-lowering-+.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\frac{EAccept}{KbT}\right), \left(\frac{Ev}{KbT}\right)\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
              6. /-lowering-/.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \left(\frac{Ev}{KbT}\right)\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
              7. /-lowering-/.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
              8. /-lowering-/.f64N/A

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right), \mathsf{/.f64}\left(Vef, KbT\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
              9. /-lowering-/.f6463.6%

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right), \mathsf{/.f64}\left(Vef, KbT\right)\right)\right), \mathsf{/.f64}\left(mu, \color{blue}{KbT}\right)\right)\right)\right) \]
            4. Simplified63.6%

              \[\leadsto \frac{NdChar}{2} + \frac{NaChar}{\color{blue}{\left(2 + \left(\left(\frac{EAccept}{KbT} + \frac{Ev}{KbT}\right) + \frac{Vef}{KbT}\right)\right) - \frac{mu}{KbT}}} \]
          6. Recombined 3 regimes into one program.
          7. Final simplification45.4%

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

          Alternative 9: 39.2% accurate, 2.0× speedup?

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

            1. Initial program 99.8%

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

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

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

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

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

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

                \[\leadsto \frac{NdChar}{2} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Ev}{KbT}}}} \]
              5. Taylor expanded in Ev around 0

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

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \color{blue}{\left(\frac{Ev}{KbT}\right)}\right)\right)\right) \]
                2. /-lowering-/.f6457.5%

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{/.f64}\left(Ev, \color{blue}{KbT}\right)\right)\right)\right) \]
              7. Simplified57.5%

                \[\leadsto \frac{NdChar}{2} + \frac{NaChar}{\color{blue}{2 + \frac{Ev}{KbT}}} \]

              if -4.00000000000000036e25 < KbT < 1.42e78

              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--.f6459.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. Simplified59.8%

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

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

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

              if 1.42e78 < 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 \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \color{blue}{2}\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
              5. Step-by-step derivation
                1. Simplified64.6%

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

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

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

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \left(\frac{EAccept}{KbT} + \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right)\right), \left(\frac{\color{blue}{mu}}{KbT}\right)\right)\right)\right) \]
                  3. associate-+r+N/A

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

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(\frac{EAccept}{KbT} + \frac{Ev}{KbT}\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                  5. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\frac{EAccept}{KbT}\right), \left(\frac{Ev}{KbT}\right)\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                  6. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \left(\frac{Ev}{KbT}\right)\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                  7. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                  8. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right), \mathsf{/.f64}\left(Vef, KbT\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                  9. /-lowering-/.f6457.5%

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right), \mathsf{/.f64}\left(Vef, KbT\right)\right)\right), \mathsf{/.f64}\left(mu, \color{blue}{KbT}\right)\right)\right)\right) \]
                4. Simplified57.5%

                  \[\leadsto \frac{NdChar}{2} + \frac{NaChar}{\color{blue}{\left(2 + \left(\left(\frac{EAccept}{KbT} + \frac{Ev}{KbT}\right) + \frac{Vef}{KbT}\right)\right) - \frac{mu}{KbT}}} \]
              6. Recombined 3 regimes into one program.
              7. Final simplification43.3%

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

              Alternative 10: 39.9% accurate, 2.0× speedup?

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

                1. Initial program 99.8%

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

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

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

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

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

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

                    \[\leadsto \frac{NdChar}{2} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Ev}{KbT}}}} \]
                  5. Taylor expanded in Ev around 0

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

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

                      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{/.f64}\left(Ev, \color{blue}{KbT}\right)\right)\right)\right) \]
                  7. Simplified55.6%

                    \[\leadsto \frac{NdChar}{2} + \frac{NaChar}{\color{blue}{2 + \frac{Ev}{KbT}}} \]

                  if -2.3e21 < KbT < 1.08000000000000002e102

                  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-/.f6430.9%

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

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

                  if 1.08000000000000002e102 < 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 \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \color{blue}{2}\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
                  5. Step-by-step derivation
                    1. Simplified71.5%

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

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

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \left(\frac{EAccept}{KbT} + \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right)\right), \left(\frac{\color{blue}{mu}}{KbT}\right)\right)\right)\right) \]
                      3. associate-+r+N/A

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

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(\frac{EAccept}{KbT} + \frac{Ev}{KbT}\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                      5. +-lowering-+.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\frac{EAccept}{KbT}\right), \left(\frac{Ev}{KbT}\right)\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                      6. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \left(\frac{Ev}{KbT}\right)\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                      7. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                      8. /-lowering-/.f64N/A

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right), \mathsf{/.f64}\left(Vef, KbT\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                      9. /-lowering-/.f6463.6%

                        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right), \mathsf{/.f64}\left(Vef, KbT\right)\right)\right), \mathsf{/.f64}\left(mu, \color{blue}{KbT}\right)\right)\right)\right) \]
                    4. Simplified63.6%

                      \[\leadsto \frac{NdChar}{2} + \frac{NaChar}{\color{blue}{\left(2 + \left(\left(\frac{EAccept}{KbT} + \frac{Ev}{KbT}\right) + \frac{Vef}{KbT}\right)\right) - \frac{mu}{KbT}}} \]
                  6. Recombined 3 regimes into one program.
                  7. Final simplification41.5%

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

                  Alternative 11: 35.2% accurate, 3.2× speedup?

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

                    1. Initial program 99.8%

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

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

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

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

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

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

                        \[\leadsto \frac{NdChar}{2} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Ev}{KbT}}}} \]
                      5. Taylor expanded in Ev around 0

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

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

                          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{/.f64}\left(Ev, \color{blue}{KbT}\right)\right)\right)\right) \]
                      7. Simplified63.3%

                        \[\leadsto \frac{NdChar}{2} + \frac{NaChar}{\color{blue}{2 + \frac{Ev}{KbT}}} \]

                      if -4.70000000000000029e64 < KbT < 1.34999999999999992e104

                      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--.f6460.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. Simplified60.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) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\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) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\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) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\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) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\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) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}^{2}}{KbT}\right), KbT\right)\right)\right)\right) \]
                      9. Simplified29.6%

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

                      if 1.34999999999999992e104 < 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 \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \color{blue}{2}\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
                      5. Step-by-step derivation
                        1. Simplified71.5%

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

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

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

                            \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \left(\frac{EAccept}{KbT} + \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right)\right), \left(\frac{\color{blue}{mu}}{KbT}\right)\right)\right)\right) \]
                          3. associate-+r+N/A

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

                            \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(\frac{EAccept}{KbT} + \frac{Ev}{KbT}\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                          5. +-lowering-+.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\frac{EAccept}{KbT}\right), \left(\frac{Ev}{KbT}\right)\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                          6. /-lowering-/.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \left(\frac{Ev}{KbT}\right)\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                          7. /-lowering-/.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                          8. /-lowering-/.f64N/A

                            \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right), \mathsf{/.f64}\left(Vef, KbT\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                          9. /-lowering-/.f6463.6%

                            \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right), \mathsf{/.f64}\left(Vef, KbT\right)\right)\right), \mathsf{/.f64}\left(mu, \color{blue}{KbT}\right)\right)\right)\right) \]
                        4. Simplified63.6%

                          \[\leadsto \frac{NdChar}{2} + \frac{NaChar}{\color{blue}{\left(2 + \left(\left(\frac{EAccept}{KbT} + \frac{Ev}{KbT}\right) + \frac{Vef}{KbT}\right)\right) - \frac{mu}{KbT}}} \]
                      6. Recombined 3 regimes into one program.
                      7. Final simplification41.0%

                        \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -4.7 \cdot 10^{+64}:\\ \;\;\;\;\frac{NdChar}{2} + \frac{NaChar}{2 + \frac{Ev}{KbT}}\\ \mathbf{elif}\;KbT \leq 1.35 \cdot 10^{+104}:\\ \;\;\;\;\frac{NaChar}{2 + \frac{\left(\left(EAccept + \left(Vef + Ev\right)\right) - mu\right) + \frac{0.16666666666666666 \cdot \frac{\left(\left(EAccept + \left(Vef + Ev\right)\right) - mu\right) \cdot \left(\left(\left(EAccept + \left(Vef + Ev\right)\right) - mu\right) \cdot \left(\left(EAccept + \left(Vef + Ev\right)\right) - mu\right)\right)}{KbT} + \left(\left(\left(EAccept + \left(Vef + Ev\right)\right) - mu\right) \cdot \left(\left(EAccept + \left(Vef + Ev\right)\right) - mu\right)\right) \cdot 0.5}{KbT}}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{2} + \frac{NaChar}{\left(2 + \left(\frac{Vef}{KbT} + \left(\frac{Ev}{KbT} + \frac{EAccept}{KbT}\right)\right)\right) - \frac{mu}{KbT}}\\ \end{array} \]
                      8. Add Preprocessing

                      Alternative 12: 34.9% accurate, 5.3× speedup?

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

                        1. Initial program 99.8%

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

                          \[\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-+.f6452.1%

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

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

                        if -3.60000000000000034e-33 < KbT < 7.1000000000000002e103

                        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--.f6460.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. Simplified60.7%

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

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

                        if 7.1000000000000002e103 < 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 \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \color{blue}{2}\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
                        5. Step-by-step derivation
                          1. Simplified71.5%

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

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

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

                              \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \left(\frac{EAccept}{KbT} + \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right)\right), \left(\frac{\color{blue}{mu}}{KbT}\right)\right)\right)\right) \]
                            3. associate-+r+N/A

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

                              \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\left(\frac{EAccept}{KbT} + \frac{Ev}{KbT}\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                            5. +-lowering-+.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\left(\frac{EAccept}{KbT}\right), \left(\frac{Ev}{KbT}\right)\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                            6. /-lowering-/.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \left(\frac{Ev}{KbT}\right)\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                            7. /-lowering-/.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right), \left(\frac{Vef}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                            8. /-lowering-/.f64N/A

                              \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right), \mathsf{/.f64}\left(Vef, KbT\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                            9. /-lowering-/.f6463.6%

                              \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(2, \mathsf{+.f64}\left(\mathsf{+.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right), \mathsf{/.f64}\left(Vef, KbT\right)\right)\right), \mathsf{/.f64}\left(mu, \color{blue}{KbT}\right)\right)\right)\right) \]
                          4. Simplified63.6%

                            \[\leadsto \frac{NdChar}{2} + \frac{NaChar}{\color{blue}{\left(2 + \left(\left(\frac{EAccept}{KbT} + \frac{Ev}{KbT}\right) + \frac{Vef}{KbT}\right)\right) - \frac{mu}{KbT}}} \]
                        6. Recombined 3 regimes into one program.
                        7. Final simplification40.3%

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

                        Alternative 13: 30.5% accurate, 8.5× speedup?

                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NdChar}{2} + \frac{NaChar}{2 + \frac{Ev}{KbT}}\\ \mathbf{if}\;KbT \leq -9200000000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 9 \cdot 10^{+135}:\\ \;\;\;\;0.5 \cdot \frac{-1}{\frac{-1 + \frac{NaChar - \frac{NaChar \cdot NaChar}{NdChar}}{NdChar}}{NdChar}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                        (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                         :precision binary64
                         (let* ((t_0 (+ (/ NdChar 2.0) (/ NaChar (+ 2.0 (/ Ev KbT))))))
                           (if (<= KbT -9200000000000.0)
                             t_0
                             (if (<= KbT 9e+135)
                               (*
                                0.5
                                (/
                                 -1.0
                                 (/
                                  (+ -1.0 (/ (- NaChar (/ (* NaChar NaChar) NdChar)) NdChar))
                                  NdChar)))
                               t_0))))
                        double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                        	double t_0 = (NdChar / 2.0) + (NaChar / (2.0 + (Ev / KbT)));
                        	double tmp;
                        	if (KbT <= -9200000000000.0) {
                        		tmp = t_0;
                        	} else if (KbT <= 9e+135) {
                        		tmp = 0.5 * (-1.0 / ((-1.0 + ((NaChar - ((NaChar * NaChar) / NdChar)) / NdChar)) / NdChar));
                        	} else {
                        		tmp = t_0;
                        	}
                        	return tmp;
                        }
                        
                        real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                            real(8), intent (in) :: ndchar
                            real(8), intent (in) :: ec
                            real(8), intent (in) :: vef
                            real(8), intent (in) :: edonor
                            real(8), intent (in) :: mu
                            real(8), intent (in) :: kbt
                            real(8), intent (in) :: nachar
                            real(8), intent (in) :: ev
                            real(8), intent (in) :: eaccept
                            real(8) :: t_0
                            real(8) :: tmp
                            t_0 = (ndchar / 2.0d0) + (nachar / (2.0d0 + (ev / kbt)))
                            if (kbt <= (-9200000000000.0d0)) then
                                tmp = t_0
                            else if (kbt <= 9d+135) then
                                tmp = 0.5d0 * ((-1.0d0) / (((-1.0d0) + ((nachar - ((nachar * nachar) / ndchar)) / ndchar)) / ndchar))
                            else
                                tmp = t_0
                            end if
                            code = tmp
                        end function
                        
                        public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                        	double t_0 = (NdChar / 2.0) + (NaChar / (2.0 + (Ev / KbT)));
                        	double tmp;
                        	if (KbT <= -9200000000000.0) {
                        		tmp = t_0;
                        	} else if (KbT <= 9e+135) {
                        		tmp = 0.5 * (-1.0 / ((-1.0 + ((NaChar - ((NaChar * NaChar) / NdChar)) / NdChar)) / NdChar));
                        	} else {
                        		tmp = t_0;
                        	}
                        	return tmp;
                        }
                        
                        def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                        	t_0 = (NdChar / 2.0) + (NaChar / (2.0 + (Ev / KbT)))
                        	tmp = 0
                        	if KbT <= -9200000000000.0:
                        		tmp = t_0
                        	elif KbT <= 9e+135:
                        		tmp = 0.5 * (-1.0 / ((-1.0 + ((NaChar - ((NaChar * NaChar) / NdChar)) / NdChar)) / NdChar))
                        	else:
                        		tmp = t_0
                        	return tmp
                        
                        function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                        	t_0 = Float64(Float64(NdChar / 2.0) + Float64(NaChar / Float64(2.0 + Float64(Ev / KbT))))
                        	tmp = 0.0
                        	if (KbT <= -9200000000000.0)
                        		tmp = t_0;
                        	elseif (KbT <= 9e+135)
                        		tmp = Float64(0.5 * Float64(-1.0 / Float64(Float64(-1.0 + Float64(Float64(NaChar - Float64(Float64(NaChar * NaChar) / NdChar)) / NdChar)) / NdChar)));
                        	else
                        		tmp = t_0;
                        	end
                        	return tmp
                        end
                        
                        function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                        	t_0 = (NdChar / 2.0) + (NaChar / (2.0 + (Ev / KbT)));
                        	tmp = 0.0;
                        	if (KbT <= -9200000000000.0)
                        		tmp = t_0;
                        	elseif (KbT <= 9e+135)
                        		tmp = 0.5 * (-1.0 / ((-1.0 + ((NaChar - ((NaChar * NaChar) / NdChar)) / NdChar)) / NdChar));
                        	else
                        		tmp = t_0;
                        	end
                        	tmp_2 = tmp;
                        end
                        
                        code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NdChar / 2.0), $MachinePrecision] + N[(NaChar / N[(2.0 + N[(Ev / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -9200000000000.0], t$95$0, If[LessEqual[KbT, 9e+135], N[(0.5 * N[(-1.0 / N[(N[(-1.0 + N[(N[(NaChar - N[(N[(NaChar * NaChar), $MachinePrecision] / NdChar), $MachinePrecision]), $MachinePrecision] / NdChar), $MachinePrecision]), $MachinePrecision] / NdChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                        
                        \begin{array}{l}
                        
                        \\
                        \begin{array}{l}
                        t_0 := \frac{NdChar}{2} + \frac{NaChar}{2 + \frac{Ev}{KbT}}\\
                        \mathbf{if}\;KbT \leq -9200000000000:\\
                        \;\;\;\;t\_0\\
                        
                        \mathbf{elif}\;KbT \leq 9 \cdot 10^{+135}:\\
                        \;\;\;\;0.5 \cdot \frac{-1}{\frac{-1 + \frac{NaChar - \frac{NaChar \cdot NaChar}{NdChar}}{NdChar}}{NdChar}}\\
                        
                        \mathbf{else}:\\
                        \;\;\;\;t\_0\\
                        
                        
                        \end{array}
                        \end{array}
                        
                        Derivation
                        1. Split input into 2 regimes
                        2. if KbT < -9.2e12 or 9.00000000000000014e135 < 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 \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \color{blue}{2}\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
                          5. Step-by-step derivation
                            1. Simplified75.3%

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

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

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

                              \[\leadsto \frac{NdChar}{2} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Ev}{KbT}}}} \]
                            5. Taylor expanded in Ev around 0

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

                                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \color{blue}{\left(\frac{Ev}{KbT}\right)}\right)\right)\right) \]
                              2. /-lowering-/.f6460.0%

                                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{/.f64}\left(Ev, \color{blue}{KbT}\right)\right)\right)\right) \]
                            7. Simplified60.0%

                              \[\leadsto \frac{NdChar}{2} + \frac{NaChar}{\color{blue}{2 + \frac{Ev}{KbT}}} \]

                            if -9.2e12 < KbT < 9.00000000000000014e135

                            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-+.f6412.2%

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

                              \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
                            7. Step-by-step derivation
                              1. flip3-+N/A

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

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

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \left(NdChar \cdot NdChar - NaChar \cdot NdChar\right)\right), \left({\color{blue}{NaChar}}^{3} + {NdChar}^{3}\right)\right)\right)\right) \]
                              7. distribute-rgt-out--N/A

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \mathsf{*.f64}\left(NdChar, \mathsf{\_.f64}\left(NdChar, NaChar\right)\right)\right), \mathsf{+.f64}\left(\left({NaChar}^{3}\right), \color{blue}{\left({NdChar}^{3}\right)}\right)\right)\right)\right) \]
                              11. cube-multN/A

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \mathsf{*.f64}\left(NdChar, \mathsf{\_.f64}\left(NdChar, NaChar\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, \mathsf{*.f64}\left(NaChar, NaChar\right)\right), \left({NdChar}^{3}\right)\right)\right)\right)\right) \]
                              14. cube-multN/A

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

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

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

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \left(-1 \cdot \frac{-1 \cdot NaChar + \frac{{NaChar}^{2}}{NdChar}}{NdChar} + \left(\mathsf{neg}\left(1\right)\right)\right)}{NdChar}\right)\right)\right) \]
                              3. metadata-evalN/A

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \left(-1 \cdot \frac{-1 \cdot NaChar + \frac{{NaChar}^{2}}{NdChar}}{NdChar} + -1\right)}{NdChar}\right)\right)\right) \]
                              4. distribute-lft-inN/A

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \frac{-1 \cdot \left(-1 \cdot NaChar + \frac{{NaChar}^{2}}{NdChar}\right)}{NdChar} + -1 \cdot -1}{NdChar}\right)\right)\right) \]
                              6. distribute-lft-inN/A

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \frac{-1 \cdot \left(-1 \cdot NaChar\right) + -1 \cdot \frac{{NaChar}^{2}}{NdChar}}{NdChar} + -1 \cdot -1}{NdChar}\right)\right)\right) \]
                              7. neg-mul-1N/A

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \frac{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(NaChar\right)\right)\right)\right) + -1 \cdot \frac{{NaChar}^{2}}{NdChar}}{NdChar} + -1 \cdot -1}{NdChar}\right)\right)\right) \]
                              9. remove-double-negN/A

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \frac{NaChar + -1 \cdot \frac{{NaChar}^{2}}{NdChar}}{NdChar} + -1 \cdot -1}{NdChar}\right)\right)\right) \]
                              10. metadata-evalN/A

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(1 + -1 \cdot \frac{NaChar + -1 \cdot \frac{{NaChar}^{2}}{NdChar}}{NdChar}\right), \color{blue}{NdChar}\right)\right)\right) \]
                            11. Simplified21.6%

                              \[\leadsto 0.5 \cdot \frac{1}{\color{blue}{\frac{1 - \frac{NaChar - \frac{NaChar \cdot NaChar}{NdChar}}{NdChar}}{NdChar}}} \]
                          6. Recombined 2 regimes into one program.
                          7. Final simplification35.6%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -9200000000000:\\ \;\;\;\;\frac{NdChar}{2} + \frac{NaChar}{2 + \frac{Ev}{KbT}}\\ \mathbf{elif}\;KbT \leq 9 \cdot 10^{+135}:\\ \;\;\;\;0.5 \cdot \frac{-1}{\frac{-1 + \frac{NaChar - \frac{NaChar \cdot NaChar}{NdChar}}{NdChar}}{NdChar}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{2} + \frac{NaChar}{2 + \frac{Ev}{KbT}}\\ \end{array} \]
                          8. Add Preprocessing

                          Alternative 14: 28.0% accurate, 9.9× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;Vef \leq -1.55 \cdot 10^{+208}:\\ \;\;\;\;0.5 \cdot \frac{-1}{\frac{NaChar \cdot \left(NdChar - NaChar\right)}{NdChar \cdot \left(NdChar \cdot NdChar\right)}}\\ \mathbf{elif}\;Vef \leq 1.2 \cdot 10^{+268}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{-1}{\frac{NdChar}{NaChar \cdot NaChar} + \frac{-1}{NaChar}}\\ \end{array} \end{array} \]
                          (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                           :precision binary64
                           (if (<= Vef -1.55e+208)
                             (*
                              0.5
                              (/ -1.0 (/ (* NaChar (- NdChar NaChar)) (* NdChar (* NdChar NdChar)))))
                             (if (<= Vef 1.2e+268)
                               (* 0.5 (+ NdChar NaChar))
                               (* 0.5 (/ -1.0 (+ (/ NdChar (* NaChar NaChar)) (/ -1.0 NaChar)))))))
                          double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                          	double tmp;
                          	if (Vef <= -1.55e+208) {
                          		tmp = 0.5 * (-1.0 / ((NaChar * (NdChar - NaChar)) / (NdChar * (NdChar * NdChar))));
                          	} else if (Vef <= 1.2e+268) {
                          		tmp = 0.5 * (NdChar + NaChar);
                          	} else {
                          		tmp = 0.5 * (-1.0 / ((NdChar / (NaChar * NaChar)) + (-1.0 / 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 (vef <= (-1.55d+208)) then
                                  tmp = 0.5d0 * ((-1.0d0) / ((nachar * (ndchar - nachar)) / (ndchar * (ndchar * ndchar))))
                              else if (vef <= 1.2d+268) then
                                  tmp = 0.5d0 * (ndchar + nachar)
                              else
                                  tmp = 0.5d0 * ((-1.0d0) / ((ndchar / (nachar * nachar)) + ((-1.0d0) / 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 (Vef <= -1.55e+208) {
                          		tmp = 0.5 * (-1.0 / ((NaChar * (NdChar - NaChar)) / (NdChar * (NdChar * NdChar))));
                          	} else if (Vef <= 1.2e+268) {
                          		tmp = 0.5 * (NdChar + NaChar);
                          	} else {
                          		tmp = 0.5 * (-1.0 / ((NdChar / (NaChar * NaChar)) + (-1.0 / NaChar)));
                          	}
                          	return tmp;
                          }
                          
                          def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                          	tmp = 0
                          	if Vef <= -1.55e+208:
                          		tmp = 0.5 * (-1.0 / ((NaChar * (NdChar - NaChar)) / (NdChar * (NdChar * NdChar))))
                          	elif Vef <= 1.2e+268:
                          		tmp = 0.5 * (NdChar + NaChar)
                          	else:
                          		tmp = 0.5 * (-1.0 / ((NdChar / (NaChar * NaChar)) + (-1.0 / NaChar)))
                          	return tmp
                          
                          function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                          	tmp = 0.0
                          	if (Vef <= -1.55e+208)
                          		tmp = Float64(0.5 * Float64(-1.0 / Float64(Float64(NaChar * Float64(NdChar - NaChar)) / Float64(NdChar * Float64(NdChar * NdChar)))));
                          	elseif (Vef <= 1.2e+268)
                          		tmp = Float64(0.5 * Float64(NdChar + NaChar));
                          	else
                          		tmp = Float64(0.5 * Float64(-1.0 / Float64(Float64(NdChar / Float64(NaChar * NaChar)) + Float64(-1.0 / NaChar))));
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                          	tmp = 0.0;
                          	if (Vef <= -1.55e+208)
                          		tmp = 0.5 * (-1.0 / ((NaChar * (NdChar - NaChar)) / (NdChar * (NdChar * NdChar))));
                          	elseif (Vef <= 1.2e+268)
                          		tmp = 0.5 * (NdChar + NaChar);
                          	else
                          		tmp = 0.5 * (-1.0 / ((NdChar / (NaChar * NaChar)) + (-1.0 / NaChar)));
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[Vef, -1.55e+208], N[(0.5 * N[(-1.0 / N[(N[(NaChar * N[(NdChar - NaChar), $MachinePrecision]), $MachinePrecision] / N[(NdChar * N[(NdChar * NdChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[Vef, 1.2e+268], N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(-1.0 / N[(N[(NdChar / N[(NaChar * NaChar), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / NaChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;Vef \leq -1.55 \cdot 10^{+208}:\\
                          \;\;\;\;0.5 \cdot \frac{-1}{\frac{NaChar \cdot \left(NdChar - NaChar\right)}{NdChar \cdot \left(NdChar \cdot NdChar\right)}}\\
                          
                          \mathbf{elif}\;Vef \leq 1.2 \cdot 10^{+268}:\\
                          \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;0.5 \cdot \frac{-1}{\frac{NdChar}{NaChar \cdot NaChar} + \frac{-1}{NaChar}}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 3 regimes
                          2. if Vef < -1.5499999999999999e208

                            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-+.f6414.0%

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

                              \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
                            7. Step-by-step derivation
                              1. flip3-+N/A

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

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

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \left(NdChar \cdot NdChar - NaChar \cdot NdChar\right)\right), \left({\color{blue}{NaChar}}^{3} + {NdChar}^{3}\right)\right)\right)\right) \]
                              7. distribute-rgt-out--N/A

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \mathsf{*.f64}\left(NdChar, \mathsf{\_.f64}\left(NdChar, NaChar\right)\right)\right), \mathsf{+.f64}\left(\left({NaChar}^{3}\right), \color{blue}{\left({NdChar}^{3}\right)}\right)\right)\right)\right) \]
                              11. cube-multN/A

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \mathsf{*.f64}\left(NdChar, \mathsf{\_.f64}\left(NdChar, NaChar\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, \mathsf{*.f64}\left(NaChar, NaChar\right)\right), \left({NdChar}^{3}\right)\right)\right)\right)\right) \]
                              14. cube-multN/A

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

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

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(\left(\mathsf{neg}\left(NaChar \cdot NdChar\right)\right) + {NaChar}^{2}\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(\color{blue}{NaChar}, \mathsf{*.f64}\left(NaChar, NaChar\right)\right), \mathsf{*.f64}\left(NdChar, \mathsf{*.f64}\left(NdChar, NdChar\right)\right)\right)\right)\right)\right) \]
                              2. distribute-rgt-neg-inN/A

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(NaChar \cdot \left(-1 \cdot NdChar\right) + NaChar \cdot NaChar\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, \color{blue}{\mathsf{*.f64}\left(NaChar, NaChar\right)}\right), \mathsf{*.f64}\left(NdChar, \mathsf{*.f64}\left(NdChar, NdChar\right)\right)\right)\right)\right)\right) \]
                              5. distribute-lft-inN/A

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(NaChar, \left(NaChar + \left(\mathsf{neg}\left(NdChar\right)\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, \mathsf{*.f64}\left(NaChar, \color{blue}{NaChar}\right)\right), \mathsf{*.f64}\left(NdChar, \mathsf{*.f64}\left(NdChar, NdChar\right)\right)\right)\right)\right)\right) \]
                              9. unsub-negN/A

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

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

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

                              \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(NaChar, \mathsf{\_.f64}\left(NaChar, NdChar\right)\right), \color{blue}{\left({NdChar}^{3}\right)}\right)\right)\right) \]
                            13. Step-by-step derivation
                              1. cube-multN/A

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(NaChar, \mathsf{\_.f64}\left(NaChar, NdChar\right)\right), \left(NdChar \cdot \color{blue}{\left(NdChar \cdot NdChar\right)}\right)\right)\right)\right) \]
                              2. unpow2N/A

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(NaChar, \mathsf{\_.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(NdChar, \left(NdChar \cdot \color{blue}{NdChar}\right)\right)\right)\right)\right) \]
                              5. *-lowering-*.f6431.8%

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{*.f64}\left(NaChar, \mathsf{\_.f64}\left(NaChar, NdChar\right)\right), \mathsf{*.f64}\left(NdChar, \mathsf{*.f64}\left(NdChar, \color{blue}{NdChar}\right)\right)\right)\right)\right) \]
                            14. Simplified31.8%

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

                            if -1.5499999999999999e208 < Vef < 1.2e268

                            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-+.f6432.3%

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

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

                            if 1.2e268 < Vef

                            1. Initial program 100.0%

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

                              \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}}}} \]
                            3. Add Preprocessing
                            4. Taylor expanded in 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-+.f648.3%

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

                              \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
                            7. Step-by-step derivation
                              1. flip3-+N/A

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

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

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \left(NdChar \cdot NdChar - NaChar \cdot NdChar\right)\right), \left({\color{blue}{NaChar}}^{3} + {NdChar}^{3}\right)\right)\right)\right) \]
                              7. distribute-rgt-out--N/A

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \mathsf{*.f64}\left(NdChar, \mathsf{\_.f64}\left(NdChar, NaChar\right)\right)\right), \mathsf{+.f64}\left(\left({NaChar}^{3}\right), \color{blue}{\left({NdChar}^{3}\right)}\right)\right)\right)\right) \]
                              11. cube-multN/A

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \mathsf{*.f64}\left(NdChar, \mathsf{\_.f64}\left(NdChar, NaChar\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, \mathsf{*.f64}\left(NaChar, NaChar\right)\right), \left({NdChar}^{3}\right)\right)\right)\right)\right) \]
                              14. cube-multN/A

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

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

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

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

                              \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \color{blue}{\left(-1 \cdot \frac{NdChar}{{NaChar}^{2}} + \frac{1}{NaChar}\right)}\right)\right) \]
                            10. Step-by-step derivation
                              1. +-commutativeN/A

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

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

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

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, NaChar\right), \mathsf{/.f64}\left(NdChar, \left(NaChar \cdot \color{blue}{NaChar}\right)\right)\right)\right)\right) \]
                              8. *-lowering-*.f6458.3%

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, NaChar\right), \mathsf{/.f64}\left(NdChar, \mathsf{*.f64}\left(NaChar, \color{blue}{NaChar}\right)\right)\right)\right)\right) \]
                            11. Simplified58.3%

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

                            \[\leadsto \begin{array}{l} \mathbf{if}\;Vef \leq -1.55 \cdot 10^{+208}:\\ \;\;\;\;0.5 \cdot \frac{-1}{\frac{NaChar \cdot \left(NdChar - NaChar\right)}{NdChar \cdot \left(NdChar \cdot NdChar\right)}}\\ \mathbf{elif}\;Vef \leq 1.2 \cdot 10^{+268}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{-1}{\frac{NdChar}{NaChar \cdot NaChar} + \frac{-1}{NaChar}}\\ \end{array} \]
                          5. Add Preprocessing

                          Alternative 15: 28.1% accurate, 12.7× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;Vef \leq 2.4 \cdot 10^{+265}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{-1}{\frac{NdChar}{NaChar \cdot NaChar} + \frac{-1}{NaChar}}\\ \end{array} \end{array} \]
                          (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                           :precision binary64
                           (if (<= Vef 2.4e+265)
                             (* 0.5 (+ NdChar NaChar))
                             (* 0.5 (/ -1.0 (+ (/ NdChar (* NaChar NaChar)) (/ -1.0 NaChar))))))
                          double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                          	double tmp;
                          	if (Vef <= 2.4e+265) {
                          		tmp = 0.5 * (NdChar + NaChar);
                          	} else {
                          		tmp = 0.5 * (-1.0 / ((NdChar / (NaChar * NaChar)) + (-1.0 / 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 (vef <= 2.4d+265) then
                                  tmp = 0.5d0 * (ndchar + nachar)
                              else
                                  tmp = 0.5d0 * ((-1.0d0) / ((ndchar / (nachar * nachar)) + ((-1.0d0) / 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 (Vef <= 2.4e+265) {
                          		tmp = 0.5 * (NdChar + NaChar);
                          	} else {
                          		tmp = 0.5 * (-1.0 / ((NdChar / (NaChar * NaChar)) + (-1.0 / NaChar)));
                          	}
                          	return tmp;
                          }
                          
                          def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                          	tmp = 0
                          	if Vef <= 2.4e+265:
                          		tmp = 0.5 * (NdChar + NaChar)
                          	else:
                          		tmp = 0.5 * (-1.0 / ((NdChar / (NaChar * NaChar)) + (-1.0 / NaChar)))
                          	return tmp
                          
                          function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                          	tmp = 0.0
                          	if (Vef <= 2.4e+265)
                          		tmp = Float64(0.5 * Float64(NdChar + NaChar));
                          	else
                          		tmp = Float64(0.5 * Float64(-1.0 / Float64(Float64(NdChar / Float64(NaChar * NaChar)) + Float64(-1.0 / NaChar))));
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                          	tmp = 0.0;
                          	if (Vef <= 2.4e+265)
                          		tmp = 0.5 * (NdChar + NaChar);
                          	else
                          		tmp = 0.5 * (-1.0 / ((NdChar / (NaChar * NaChar)) + (-1.0 / NaChar)));
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[Vef, 2.4e+265], N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(-1.0 / N[(N[(NdChar / N[(NaChar * NaChar), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / NaChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;Vef \leq 2.4 \cdot 10^{+265}:\\
                          \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;0.5 \cdot \frac{-1}{\frac{NdChar}{NaChar \cdot NaChar} + \frac{-1}{NaChar}}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if Vef < 2.4e265

                            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-+.f6430.6%

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

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

                            if 2.4e265 < Vef

                            1. Initial program 100.0%

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

                              \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}}}} \]
                            3. Add Preprocessing
                            4. Taylor expanded in 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-+.f648.3%

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

                              \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
                            7. Step-by-step derivation
                              1. flip3-+N/A

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

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

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \left(NdChar \cdot NdChar - NaChar \cdot NdChar\right)\right), \left({\color{blue}{NaChar}}^{3} + {NdChar}^{3}\right)\right)\right)\right) \]
                              7. distribute-rgt-out--N/A

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \mathsf{*.f64}\left(NdChar, \mathsf{\_.f64}\left(NdChar, NaChar\right)\right)\right), \mathsf{+.f64}\left(\left({NaChar}^{3}\right), \color{blue}{\left({NdChar}^{3}\right)}\right)\right)\right)\right) \]
                              11. cube-multN/A

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \mathsf{*.f64}\left(NdChar, \mathsf{\_.f64}\left(NdChar, NaChar\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, \mathsf{*.f64}\left(NaChar, NaChar\right)\right), \left({NdChar}^{3}\right)\right)\right)\right)\right) \]
                              14. cube-multN/A

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

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

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

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

                              \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \color{blue}{\left(-1 \cdot \frac{NdChar}{{NaChar}^{2}} + \frac{1}{NaChar}\right)}\right)\right) \]
                            10. Step-by-step derivation
                              1. +-commutativeN/A

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

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

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

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, NaChar\right), \mathsf{/.f64}\left(NdChar, \left(NaChar \cdot \color{blue}{NaChar}\right)\right)\right)\right)\right) \]
                              8. *-lowering-*.f6458.3%

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(\mathsf{/.f64}\left(1, NaChar\right), \mathsf{/.f64}\left(NdChar, \mathsf{*.f64}\left(NaChar, \color{blue}{NaChar}\right)\right)\right)\right)\right) \]
                            11. Simplified58.3%

                              \[\leadsto 0.5 \cdot \frac{1}{\color{blue}{\frac{1}{NaChar} - \frac{NdChar}{NaChar \cdot NaChar}}} \]
                          3. Recombined 2 regimes into one program.
                          4. Final simplification31.6%

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

                          Alternative 16: 28.1% accurate, 14.3× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;Vef \leq 4.85 \cdot 10^{+260}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \frac{-1}{\frac{-1 + \frac{NdChar}{NaChar}}{NaChar}}\\ \end{array} \end{array} \]
                          (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                           :precision binary64
                           (if (<= Vef 4.85e+260)
                             (* 0.5 (+ NdChar NaChar))
                             (* 0.5 (/ -1.0 (/ (+ -1.0 (/ NdChar NaChar)) NaChar)))))
                          double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                          	double tmp;
                          	if (Vef <= 4.85e+260) {
                          		tmp = 0.5 * (NdChar + NaChar);
                          	} else {
                          		tmp = 0.5 * (-1.0 / ((-1.0 + (NdChar / NaChar)) / 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 (vef <= 4.85d+260) then
                                  tmp = 0.5d0 * (ndchar + nachar)
                              else
                                  tmp = 0.5d0 * ((-1.0d0) / (((-1.0d0) + (ndchar / nachar)) / 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 (Vef <= 4.85e+260) {
                          		tmp = 0.5 * (NdChar + NaChar);
                          	} else {
                          		tmp = 0.5 * (-1.0 / ((-1.0 + (NdChar / NaChar)) / NaChar));
                          	}
                          	return tmp;
                          }
                          
                          def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                          	tmp = 0
                          	if Vef <= 4.85e+260:
                          		tmp = 0.5 * (NdChar + NaChar)
                          	else:
                          		tmp = 0.5 * (-1.0 / ((-1.0 + (NdChar / NaChar)) / NaChar))
                          	return tmp
                          
                          function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                          	tmp = 0.0
                          	if (Vef <= 4.85e+260)
                          		tmp = Float64(0.5 * Float64(NdChar + NaChar));
                          	else
                          		tmp = Float64(0.5 * Float64(-1.0 / Float64(Float64(-1.0 + Float64(NdChar / NaChar)) / NaChar)));
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                          	tmp = 0.0;
                          	if (Vef <= 4.85e+260)
                          		tmp = 0.5 * (NdChar + NaChar);
                          	else
                          		tmp = 0.5 * (-1.0 / ((-1.0 + (NdChar / NaChar)) / NaChar));
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[Vef, 4.85e+260], N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(-1.0 / N[(N[(-1.0 + N[(NdChar / NaChar), $MachinePrecision]), $MachinePrecision] / NaChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;Vef \leq 4.85 \cdot 10^{+260}:\\
                          \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;0.5 \cdot \frac{-1}{\frac{-1 + \frac{NdChar}{NaChar}}{NaChar}}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if Vef < 4.8500000000000002e260

                            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-+.f6430.8%

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

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

                            if 4.8500000000000002e260 < Vef

                            1. Initial program 100.0%

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

                              \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}}}} \]
                            3. Add Preprocessing
                            4. Taylor expanded in 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-+.f648.8%

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

                              \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
                            7. Step-by-step derivation
                              1. flip3-+N/A

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

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

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \left(NdChar \cdot NdChar - NaChar \cdot NdChar\right)\right), \left({\color{blue}{NaChar}}^{3} + {NdChar}^{3}\right)\right)\right)\right) \]
                              7. distribute-rgt-out--N/A

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \mathsf{*.f64}\left(NdChar, \mathsf{\_.f64}\left(NdChar, NaChar\right)\right)\right), \mathsf{+.f64}\left(\left({NaChar}^{3}\right), \color{blue}{\left({NdChar}^{3}\right)}\right)\right)\right)\right) \]
                              11. cube-multN/A

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \mathsf{*.f64}\left(NdChar, \mathsf{\_.f64}\left(NdChar, NaChar\right)\right)\right), \mathsf{+.f64}\left(\mathsf{*.f64}\left(NaChar, \mathsf{*.f64}\left(NaChar, NaChar\right)\right), \left({NdChar}^{3}\right)\right)\right)\right)\right) \]
                              14. cube-multN/A

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

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

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

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(1 + \left(\mathsf{neg}\left(\frac{NdChar}{NaChar}\right)\right)\right), NaChar\right)\right)\right) \]
                              3. unsub-negN/A

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(1 - \frac{NdChar}{NaChar}\right), NaChar\right)\right)\right) \]
                              4. --lowering--.f64N/A

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \left(\frac{NdChar}{NaChar}\right)\right), NaChar\right)\right)\right) \]
                              5. /-lowering-/.f6449.7%

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(1, \mathsf{/.f64}\left(NdChar, NaChar\right)\right), NaChar\right)\right)\right) \]
                            11. Simplified49.7%

                              \[\leadsto 0.5 \cdot \frac{1}{\color{blue}{\frac{1 - \frac{NdChar}{NaChar}}{NaChar}}} \]
                          3. Recombined 2 regimes into one program.
                          4. Final simplification31.6%

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

                          Alternative 17: 28.0% accurate, 14.3× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;Vef \leq 3.8 \cdot 10^{+270}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(\left(NaChar \cdot NaChar\right) \cdot \frac{-1}{NdChar - NaChar}\right)\\ \end{array} \end{array} \]
                          (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                           :precision binary64
                           (if (<= Vef 3.8e+270)
                             (* 0.5 (+ NdChar NaChar))
                             (* 0.5 (* (* NaChar NaChar) (/ -1.0 (- 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 (Vef <= 3.8e+270) {
                          		tmp = 0.5 * (NdChar + NaChar);
                          	} else {
                          		tmp = 0.5 * ((NaChar * NaChar) * (-1.0 / (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 (vef <= 3.8d+270) then
                                  tmp = 0.5d0 * (ndchar + nachar)
                              else
                                  tmp = 0.5d0 * ((nachar * nachar) * ((-1.0d0) / (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 (Vef <= 3.8e+270) {
                          		tmp = 0.5 * (NdChar + NaChar);
                          	} else {
                          		tmp = 0.5 * ((NaChar * NaChar) * (-1.0 / (NdChar - NaChar)));
                          	}
                          	return tmp;
                          }
                          
                          def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                          	tmp = 0
                          	if Vef <= 3.8e+270:
                          		tmp = 0.5 * (NdChar + NaChar)
                          	else:
                          		tmp = 0.5 * ((NaChar * NaChar) * (-1.0 / (NdChar - NaChar)))
                          	return tmp
                          
                          function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                          	tmp = 0.0
                          	if (Vef <= 3.8e+270)
                          		tmp = Float64(0.5 * Float64(NdChar + NaChar));
                          	else
                          		tmp = Float64(0.5 * Float64(Float64(NaChar * NaChar) * Float64(-1.0 / Float64(NdChar - NaChar))));
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                          	tmp = 0.0;
                          	if (Vef <= 3.8e+270)
                          		tmp = 0.5 * (NdChar + NaChar);
                          	else
                          		tmp = 0.5 * ((NaChar * NaChar) * (-1.0 / (NdChar - NaChar)));
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[Vef, 3.8e+270], N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(NaChar * NaChar), $MachinePrecision] * N[(-1.0 / N[(NdChar - NaChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;Vef \leq 3.8 \cdot 10^{+270}:\\
                          \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;0.5 \cdot \left(\left(NaChar \cdot NaChar\right) \cdot \frac{-1}{NdChar - NaChar}\right)\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if Vef < 3.80000000000000018e270

                            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-+.f6430.6%

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

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

                            if 3.80000000000000018e270 < Vef

                            1. Initial program 100.0%

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

                              \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}}}} \]
                            3. Add Preprocessing
                            4. Taylor expanded in 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-+.f648.3%

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

                              \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
                            7. Step-by-step derivation
                              1. flip-+N/A

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \left(\frac{NaChar \cdot NaChar - NdChar \cdot NdChar}{\color{blue}{NaChar - NdChar}}\right)\right) \]
                              2. div-invN/A

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

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

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

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

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

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

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \mathsf{*.f64}\left(NdChar, NdChar\right)\right), \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(NaChar, \color{blue}{NdChar}\right)\right)\right)\right) \]
                            8. Applied egg-rr18.0%

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

                              \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\color{blue}{\left({NaChar}^{2}\right)}, \mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(NaChar, NdChar\right)\right)\right)\right) \]
                            10. Step-by-step derivation
                              1. unpow2N/A

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\left(NaChar \cdot NaChar\right), \mathsf{/.f64}\left(\color{blue}{1}, \mathsf{\_.f64}\left(NaChar, NdChar\right)\right)\right)\right) \]
                              2. *-lowering-*.f6458.1%

                                \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \mathsf{/.f64}\left(\color{blue}{1}, \mathsf{\_.f64}\left(NaChar, NdChar\right)\right)\right)\right) \]
                            11. Simplified58.1%

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

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

                          Alternative 18: 21.7% accurate, 17.6× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;NaChar \leq -1.26 \cdot 10^{+138}:\\ \;\;\;\;\frac{NaChar}{2}\\ \mathbf{elif}\;NaChar \leq 2.15 \cdot 10^{+181}:\\ \;\;\;\;NdChar \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{2}\\ \end{array} \end{array} \]
                          (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                           :precision binary64
                           (if (<= NaChar -1.26e+138)
                             (/ NaChar 2.0)
                             (if (<= NaChar 2.15e+181) (* NdChar 0.5) (/ NaChar 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 (NaChar <= -1.26e+138) {
                          		tmp = NaChar / 2.0;
                          	} else if (NaChar <= 2.15e+181) {
                          		tmp = NdChar * 0.5;
                          	} else {
                          		tmp = NaChar / 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 (nachar <= (-1.26d+138)) then
                                  tmp = nachar / 2.0d0
                              else if (nachar <= 2.15d+181) then
                                  tmp = ndchar * 0.5d0
                              else
                                  tmp = nachar / 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 (NaChar <= -1.26e+138) {
                          		tmp = NaChar / 2.0;
                          	} else if (NaChar <= 2.15e+181) {
                          		tmp = NdChar * 0.5;
                          	} else {
                          		tmp = NaChar / 2.0;
                          	}
                          	return tmp;
                          }
                          
                          def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                          	tmp = 0
                          	if NaChar <= -1.26e+138:
                          		tmp = NaChar / 2.0
                          	elif NaChar <= 2.15e+181:
                          		tmp = NdChar * 0.5
                          	else:
                          		tmp = NaChar / 2.0
                          	return tmp
                          
                          function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                          	tmp = 0.0
                          	if (NaChar <= -1.26e+138)
                          		tmp = Float64(NaChar / 2.0);
                          	elseif (NaChar <= 2.15e+181)
                          		tmp = Float64(NdChar * 0.5);
                          	else
                          		tmp = Float64(NaChar / 2.0);
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                          	tmp = 0.0;
                          	if (NaChar <= -1.26e+138)
                          		tmp = NaChar / 2.0;
                          	elseif (NaChar <= 2.15e+181)
                          		tmp = NdChar * 0.5;
                          	else
                          		tmp = NaChar / 2.0;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[NaChar, -1.26e+138], N[(NaChar / 2.0), $MachinePrecision], If[LessEqual[NaChar, 2.15e+181], N[(NdChar * 0.5), $MachinePrecision], N[(NaChar / 2.0), $MachinePrecision]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          \mathbf{if}\;NaChar \leq -1.26 \cdot 10^{+138}:\\
                          \;\;\;\;\frac{NaChar}{2}\\
                          
                          \mathbf{elif}\;NaChar \leq 2.15 \cdot 10^{+181}:\\
                          \;\;\;\;NdChar \cdot 0.5\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;\frac{NaChar}{2}\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if NaChar < -1.25999999999999994e138 or 2.14999999999999986e181 < NaChar

                            1. Initial program 100.0%

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

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

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

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

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

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

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

                                \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
                              6. +-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--.f6474.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. Simplified74.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}{2}\right) \]
                            8. Step-by-step derivation
                              1. Simplified29.0%

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

                              if -1.25999999999999994e138 < NaChar < 2.14999999999999986e181

                              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-+.f6429.7%

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

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

                                \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar} \]
                              8. Step-by-step derivation
                                1. *-lowering-*.f6425.6%

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

                                \[\leadsto \color{blue}{0.5 \cdot NdChar} \]
                            9. Recombined 2 regimes into one program.
                            10. Final simplification26.5%

                              \[\leadsto \begin{array}{l} \mathbf{if}\;NaChar \leq -1.26 \cdot 10^{+138}:\\ \;\;\;\;\frac{NaChar}{2}\\ \mathbf{elif}\;NaChar \leq 2.15 \cdot 10^{+181}:\\ \;\;\;\;NdChar \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{2}\\ \end{array} \]
                            11. Add Preprocessing

                            Alternative 19: 27.9% 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 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-+.f6429.8%

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

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

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

                            Alternative 20: 18.6% accurate, 76.3× speedup?

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

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

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

                              \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar} \]
                            8. Step-by-step derivation
                              1. *-lowering-*.f6421.1%

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

                              \[\leadsto \color{blue}{0.5 \cdot NdChar} \]
                            10. Final simplification21.1%

                              \[\leadsto NdChar \cdot 0.5 \]
                            11. Add Preprocessing

                            Reproduce

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