Bulmash initializePoisson

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

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

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

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

Alternative 2: 78.7% accurate, 0.3× speedup?

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

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

\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-220}:\\
\;\;\;\;t\_2\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -4.99999999999999971e-253 or 5.0000000000000002e-220 < (+.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 Ev 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{Ev}{KbT}}}} \]
    4. Step-by-step derivation
      1. lower-/.f6477.4

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

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

    if -4.99999999999999971e-253 < (+.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.0000000000000002e-220

    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-+.f6494.1

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

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

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

Alternative 3: 36.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-271}:\\
\;\;\;\;\frac{NdChar}{\left(\left(\frac{mu}{KbT} + \frac{Vef}{KbT}\right) + \left(2 + \frac{EDonor}{KbT}\right)\right) - \frac{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))))) < -1.99999999999999986e-272 or 1.99999999999999993e-271 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT)))))

    1. Initial program 100.0%

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

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

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

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

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

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

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

    if -1.99999999999999986e-272 < (+.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.99999999999999993e-271

    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-+.f6493.7

        \[\leadsto \frac{NdChar}{e^{\frac{\left(\color{blue}{\left(mu + Vef\right)} + EDonor\right) - Ec}{KbT}} + 1} \]
    5. Applied rewrites93.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 rewrites54.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}}} \]
    8. Recombined 2 regimes into one program.
    9. Final simplification40.8%

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

    Alternative 4: 35.9% accurate, 0.4× speedup?

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

      if -1.99999999999999986e-272 < (+.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.99999999999999993e-271

      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-+.f6495.1

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

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

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

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

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

      Alternative 5: 39.9% accurate, 1.8× speedup?

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

        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-+.f6470.6

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

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

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

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

          if -5.09999999999999995e-55 < Ec < -2.50000000000000014e-289

          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 Ev 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{Ev}{KbT}}}} \]
          4. Step-by-step derivation
            1. lower-/.f6477.4

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

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

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

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

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

          if -2.50000000000000014e-289 < Ec < 4.5000000000000003e-99

          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.2

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

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

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

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

            if 4.5000000000000003e-99 < Ec < 5.3999999999999997e227

            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-+.f6473.4

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

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

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

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

              if 5.3999999999999997e227 < Ec

              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-+.f6478.1

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;Ec \leq -5.1 \cdot 10^{-55}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\ \mathbf{elif}\;Ec \leq -2.5 \cdot 10^{-289}:\\ \;\;\;\;0.5 \cdot NdChar + \frac{NaChar}{1 + e^{\frac{Ev}{KbT}}}\\ \mathbf{elif}\;Ec \leq 4.5 \cdot 10^{-99}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} - -1}\\ \mathbf{elif}\;Ec \leq 5.4 \cdot 10^{+227}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{-Ec}{KbT}} - -1}\\ \end{array} \]
              10. Add Preprocessing

              Alternative 6: 39.7% accurate, 1.8× speedup?

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

                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-+.f6470.5

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

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

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

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

                  if -7.60000000000000004e-72 < Ec < -2.5499999999999999e-287

                  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-+.f6460.3

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

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

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

                    if -2.5499999999999999e-287 < Ec < 4.5000000000000003e-99

                    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-+.f6470.8

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

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

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

                      if 4.5000000000000003e-99 < Ec < 5.3999999999999997e227

                      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-+.f6473.4

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

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

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

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

                        if 5.3999999999999997e227 < Ec

                        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-+.f6478.1

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

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

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

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

                          \[\leadsto \begin{array}{l} \mathbf{if}\;Ec \leq -7.6 \cdot 10^{-72}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\ \mathbf{elif}\;Ec \leq -2.55 \cdot 10^{-287}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{mu}{KbT}} - -1}\\ \mathbf{elif}\;Ec \leq 4.5 \cdot 10^{-99}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} - -1}\\ \mathbf{elif}\;Ec \leq 5.4 \cdot 10^{+227}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{-Ec}{KbT}} - -1}\\ \end{array} \]
                        10. Add Preprocessing

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

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

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

                          if -4.2e155 < NdChar < 1.5200000000000001e-75

                          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-+.f6475.0

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

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

                        Alternative 8: 60.7% accurate, 1.9× speedup?

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

                          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-+.f6484.0

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

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

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

                            if -3.9999999999999999e156 < NdChar < 6.59999999999999969e206

                            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-+.f6469.8

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

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

                            if 6.59999999999999969e206 < 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-+.f6490.2

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

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

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

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

                            Alternative 9: 43.5% accurate, 1.9× speedup?

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

                              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-+.f6484.0

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

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

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

                                if -4.2e155 < NdChar < 3.80000000000000028e-8

                                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-+.f6474.0

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

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

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

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

                                  if 3.80000000000000028e-8 < NdChar < 1.55e197

                                  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-+.f6473.6

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

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

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

                                    if 1.55e197 < 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-+.f6487.2

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

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

                                        \[\leadsto \frac{NdChar}{e^{\frac{mu}{KbT}} + 1} \]
                                    8. Recombined 4 regimes into one program.
                                    9. Final simplification54.9%

                                      \[\leadsto \begin{array}{l} \mathbf{if}\;NdChar \leq -4.2 \cdot 10^{+155}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} - -1}\\ \mathbf{elif}\;NdChar \leq 3.8 \cdot 10^{-8}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\ \mathbf{elif}\;NdChar \leq 1.55 \cdot 10^{+197}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{mu}{KbT}} - -1}\\ \end{array} \]
                                    10. Add Preprocessing

                                    Alternative 10: 44.1% accurate, 1.9× speedup?

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

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

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

                                        if -1.8999999999999999e91 < NdChar < -1800

                                        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-+.f6474.3

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

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

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

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

                                          if -1800 < NdChar < 3.80000000000000028e-8

                                          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-+.f6474.8

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

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

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

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

                                            \[\leadsto \begin{array}{l} \mathbf{if}\;NdChar \leq -1.9 \cdot 10^{+91}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\ \mathbf{elif}\;NdChar \leq -1800:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\ \mathbf{elif}\;NdChar \leq 3.8 \cdot 10^{-8}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\ \end{array} \]
                                          10. Add Preprocessing

                                          Alternative 11: 44.2% accurate, 1.9× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\ \mathbf{if}\;Vef \leq -4 \cdot 10^{-29}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;Vef \leq 7.4 \cdot 10^{-183}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\ \mathbf{elif}\;Vef \leq 1.22 \cdot 10^{+67}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{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 (+ 1.0 (exp (/ Vef KbT))))))
                                             (if (<= Vef -4e-29)
                                               t_0
                                               (if (<= Vef 7.4e-183)
                                                 (/ NaChar (+ 1.0 (exp (/ EAccept KbT))))
                                                 (if (<= Vef 1.22e+67) (/ NaChar (+ 1.0 (exp (/ Ev 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 / (1.0 + exp((Vef / KbT)));
                                          	double tmp;
                                          	if (Vef <= -4e-29) {
                                          		tmp = t_0;
                                          	} else if (Vef <= 7.4e-183) {
                                          		tmp = NaChar / (1.0 + exp((EAccept / KbT)));
                                          	} else if (Vef <= 1.22e+67) {
                                          		tmp = NaChar / (1.0 + exp((Ev / KbT)));
                                          	} else {
                                          		tmp = t_0;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                                              real(8), intent (in) :: ndchar
                                              real(8), intent (in) :: ec
                                              real(8), intent (in) :: vef
                                              real(8), intent (in) :: edonor
                                              real(8), intent (in) :: mu
                                              real(8), intent (in) :: kbt
                                              real(8), intent (in) :: nachar
                                              real(8), intent (in) :: ev
                                              real(8), intent (in) :: eaccept
                                              real(8) :: t_0
                                              real(8) :: tmp
                                              t_0 = nachar / (1.0d0 + exp((vef / kbt)))
                                              if (vef <= (-4d-29)) then
                                                  tmp = t_0
                                              else if (vef <= 7.4d-183) then
                                                  tmp = nachar / (1.0d0 + exp((eaccept / kbt)))
                                              else if (vef <= 1.22d+67) then
                                                  tmp = nachar / (1.0d0 + exp((ev / 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 / (1.0 + Math.exp((Vef / KbT)));
                                          	double tmp;
                                          	if (Vef <= -4e-29) {
                                          		tmp = t_0;
                                          	} else if (Vef <= 7.4e-183) {
                                          		tmp = NaChar / (1.0 + Math.exp((EAccept / KbT)));
                                          	} else if (Vef <= 1.22e+67) {
                                          		tmp = NaChar / (1.0 + Math.exp((Ev / KbT)));
                                          	} else {
                                          		tmp = t_0;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                          	t_0 = NaChar / (1.0 + math.exp((Vef / KbT)))
                                          	tmp = 0
                                          	if Vef <= -4e-29:
                                          		tmp = t_0
                                          	elif Vef <= 7.4e-183:
                                          		tmp = NaChar / (1.0 + math.exp((EAccept / KbT)))
                                          	elif Vef <= 1.22e+67:
                                          		tmp = NaChar / (1.0 + math.exp((Ev / KbT)))
                                          	else:
                                          		tmp = t_0
                                          	return tmp
                                          
                                          function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                          	t_0 = Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT))))
                                          	tmp = 0.0
                                          	if (Vef <= -4e-29)
                                          		tmp = t_0;
                                          	elseif (Vef <= 7.4e-183)
                                          		tmp = Float64(NaChar / Float64(1.0 + exp(Float64(EAccept / KbT))));
                                          	elseif (Vef <= 1.22e+67)
                                          		tmp = Float64(NaChar / Float64(1.0 + exp(Float64(Ev / 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 / (1.0 + exp((Vef / KbT)));
                                          	tmp = 0.0;
                                          	if (Vef <= -4e-29)
                                          		tmp = t_0;
                                          	elseif (Vef <= 7.4e-183)
                                          		tmp = NaChar / (1.0 + exp((EAccept / KbT)));
                                          	elseif (Vef <= 1.22e+67)
                                          		tmp = NaChar / (1.0 + exp((Ev / KbT)));
                                          	else
                                          		tmp = t_0;
                                          	end
                                          	tmp_2 = tmp;
                                          end
                                          
                                          code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Vef, -4e-29], t$95$0, If[LessEqual[Vef, 7.4e-183], N[(NaChar / N[(1.0 + N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[Vef, 1.22e+67], N[(NaChar / N[(1.0 + N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          t_0 := \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\
                                          \mathbf{if}\;Vef \leq -4 \cdot 10^{-29}:\\
                                          \;\;\;\;t\_0\\
                                          
                                          \mathbf{elif}\;Vef \leq 7.4 \cdot 10^{-183}:\\
                                          \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\
                                          
                                          \mathbf{elif}\;Vef \leq 1.22 \cdot 10^{+67}:\\
                                          \;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{KbT}}}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;t\_0\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 3 regimes
                                          2. if Vef < -3.99999999999999977e-29 or 1.22000000000000004e67 < Vef

                                            1. Initial program 100.0%

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

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

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

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

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

                                              if -3.99999999999999977e-29 < Vef < 7.3999999999999997e-183

                                              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-+.f6456.6

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

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

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

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

                                                if 7.3999999999999997e-183 < Vef < 1.22000000000000004e67

                                                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-+.f6459.8

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

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

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

                                                    \[\leadsto \frac{NaChar}{e^{\frac{Ev}{KbT}} + 1} \]
                                                8. Recombined 3 regimes into one program.
                                                9. Final simplification46.6%

                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;Vef \leq -4 \cdot 10^{-29}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\ \mathbf{elif}\;Vef \leq 7.4 \cdot 10^{-183}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\ \mathbf{elif}\;Vef \leq 1.22 \cdot 10^{+67}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\ \end{array} \]
                                                10. Add Preprocessing

                                                Alternative 12: 40.7% accurate, 1.9× speedup?

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

                                                  1. Initial program 100.0%

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

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

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

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

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

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

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

                                                  if -6.59999999999999948e92 < KbT < -4.5e-141

                                                  1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                    if -4.5e-141 < KbT < 3e117

                                                    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-+.f6468.9

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

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

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

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

                                                      if 3e117 < 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}{-1 \cdot \frac{\frac{1}{4} \cdot \left(NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)\right) + \frac{1}{4} \cdot \left(NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)\right)}{KbT} + \left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right)} \]
                                                      4. Step-by-step derivation
                                                        1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -6.6 \cdot 10^{+92}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \mathbf{elif}\;KbT \leq -4.5 \cdot 10^{-141}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\ \mathbf{elif}\;KbT \leq 3 \cdot 10^{+117}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.5, NaChar + NdChar, -0.25 \cdot \left(\frac{NdChar}{KbT} \cdot EDonor\right)\right)\\ \end{array} \]
                                                      10. Add Preprocessing

                                                      Alternative 13: 43.9% accurate, 2.0× speedup?

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

                                                        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-+.f6484.0

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

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

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

                                                          if -4.2e155 < NdChar < 3.80000000000000028e-8

                                                          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-+.f6474.0

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

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

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

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

                                                            if 3.80000000000000028e-8 < 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-+.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. Taylor expanded in EDonor around inf

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

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

                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;NdChar \leq -4.2 \cdot 10^{+155}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} - -1}\\ \mathbf{elif}\;NdChar \leq 3.8 \cdot 10^{-8}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\ \end{array} \]
                                                            10. Add Preprocessing

                                                            Alternative 14: 41.0% accurate, 2.0× speedup?

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

                                                              1. Initial program 100.0%

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

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

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

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

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

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

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

                                                              if -6.59999999999999948e92 < KbT < 2.2e115

                                                              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-+.f6465.3

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

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

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

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

                                                                if 2.2e115 < 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}{-1 \cdot \frac{\frac{1}{4} \cdot \left(NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)\right) + \frac{1}{4} \cdot \left(NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)\right)}{KbT} + \left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right)} \]
                                                                4. Step-by-step derivation
                                                                  1. +-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

                                                                  \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -6.6 \cdot 10^{+92}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \mathbf{elif}\;KbT \leq 2.2 \cdot 10^{+115}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(0.5, NaChar + NdChar, -0.25 \cdot \left(\frac{NdChar}{KbT} \cdot EDonor\right)\right)\\ \end{array} \]
                                                                10. Add Preprocessing

                                                                Alternative 15: 22.6% accurate, 15.3× speedup?

                                                                \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;NdChar \leq -4.2 \cdot 10^{+155}:\\ \;\;\;\;0.5 \cdot NdChar\\ \mathbf{elif}\;NdChar \leq 2.6 \cdot 10^{-7}:\\ \;\;\;\;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 -4.2e+155)
                                                                   (* 0.5 NdChar)
                                                                   (if (<= NdChar 2.6e-7) (* 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 <= -4.2e+155) {
                                                                		tmp = 0.5 * NdChar;
                                                                	} else if (NdChar <= 2.6e-7) {
                                                                		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 <= (-4.2d+155)) then
                                                                        tmp = 0.5d0 * ndchar
                                                                    else if (ndchar <= 2.6d-7) 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 <= -4.2e+155) {
                                                                		tmp = 0.5 * NdChar;
                                                                	} else if (NdChar <= 2.6e-7) {
                                                                		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 <= -4.2e+155:
                                                                		tmp = 0.5 * NdChar
                                                                	elif NdChar <= 2.6e-7:
                                                                		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 <= -4.2e+155)
                                                                		tmp = Float64(0.5 * NdChar);
                                                                	elseif (NdChar <= 2.6e-7)
                                                                		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 <= -4.2e+155)
                                                                		tmp = 0.5 * NdChar;
                                                                	elseif (NdChar <= 2.6e-7)
                                                                		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, -4.2e+155], N[(0.5 * NdChar), $MachinePrecision], If[LessEqual[NdChar, 2.6e-7], N[(0.5 * NaChar), $MachinePrecision], N[(0.5 * NdChar), $MachinePrecision]]]
                                                                
                                                                \begin{array}{l}
                                                                
                                                                \\
                                                                \begin{array}{l}
                                                                \mathbf{if}\;NdChar \leq -4.2 \cdot 10^{+155}:\\
                                                                \;\;\;\;0.5 \cdot NdChar\\
                                                                
                                                                \mathbf{elif}\;NdChar \leq 2.6 \cdot 10^{-7}:\\
                                                                \;\;\;\;0.5 \cdot NaChar\\
                                                                
                                                                \mathbf{else}:\\
                                                                \;\;\;\;0.5 \cdot NdChar\\
                                                                
                                                                
                                                                \end{array}
                                                                \end{array}
                                                                
                                                                Derivation
                                                                1. Split input into 2 regimes
                                                                2. if NdChar < -4.2e155 or 2.59999999999999999e-7 < 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 KbT around inf

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

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

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

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

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

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

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

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

                                                                    if -4.2e155 < NdChar < 2.59999999999999999e-7

                                                                    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-+.f6474.0

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

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

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

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

                                                                    Alternative 16: 27.8% accurate, 30.7× speedup?

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

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

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

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

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

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

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

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

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

                                                                    Alternative 17: 18.5% accurate, 46.0× speedup?

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

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

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

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

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

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

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

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

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

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

                                                                      Reproduce

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