Bulmash initializePoisson

Percentage Accurate: 100.0% → 100.0%
Time: 17.5s
Alternatives: 25
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 25 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{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} - -1} - \frac{NdChar}{-1 - {\mathsf{E}\left(\right)}^{\left(\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}\right)}} \end{array} \]
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
 :precision binary64
 (-
  (/ NaChar (- (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)) -1.0))
  (/ NdChar (- -1.0 (pow (E) (/ (- mu (- (- Ec Vef) EDonor)) KbT))))))
\begin{array}{l}

\\
\frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} - -1} - \frac{NdChar}{-1 - {\mathsf{E}\left(\right)}^{\left(\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}\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. Add Preprocessing
  3. Step-by-step derivation
    1. lift-exp.f64N/A

      \[\leadsto \frac{NdChar}{1 + \color{blue}{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. lift-/.f64N/A

      \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\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}}} \]
    3. clear-numN/A

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

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

      \[\leadsto \frac{NdChar}{1 + e^{1 \cdot \color{blue}{\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}}} \]
    6. lift-/.f64N/A

      \[\leadsto \frac{NdChar}{1 + e^{1 \cdot \color{blue}{\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}}} \]
    7. exp-prodN/A

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

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

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

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

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

Alternative 2: 75.2% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_3 \leq 0:\\
\;\;\;\;\frac{NaChar}{t\_0 - -1}\\

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


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

    1. Initial program 99.9%

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

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

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

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

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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 37.9% accurate, 0.5× speedup?

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

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

\mathbf{elif}\;t\_0 \leq 5 \cdot 10^{-240}:\\
\;\;\;\;\frac{NdChar}{2 - \frac{Ec - \left(\left(mu + Vef\right) + EDonor\right)}{KbT}}\\

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


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

    1. Initial program 99.7%

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

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

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

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

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

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

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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

          Alternative 4: 37.6% accurate, 0.5× speedup?

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

            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. Add Preprocessing
            3. Taylor expanded in KbT around inf

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

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

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

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

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

            if -4.99999999999999991e-200 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.9999999999999999e-249

            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

                  Alternative 5: 37.6% accurate, 0.5× speedup?

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

                    1. Initial program 99.9%

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

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

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

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

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

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

                    if -4.99999999999999991e-200 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.9999999999999999e-249

                    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 6: 33.6% accurate, 0.5× speedup?

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

                        1. Initial program 99.9%

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

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

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

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

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

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

                        if -1.99999999999999992e-260 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.9999999999999999e-249

                        1. Initial program 100.0%

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

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

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

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

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

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

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

                            \[\leadsto \frac{\frac{-1}{2} \cdot {NdChar}^{2}}{\color{blue}{NaChar} - NdChar} \]
                          3. Step-by-step derivation
                            1. Applied rewrites31.6%

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

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

                          Alternative 7: 34.1% accurate, 0.5× speedup?

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

                            1. Initial program 99.9%

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

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

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

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

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

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

                            if -9.99999999999999985e-266 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.99999999999999979e-269

                            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \frac{NdChar}{\frac{Vef}{KbT}} \]
                              3. Step-by-step derivation
                                1. Applied rewrites28.5%

                                  \[\leadsto \frac{NdChar}{\frac{Vef}{KbT}} \]
                              4. Recombined 2 regimes into one program.
                              5. Final simplification33.6%

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

                              Alternative 8: 32.6% accurate, 0.5× speedup?

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

                                1. Initial program 99.9%

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

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

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

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

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

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

                                if -1.00000000000000008e-217 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.00000000000000005e-262

                                1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    \[\leadsto \frac{NdChar}{\frac{EDonor}{KbT}} \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites22.0%

                                      \[\leadsto \frac{NdChar}{\frac{EDonor}{KbT}} \]
                                  4. Recombined 2 regimes into one program.
                                  5. Final simplification32.8%

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

                                  Alternative 9: 100.0% accurate, 0.7× speedup?

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

                                      \[\leadsto \frac{NdChar}{1 + \color{blue}{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. lift-/.f64N/A

                                      \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\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}}} \]
                                    3. lift-neg.f64N/A

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

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

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

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

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

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

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

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

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

                                  Alternative 10: 100.0% accurate, 1.0× speedup?

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

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

                                  Alternative 11: 69.0% accurate, 1.8× speedup?

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

                                    1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      if -1.60000000000000006e63 < NdChar < 1.75000000000000012e101

                                      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                                      if 1.75000000000000012e101 < NdChar

                                      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                    Alternative 12: 69.0% accurate, 1.9× speedup?

                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}\\ \mathbf{if}\;NdChar \leq -1.6 \cdot 10^{+63}:\\ \;\;\;\;\frac{NdChar}{{\mathsf{E}\left(\right)}^{t\_0} - -1}\\ \mathbf{elif}\;NdChar \leq 1.75 \cdot 10^{+101}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} - -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{e^{t\_0} - -1}\\ \end{array} \end{array} \]
                                    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                     :precision binary64
                                     (let* ((t_0 (/ (- (+ (+ mu Vef) EDonor) Ec) KbT)))
                                       (if (<= NdChar -1.6e+63)
                                         (/ NdChar (- (pow (E) t_0) -1.0))
                                         (if (<= NdChar 1.75e+101)
                                           (/ NaChar (- (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)) -1.0))
                                           (/ NdChar (- (exp t_0) -1.0))))))
                                    \begin{array}{l}
                                    
                                    \\
                                    \begin{array}{l}
                                    t_0 := \frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}\\
                                    \mathbf{if}\;NdChar \leq -1.6 \cdot 10^{+63}:\\
                                    \;\;\;\;\frac{NdChar}{{\mathsf{E}\left(\right)}^{t\_0} - -1}\\
                                    
                                    \mathbf{elif}\;NdChar \leq 1.75 \cdot 10^{+101}:\\
                                    \;\;\;\;\frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} - -1}\\
                                    
                                    \mathbf{else}:\\
                                    \;\;\;\;\frac{NdChar}{e^{t\_0} - -1}\\
                                    
                                    
                                    \end{array}
                                    \end{array}
                                    
                                    Derivation
                                    1. Split input into 3 regimes
                                    2. if NdChar < -1.60000000000000006e63

                                      1. Initial program 99.6%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        if -1.60000000000000006e63 < NdChar < 1.75000000000000012e101

                                        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                                        if 1.75000000000000012e101 < NdChar

                                        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      Alternative 13: 69.0% accurate, 1.9× speedup?

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

                                        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. Add Preprocessing
                                        3. Taylor expanded in NaChar around 0

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

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

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

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

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

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

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

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

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

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

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

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

                                        if -1.60000000000000006e63 < NdChar < 1.75000000000000012e101

                                        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      Alternative 14: 66.6% accurate, 1.9× speedup?

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

                                        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. Add Preprocessing
                                        3. Taylor expanded in NaChar around 0

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

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

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

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

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

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

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

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

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

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

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

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

                                          \[\leadsto \frac{NdChar}{e^{\frac{\left(EDonor + Vef\right) - Ec}{KbT}} + 1} \]
                                        7. Step-by-step derivation
                                          1. Applied rewrites72.6%

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

                                          if -1.60000000000000006e63 < NdChar < 1.82e140

                                          1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                        Alternative 15: 57.4% accurate, 1.9× speedup?

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

                                          1. Initial program 100.0%

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

                                            \[\leadsto \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \color{blue}{\frac{1}{2} \cdot NaChar} \]
                                          4. Step-by-step derivation
                                            1. lower-*.f6478.3

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

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

                                            \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{EDonor}{KbT}}}} + \frac{1}{2} \cdot NaChar \]
                                          7. Step-by-step derivation
                                            1. lower-/.f6470.6

                                              \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{EDonor}{KbT}}}} + 0.5 \cdot NaChar \]
                                          8. Applied rewrites70.6%

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

                                          if -3.8e121 < KbT < 2.69999999999999982e179

                                          1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            \[\leadsto \frac{NdChar}{e^{\frac{\left(EDonor + Vef\right) - Ec}{KbT}} + 1} \]
                                          7. Step-by-step derivation
                                            1. Applied rewrites54.3%

                                              \[\leadsto \frac{NdChar}{e^{\frac{\left(EDonor + Vef\right) - Ec}{KbT}} + 1} \]
                                          8. Recombined 2 regimes into one program.
                                          9. Final simplification58.6%

                                            \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -3.8 \cdot 10^{+121}:\\ \;\;\;\;0.5 \cdot NaChar - \frac{NdChar}{-1 - e^{\frac{EDonor}{KbT}}}\\ \mathbf{elif}\;KbT \leq 2.7 \cdot 10^{+179}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{\left(EDonor + Vef\right) - Ec}{KbT}} - -1}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot NaChar - \frac{NdChar}{-1 - e^{\frac{EDonor}{KbT}}}\\ \end{array} \]
                                          10. Add Preprocessing

                                          Alternative 16: 40.7% accurate, 1.9× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\ \mathbf{if}\;KbT \leq -5.2 \cdot 10^{+131}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, \frac{NaChar}{KbT} \cdot Ev, t\_0\right)\\ \mathbf{elif}\;KbT \leq -2.2 \cdot 10^{+29}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{mu}{KbT}} - -1}\\ \mathbf{elif}\;KbT \leq 3.5 \cdot 10^{+69}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, \frac{-NdChar}{KbT} \cdot Ec, t\_0\right)\\ \end{array} \end{array} \]
                                          (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                           :precision binary64
                                           (let* ((t_0 (* (+ NaChar NdChar) 0.5)))
                                             (if (<= KbT -5.2e+131)
                                               (fma -0.25 (* (/ NaChar KbT) Ev) t_0)
                                               (if (<= KbT -2.2e+29)
                                                 (/ NdChar (- (exp (/ mu KbT)) -1.0))
                                                 (if (<= KbT 3.5e+69)
                                                   (/ NdChar (- (exp (/ EDonor KbT)) -1.0))
                                                   (fma -0.25 (* (/ (- NdChar) KbT) Ec) t_0))))))
                                          double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                          	double t_0 = (NaChar + NdChar) * 0.5;
                                          	double tmp;
                                          	if (KbT <= -5.2e+131) {
                                          		tmp = fma(-0.25, ((NaChar / KbT) * Ev), t_0);
                                          	} else if (KbT <= -2.2e+29) {
                                          		tmp = NdChar / (exp((mu / KbT)) - -1.0);
                                          	} else if (KbT <= 3.5e+69) {
                                          		tmp = NdChar / (exp((EDonor / KbT)) - -1.0);
                                          	} else {
                                          		tmp = fma(-0.25, ((-NdChar / KbT) * Ec), t_0);
                                          	}
                                          	return tmp;
                                          }
                                          
                                          function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                          	t_0 = Float64(Float64(NaChar + NdChar) * 0.5)
                                          	tmp = 0.0
                                          	if (KbT <= -5.2e+131)
                                          		tmp = fma(-0.25, Float64(Float64(NaChar / KbT) * Ev), t_0);
                                          	elseif (KbT <= -2.2e+29)
                                          		tmp = Float64(NdChar / Float64(exp(Float64(mu / KbT)) - -1.0));
                                          	elseif (KbT <= 3.5e+69)
                                          		tmp = Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) - -1.0));
                                          	else
                                          		tmp = fma(-0.25, Float64(Float64(Float64(-NdChar) / KbT) * Ec), t_0);
                                          	end
                                          	return tmp
                                          end
                                          
                                          code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[KbT, -5.2e+131], N[(-0.25 * N[(N[(NaChar / KbT), $MachinePrecision] * Ev), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[KbT, -2.2e+29], N[(NdChar / N[(N[Exp[N[(mu / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 3.5e+69], N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], N[(-0.25 * N[(N[((-NdChar) / KbT), $MachinePrecision] * Ec), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
                                          \mathbf{if}\;KbT \leq -5.2 \cdot 10^{+131}:\\
                                          \;\;\;\;\mathsf{fma}\left(-0.25, \frac{NaChar}{KbT} \cdot Ev, t\_0\right)\\
                                          
                                          \mathbf{elif}\;KbT \leq -2.2 \cdot 10^{+29}:\\
                                          \;\;\;\;\frac{NdChar}{e^{\frac{mu}{KbT}} - -1}\\
                                          
                                          \mathbf{elif}\;KbT \leq 3.5 \cdot 10^{+69}:\\
                                          \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\mathsf{fma}\left(-0.25, \frac{-NdChar}{KbT} \cdot Ec, t\_0\right)\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 4 regimes
                                          2. if KbT < -5.2e131

                                            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

                                                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left(\frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT}\right)} + \left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right) \]
                                              9. metadata-evalN/A

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

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

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

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

                                              if -5.2e131 < KbT < -2.2000000000000001e29

                                              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                if -2.2000000000000001e29 < KbT < 3.49999999999999987e69

                                                1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                  if 3.49999999999999987e69 < KbT

                                                  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. Add Preprocessing
                                                  3. Taylor expanded in KbT around -inf

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

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

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

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

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

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

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

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

                                                      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left(\frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT}\right)} + \left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right) \]
                                                    9. metadata-evalN/A

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

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

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

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

                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -5.2 \cdot 10^{+131}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, \frac{NaChar}{KbT} \cdot Ev, \left(NaChar + NdChar\right) \cdot 0.5\right)\\ \mathbf{elif}\;KbT \leq -2.2 \cdot 10^{+29}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{mu}{KbT}} - -1}\\ \mathbf{elif}\;KbT \leq 3.5 \cdot 10^{+69}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, \frac{-NdChar}{KbT} \cdot Ec, \left(NaChar + NdChar\right) \cdot 0.5\right)\\ \end{array} \]
                                                  10. Add Preprocessing

                                                  Alternative 17: 40.9% accurate, 1.9× speedup?

                                                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\ \mathbf{if}\;KbT \leq -6 \cdot 10^{+131}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, \frac{NaChar}{KbT} \cdot Ev, t\_0\right)\\ \mathbf{elif}\;KbT \leq -1.35 \cdot 10^{+44}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} - -1}\\ \mathbf{elif}\;KbT \leq 3.5 \cdot 10^{+69}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, \frac{-NdChar}{KbT} \cdot Ec, t\_0\right)\\ \end{array} \end{array} \]
                                                  (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                   :precision binary64
                                                   (let* ((t_0 (* (+ NaChar NdChar) 0.5)))
                                                     (if (<= KbT -6e+131)
                                                       (fma -0.25 (* (/ NaChar KbT) Ev) t_0)
                                                       (if (<= KbT -1.35e+44)
                                                         (/ NdChar (- (exp (/ Vef KbT)) -1.0))
                                                         (if (<= KbT 3.5e+69)
                                                           (/ NdChar (- (exp (/ EDonor KbT)) -1.0))
                                                           (fma -0.25 (* (/ (- NdChar) KbT) Ec) t_0))))))
                                                  double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                  	double t_0 = (NaChar + NdChar) * 0.5;
                                                  	double tmp;
                                                  	if (KbT <= -6e+131) {
                                                  		tmp = fma(-0.25, ((NaChar / KbT) * Ev), t_0);
                                                  	} else if (KbT <= -1.35e+44) {
                                                  		tmp = NdChar / (exp((Vef / KbT)) - -1.0);
                                                  	} else if (KbT <= 3.5e+69) {
                                                  		tmp = NdChar / (exp((EDonor / KbT)) - -1.0);
                                                  	} else {
                                                  		tmp = fma(-0.25, ((-NdChar / KbT) * Ec), t_0);
                                                  	}
                                                  	return tmp;
                                                  }
                                                  
                                                  function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                  	t_0 = Float64(Float64(NaChar + NdChar) * 0.5)
                                                  	tmp = 0.0
                                                  	if (KbT <= -6e+131)
                                                  		tmp = fma(-0.25, Float64(Float64(NaChar / KbT) * Ev), t_0);
                                                  	elseif (KbT <= -1.35e+44)
                                                  		tmp = Float64(NdChar / Float64(exp(Float64(Vef / KbT)) - -1.0));
                                                  	elseif (KbT <= 3.5e+69)
                                                  		tmp = Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) - -1.0));
                                                  	else
                                                  		tmp = fma(-0.25, Float64(Float64(Float64(-NdChar) / KbT) * Ec), t_0);
                                                  	end
                                                  	return tmp
                                                  end
                                                  
                                                  code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[KbT, -6e+131], N[(-0.25 * N[(N[(NaChar / KbT), $MachinePrecision] * Ev), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[KbT, -1.35e+44], N[(NdChar / N[(N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 3.5e+69], N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], N[(-0.25 * N[(N[((-NdChar) / KbT), $MachinePrecision] * Ec), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]
                                                  
                                                  \begin{array}{l}
                                                  
                                                  \\
                                                  \begin{array}{l}
                                                  t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
                                                  \mathbf{if}\;KbT \leq -6 \cdot 10^{+131}:\\
                                                  \;\;\;\;\mathsf{fma}\left(-0.25, \frac{NaChar}{KbT} \cdot Ev, t\_0\right)\\
                                                  
                                                  \mathbf{elif}\;KbT \leq -1.35 \cdot 10^{+44}:\\
                                                  \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} - -1}\\
                                                  
                                                  \mathbf{elif}\;KbT \leq 3.5 \cdot 10^{+69}:\\
                                                  \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\
                                                  
                                                  \mathbf{else}:\\
                                                  \;\;\;\;\mathsf{fma}\left(-0.25, \frac{-NdChar}{KbT} \cdot Ec, t\_0\right)\\
                                                  
                                                  
                                                  \end{array}
                                                  \end{array}
                                                  
                                                  Derivation
                                                  1. Split input into 4 regimes
                                                  2. if KbT < -6.0000000000000003e131

                                                    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

                                                        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left(\frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT}\right)} + \left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right) \]
                                                      9. metadata-evalN/A

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

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

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

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

                                                      if -6.0000000000000003e131 < KbT < -1.35e44

                                                      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                        if -1.35e44 < KbT < 3.49999999999999987e69

                                                        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                          if 3.49999999999999987e69 < KbT

                                                          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. Add Preprocessing
                                                          3. Taylor expanded in KbT around -inf

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

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

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

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

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

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

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

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

                                                              \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left(\frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT}\right)} + \left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right) \]
                                                            9. metadata-evalN/A

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

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

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

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

                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -6 \cdot 10^{+131}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, \frac{NaChar}{KbT} \cdot Ev, \left(NaChar + NdChar\right) \cdot 0.5\right)\\ \mathbf{elif}\;KbT \leq -1.35 \cdot 10^{+44}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} - -1}\\ \mathbf{elif}\;KbT \leq 3.5 \cdot 10^{+69}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, \frac{-NdChar}{KbT} \cdot Ec, \left(NaChar + NdChar\right) \cdot 0.5\right)\\ \end{array} \]
                                                          10. Add Preprocessing

                                                          Alternative 18: 52.5% accurate, 1.9× speedup?

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

                                                            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. Add Preprocessing
                                                            3. Taylor expanded in NaChar around 0

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

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

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

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

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

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

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

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

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

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

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

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

                                                              \[\leadsto \frac{NdChar}{e^{\frac{\left(EDonor + Vef\right) - Ec}{KbT}} + 1} \]
                                                            7. Step-by-step derivation
                                                              1. Applied rewrites66.0%

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

                                                              if -9.80000000000000061e-58 < NdChar < 1.65000000000000006e101

                                                              1. Initial program 100.0%

                                                                \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                              2. Add Preprocessing
                                                              3. Step-by-step derivation
                                                                1. lift-exp.f64N/A

                                                                  \[\leadsto \frac{NdChar}{1 + \color{blue}{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. lift-/.f64N/A

                                                                  \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\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}}} \]
                                                                3. clear-numN/A

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

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

                                                                  \[\leadsto \frac{NdChar}{1 + e^{1 \cdot \color{blue}{\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}}} \]
                                                                6. lift-/.f64N/A

                                                                  \[\leadsto \frac{NdChar}{1 + e^{1 \cdot \color{blue}{\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}}} \]
                                                                7. exp-prodN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                  \[\leadsto \frac{NaChar}{e^{\frac{Vef}{KbT}} + 1} \]
                                                              10. Recombined 2 regimes into one program.
                                                              11. Final simplification57.8%

                                                                \[\leadsto \begin{array}{l} \mathbf{if}\;NdChar \leq -9.8 \cdot 10^{-58}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{\left(EDonor + Vef\right) - Ec}{KbT}} - -1}\\ \mathbf{elif}\;NdChar \leq 1.65 \cdot 10^{+101}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} - -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{\left(EDonor + Vef\right) - Ec}{KbT}} - -1}\\ \end{array} \]
                                                              12. Add Preprocessing

                                                              Alternative 19: 42.4% accurate, 2.0× speedup?

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

                                                                1. Initial program 99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                  if -1.95e124 < NdChar < 7.80000000000000012e139

                                                                  1. Initial program 100.0%

                                                                    \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                  2. Add Preprocessing
                                                                  3. Step-by-step derivation
                                                                    1. lift-exp.f64N/A

                                                                      \[\leadsto \frac{NdChar}{1 + \color{blue}{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. lift-/.f64N/A

                                                                      \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\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}}} \]
                                                                    3. clear-numN/A

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

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

                                                                      \[\leadsto \frac{NdChar}{1 + e^{1 \cdot \color{blue}{\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}}} \]
                                                                    6. lift-/.f64N/A

                                                                      \[\leadsto \frac{NdChar}{1 + e^{1 \cdot \color{blue}{\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}}} \]
                                                                    7. exp-prodN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                    \[\leadsto \frac{NaChar}{e^{\frac{Vef}{KbT}} + 1} \]
                                                                  9. Step-by-step derivation
                                                                    1. Applied rewrites48.0%

                                                                      \[\leadsto \frac{NaChar}{e^{\frac{Vef}{KbT}} + 1} \]
                                                                  10. Recombined 2 regimes into one program.
                                                                  11. Final simplification50.5%

                                                                    \[\leadsto \begin{array}{l} \mathbf{if}\;NdChar \leq -1.95 \cdot 10^{+124}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\ \mathbf{elif}\;NdChar \leq 7.8 \cdot 10^{+139}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} - -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\ \end{array} \]
                                                                  12. Add Preprocessing

                                                                  Alternative 20: 40.7% accurate, 2.0× speedup?

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

                                                                    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. Add Preprocessing
                                                                    3. Taylor expanded in NaChar around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                      if -1.80000000000000004e47 < NdChar < 1.56000000000000002e140

                                                                      1. Initial program 100.0%

                                                                        \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                      2. Add Preprocessing
                                                                      3. Step-by-step derivation
                                                                        1. lift-exp.f64N/A

                                                                          \[\leadsto \frac{NdChar}{1 + \color{blue}{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. lift-/.f64N/A

                                                                          \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\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}}} \]
                                                                        3. clear-numN/A

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

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

                                                                          \[\leadsto \frac{NdChar}{1 + e^{1 \cdot \color{blue}{\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}}} \]
                                                                        6. lift-/.f64N/A

                                                                          \[\leadsto \frac{NdChar}{1 + e^{1 \cdot \color{blue}{\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}}} \]
                                                                        7. exp-prodN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                          \[\leadsto \frac{NaChar}{e^{\frac{Ev}{KbT}} + 1} \]
                                                                      10. Recombined 2 regimes into one program.
                                                                      11. Final simplification48.5%

                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;NdChar \leq -1.8 \cdot 10^{+47}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\ \mathbf{elif}\;NdChar \leq 1.56 \cdot 10^{+140}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} - -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\ \end{array} \]
                                                                      12. Add Preprocessing

                                                                      Alternative 21: 41.4% accurate, 2.0× speedup?

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

                                                                        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. Add Preprocessing
                                                                        3. Taylor expanded in NaChar around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                          if -2.2999999999999999e47 < NdChar < 8.9999999999999999e139

                                                                          1. Initial program 100.0%

                                                                            \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
                                                                          2. Add Preprocessing
                                                                          3. Step-by-step derivation
                                                                            1. lift-exp.f64N/A

                                                                              \[\leadsto \frac{NdChar}{1 + \color{blue}{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. lift-/.f64N/A

                                                                              \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\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}}} \]
                                                                            3. clear-numN/A

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

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

                                                                              \[\leadsto \frac{NdChar}{1 + e^{1 \cdot \color{blue}{\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}}} \]
                                                                            6. lift-/.f64N/A

                                                                              \[\leadsto \frac{NdChar}{1 + e^{1 \cdot \color{blue}{\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}}} \]
                                                                            7. exp-prodN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                              \[\leadsto \frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1} \]
                                                                          10. Recombined 2 regimes into one program.
                                                                          11. Final simplification47.0%

                                                                            \[\leadsto \begin{array}{l} \mathbf{if}\;NdChar \leq -2.3 \cdot 10^{+47}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\ \mathbf{elif}\;NdChar \leq 9 \cdot 10^{+139}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} - -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\ \end{array} \]
                                                                          12. Add Preprocessing

                                                                          Alternative 22: 40.7% accurate, 2.0× speedup?

                                                                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\ \mathbf{if}\;KbT \leq -5.2 \cdot 10^{+131}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, \frac{NaChar}{KbT} \cdot Ev, t\_0\right)\\ \mathbf{elif}\;KbT \leq 3.5 \cdot 10^{+69}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, \frac{-NdChar}{KbT} \cdot Ec, t\_0\right)\\ \end{array} \end{array} \]
                                                                          (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                                           :precision binary64
                                                                           (let* ((t_0 (* (+ NaChar NdChar) 0.5)))
                                                                             (if (<= KbT -5.2e+131)
                                                                               (fma -0.25 (* (/ NaChar KbT) Ev) t_0)
                                                                               (if (<= KbT 3.5e+69)
                                                                                 (/ NdChar (- (exp (/ EDonor KbT)) -1.0))
                                                                                 (fma -0.25 (* (/ (- NdChar) KbT) Ec) t_0)))))
                                                                          double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                                          	double t_0 = (NaChar + NdChar) * 0.5;
                                                                          	double tmp;
                                                                          	if (KbT <= -5.2e+131) {
                                                                          		tmp = fma(-0.25, ((NaChar / KbT) * Ev), t_0);
                                                                          	} else if (KbT <= 3.5e+69) {
                                                                          		tmp = NdChar / (exp((EDonor / KbT)) - -1.0);
                                                                          	} else {
                                                                          		tmp = fma(-0.25, ((-NdChar / KbT) * Ec), t_0);
                                                                          	}
                                                                          	return tmp;
                                                                          }
                                                                          
                                                                          function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                                          	t_0 = Float64(Float64(NaChar + NdChar) * 0.5)
                                                                          	tmp = 0.0
                                                                          	if (KbT <= -5.2e+131)
                                                                          		tmp = fma(-0.25, Float64(Float64(NaChar / KbT) * Ev), t_0);
                                                                          	elseif (KbT <= 3.5e+69)
                                                                          		tmp = Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) - -1.0));
                                                                          	else
                                                                          		tmp = fma(-0.25, Float64(Float64(Float64(-NdChar) / KbT) * Ec), t_0);
                                                                          	end
                                                                          	return tmp
                                                                          end
                                                                          
                                                                          code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[KbT, -5.2e+131], N[(-0.25 * N[(N[(NaChar / KbT), $MachinePrecision] * Ev), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[KbT, 3.5e+69], N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], N[(-0.25 * N[(N[((-NdChar) / KbT), $MachinePrecision] * Ec), $MachinePrecision] + t$95$0), $MachinePrecision]]]]
                                                                          
                                                                          \begin{array}{l}
                                                                          
                                                                          \\
                                                                          \begin{array}{l}
                                                                          t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
                                                                          \mathbf{if}\;KbT \leq -5.2 \cdot 10^{+131}:\\
                                                                          \;\;\;\;\mathsf{fma}\left(-0.25, \frac{NaChar}{KbT} \cdot Ev, t\_0\right)\\
                                                                          
                                                                          \mathbf{elif}\;KbT \leq 3.5 \cdot 10^{+69}:\\
                                                                          \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\
                                                                          
                                                                          \mathbf{else}:\\
                                                                          \;\;\;\;\mathsf{fma}\left(-0.25, \frac{-NdChar}{KbT} \cdot Ec, t\_0\right)\\
                                                                          
                                                                          
                                                                          \end{array}
                                                                          \end{array}
                                                                          
                                                                          Derivation
                                                                          1. Split input into 3 regimes
                                                                          2. if KbT < -5.2e131

                                                                            1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

                                                                                \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left(\frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT}\right)} + \left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right) \]
                                                                              9. metadata-evalN/A

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

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

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

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

                                                                              if -5.2e131 < KbT < 3.49999999999999987e69

                                                                              1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                if 3.49999999999999987e69 < KbT

                                                                                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. Add Preprocessing
                                                                                3. Taylor expanded in KbT around -inf

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

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

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

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

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

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

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

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

                                                                                    \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\frac{1}{4}\right)\right) \cdot \left(\frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT}\right)} + \left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right) \]
                                                                                  9. metadata-evalN/A

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

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

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

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

                                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -5.2 \cdot 10^{+131}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, \frac{NaChar}{KbT} \cdot Ev, \left(NaChar + NdChar\right) \cdot 0.5\right)\\ \mathbf{elif}\;KbT \leq 3.5 \cdot 10^{+69}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(-0.25, \frac{-NdChar}{KbT} \cdot Ec, \left(NaChar + NdChar\right) \cdot 0.5\right)\\ \end{array} \]
                                                                                10. Add Preprocessing

                                                                                Alternative 23: 22.9% accurate, 15.3× speedup?

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

                                                                                  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. Add Preprocessing
                                                                                  3. Taylor expanded in NaChar around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                                                    if -2.0000000000000001e47 < NdChar < 1.56000000000000002e140

                                                                                    1. Initial program 100.0%

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

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

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

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

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

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

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

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

                                                                                    Alternative 24: 28.2% accurate, 30.7× speedup?

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

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

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

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

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

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

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

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

                                                                                    Alternative 25: 18.8% accurate, 46.0× speedup?

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

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

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

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

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

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

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

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

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

                                                                                      Reproduce

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