Bulmash initializePoisson

Percentage Accurate: 100.0% → 100.0%
Time: 15.7s
Alternatives: 19
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 19 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(EAccept + \left(Ev + Vef\right)\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 (/ (- (+ EAccept (+ Ev Vef)) 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((((EAccept + (Ev + Vef)) - 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((((eaccept + (ev + vef)) - 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((((EAccept + (Ev + Vef)) - 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((((EAccept + (Ev + Vef)) - 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(EAccept + Float64(Ev + Vef)) - 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((((EAccept + (Ev + Vef)) - 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[(EAccept + N[(Ev + Vef), $MachinePrecision]), $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(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}
\end{array}
Derivation
  1. Initial program 99.9%

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

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

Alternative 2: 72.2% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-94}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}} - -1}\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot NdChar - \frac{NaChar}{-1 - t\_0}\\


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

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

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

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

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

    if -1.9999999999999999e-188 < (+.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.9999999999999999e-94

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 99.9%

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

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

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

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

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

Alternative 3: 68.0% accurate, 0.4× speedup?

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

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

\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-94}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}} - -1}\\

\mathbf{else}:\\
\;\;\;\;0.5 \cdot NdChar - \frac{NaChar}{-1 - t\_0}\\


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

    1. Initial program 100.0%

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

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

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

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

    if -5.00000000000000018e-11 < (+.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.9999999999999999e-94

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    1. Initial program 99.9%

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

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

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

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

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

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

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

    1. Initial program 100.0%

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

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

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

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

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

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

    if -4.99999999999999981e-292 < (+.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))))) < 2.00000000000000004e-91

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} \leq -5 \cdot 10^{-292}:\\ \;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\ \mathbf{elif}\;\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} \leq 2 \cdot 10^{-91}:\\ \;\;\;\;\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 5: 35.3% 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(EAccept + \left(Ev + Vef\right)\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^{-274}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-242}:\\ \;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(\frac{\frac{NdChar \cdot NdChar}{NaChar} - NdChar}{NaChar}, -1, -1\right)}{-NaChar}} \cdot 0.5\\ \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 (/ (- (+ EAccept (+ Ev Vef)) mu) KbT))))
              (/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))))))
       (if (<= t_1 -2e-274)
         t_0
         (if (<= t_1 5e-242)
           (*
            (/
             1.0
             (/
              (fma (/ (- (/ (* NdChar NdChar) NaChar) NdChar) NaChar) -1.0 -1.0)
              (- NaChar)))
            0.5)
           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((((EAccept + (Ev + Vef)) - mu) / KbT)))) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
    	double tmp;
    	if (t_1 <= -2e-274) {
    		tmp = t_0;
    	} else if (t_1 <= 5e-242) {
    		tmp = (1.0 / (fma(((((NdChar * NdChar) / NaChar) - NdChar) / NaChar), -1.0, -1.0) / -NaChar)) * 0.5;
    	} 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(EAccept + Float64(Ev + Vef)) - mu) / KbT)))) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))))
    	tmp = 0.0
    	if (t_1 <= -2e-274)
    		tmp = t_0;
    	elseif (t_1 <= 5e-242)
    		tmp = Float64(Float64(1.0 / Float64(fma(Float64(Float64(Float64(Float64(NdChar * NdChar) / NaChar) - NdChar) / NaChar), -1.0, -1.0) / Float64(-NaChar))) * 0.5);
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $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-274], t$95$0, If[LessEqual[t$95$1, 5e-242], N[(N[(1.0 / N[(N[(N[(N[(N[(N[(NdChar * NdChar), $MachinePrecision] / NaChar), $MachinePrecision] - NdChar), $MachinePrecision] / NaChar), $MachinePrecision] * -1.0 + -1.0), $MachinePrecision] / (-NaChar)), $MachinePrecision]), $MachinePrecision] * 0.5), $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(EAccept + \left(Ev + Vef\right)\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^{-274}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-242}:\\
    \;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(\frac{\frac{NdChar \cdot NdChar}{NaChar} - NdChar}{NaChar}, -1, -1\right)}{-NaChar}} \cdot 0.5\\
    
    \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.99999999999999993e-274 or 4.9999999999999998e-242 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT)))))

      1. Initial program 99.9%

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

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

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

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

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

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

      if -1.99999999999999993e-274 < (+.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.9999999999999998e-242

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

        Alternative 6: 35.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(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\ \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-292}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-184}:\\ \;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(\frac{\frac{NaChar \cdot NaChar}{NdChar} - NaChar}{NdChar}, -1, -1\right)}{-NdChar}} \cdot 0.5\\ \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 (/ (- (+ EAccept (+ Ev Vef)) mu) KbT))))
                  (/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))))))
           (if (<= t_1 -5e-292)
             t_0
             (if (<= t_1 4e-184)
               (*
                (/
                 1.0
                 (/
                  (fma (/ (- (/ (* NaChar NaChar) NdChar) NaChar) NdChar) -1.0 -1.0)
                  (- NdChar)))
                0.5)
               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((((EAccept + (Ev + Vef)) - mu) / KbT)))) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
        	double tmp;
        	if (t_1 <= -5e-292) {
        		tmp = t_0;
        	} else if (t_1 <= 4e-184) {
        		tmp = (1.0 / (fma(((((NaChar * NaChar) / NdChar) - NaChar) / NdChar), -1.0, -1.0) / -NdChar)) * 0.5;
        	} 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(EAccept + Float64(Ev + Vef)) - mu) / KbT)))) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))))
        	tmp = 0.0
        	if (t_1 <= -5e-292)
        		tmp = t_0;
        	elseif (t_1 <= 4e-184)
        		tmp = Float64(Float64(1.0 / Float64(fma(Float64(Float64(Float64(Float64(NaChar * NaChar) / NdChar) - NaChar) / NdChar), -1.0, -1.0) / Float64(-NdChar))) * 0.5);
        	else
        		tmp = t_0;
        	end
        	return tmp
        end
        
        code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $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, -5e-292], t$95$0, If[LessEqual[t$95$1, 4e-184], N[(N[(1.0 / N[(N[(N[(N[(N[(N[(NaChar * NaChar), $MachinePrecision] / NdChar), $MachinePrecision] - NaChar), $MachinePrecision] / NdChar), $MachinePrecision] * -1.0 + -1.0), $MachinePrecision] / (-NdChar)), $MachinePrecision]), $MachinePrecision] * 0.5), $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(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\
        \mathbf{if}\;t\_1 \leq -5 \cdot 10^{-292}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;t\_1 \leq 4 \cdot 10^{-184}:\\
        \;\;\;\;\frac{1}{\frac{\mathsf{fma}\left(\frac{\frac{NaChar \cdot NaChar}{NdChar} - NaChar}{NdChar}, -1, -1\right)}{-NdChar}} \cdot 0.5\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_0\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -4.99999999999999981e-292 or 4.0000000000000002e-184 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT)))))

          1. Initial program 100.0%

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

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

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

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

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

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

          if -4.99999999999999981e-292 < (+.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.0000000000000002e-184

          1. Initial program 99.8%

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

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

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

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

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

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

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

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

                \[\leadsto 0.5 \cdot \frac{1}{\frac{\mathsf{fma}\left(\frac{\frac{NaChar \cdot NaChar}{NdChar} - NaChar}{NdChar}, -1, -1\right)}{\color{blue}{-NdChar}}} \]
            4. Recombined 2 regimes into one program.
            5. Final simplification33.0%

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

            Alternative 7: 33.0% accurate, 0.5× speedup?

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

              1. Initial program 99.9%

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

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

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

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

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

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

              if -1.0000000000000001e-292 < (+.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.9999999999999998e-242

              1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

                  Alternative 8: 55.5% accurate, 0.7× speedup?

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

                    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      1. Initial program 99.9%

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

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

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

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

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

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

                        \[\leadsto \color{blue}{0.5 \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} \]
                    8. Recombined 2 regimes into one program.
                    9. Final simplification61.5%

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

                    Alternative 9: 65.4% accurate, 1.8× speedup?

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

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

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

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

                      if -2.04999999999999989e272 < NaChar < 1.34999999999999998e-92

                      1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

                      if 1.34999999999999998e-92 < NaChar

                      1. Initial program 99.9%

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

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

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

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

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

                        \[\leadsto \frac{1}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} \cdot NaChar \]
                      7. Step-by-step derivation
                        1. Applied rewrites72.4%

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

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

                      Alternative 10: 65.4% accurate, 1.9× speedup?

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

                        1. Initial program 99.9%

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

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

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

                        if -2.04999999999999989e272 < NaChar < 1.34999999999999998e-92

                        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 11: 64.1% accurate, 1.9× speedup?

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

                        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

                        if -1.18000000000000005e163 < NaChar < 1.34999999999999998e-92

                        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

                            \[\leadsto \frac{NdChar}{e^{\frac{\left(\color{blue}{\left(mu + Vef\right)} + EDonor\right) - Ec}{KbT}} + 1} \]
                          10. lower-+.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 mu around 0

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

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

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

                        Alternative 12: 57.8% accurate, 1.9× speedup?

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

                          1. Initial program 100.0%

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

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

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

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

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

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

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

                          if -9.49999999999999986e122 < KbT < 3.89999999999999972e207

                          1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                            if 3.89999999999999972e207 < 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 Vef around inf

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

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

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

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

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

                              \[\leadsto \color{blue}{0.5 \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} \]
                          8. Recombined 3 regimes into one program.
                          9. Final simplification63.4%

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

                          Alternative 13: 43.1% accurate, 2.0× speedup?

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

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

                              \[\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^{\frac{-1 \cdot Ec}{KbT}} + 1} \]
                            7. Step-by-step derivation
                              1. Applied rewrites56.6%

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

                              if -1.7e60 < Ec < 6.5e-65

                              1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                \[\leadsto \begin{array}{l} \mathbf{if}\;Ec \leq -1.7 \cdot 10^{+60}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{-Ec}{KbT}} - -1}\\ \mathbf{elif}\;Ec \leq 6.5 \cdot 10^{-65}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} - -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{-Ec}{KbT}} - -1}\\ \end{array} \]
                              10. Add Preprocessing

                              Alternative 14: 40.7% accurate, 2.0× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(-0.25, \frac{-NdChar}{KbT} \cdot Ec, \left(NaChar + NdChar\right) \cdot 0.5\right)\\ \mathbf{if}\;KbT \leq -9 \cdot 10^{+122}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 7.3 \cdot 10^{+171}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                              (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                               :precision binary64
                               (let* ((t_0 (fma -0.25 (* (/ (- NdChar) KbT) Ec) (* (+ NaChar NdChar) 0.5))))
                                 (if (<= KbT -9e+122)
                                   t_0
                                   (if (<= KbT 7.3e+171) (/ NdChar (- (exp (/ EDonor KbT)) -1.0)) t_0))))
                              double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                              	double t_0 = fma(-0.25, ((-NdChar / KbT) * Ec), ((NaChar + NdChar) * 0.5));
                              	double tmp;
                              	if (KbT <= -9e+122) {
                              		tmp = t_0;
                              	} else if (KbT <= 7.3e+171) {
                              		tmp = NdChar / (exp((EDonor / KbT)) - -1.0);
                              	} else {
                              		tmp = t_0;
                              	}
                              	return tmp;
                              }
                              
                              function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                              	t_0 = fma(-0.25, Float64(Float64(Float64(-NdChar) / KbT) * Ec), Float64(Float64(NaChar + NdChar) * 0.5))
                              	tmp = 0.0
                              	if (KbT <= -9e+122)
                              		tmp = t_0;
                              	elseif (KbT <= 7.3e+171)
                              		tmp = Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) - -1.0));
                              	else
                              		tmp = t_0;
                              	end
                              	return tmp
                              end
                              
                              code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(-0.25 * N[(N[((-NdChar) / KbT), $MachinePrecision] * Ec), $MachinePrecision] + N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -9e+122], t$95$0, If[LessEqual[KbT, 7.3e+171], N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_0 := \mathsf{fma}\left(-0.25, \frac{-NdChar}{KbT} \cdot Ec, \left(NaChar + NdChar\right) \cdot 0.5\right)\\
                              \mathbf{if}\;KbT \leq -9 \cdot 10^{+122}:\\
                              \;\;\;\;t\_0\\
                              
                              \mathbf{elif}\;KbT \leq 7.3 \cdot 10^{+171}:\\
                              \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;t\_0\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 2 regimes
                              2. if KbT < -8.99999999999999995e122 or 7.3000000000000002e171 < 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}{4} \cdot \frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \left(\frac{-1}{4} \cdot \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT} + \left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right)\right)} \]
                                4. Step-by-step derivation
                                  1. associate-+r+N/A

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

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

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

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

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

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

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

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

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

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

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

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

                                  if -8.99999999999999995e122 < KbT < 7.3000000000000002e171

                                  1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

                                      \[\leadsto \frac{NdChar}{e^{\frac{\left(\color{blue}{\left(mu + Vef\right)} + EDonor\right) - Ec}{KbT}} + 1} \]
                                  5. Applied rewrites66.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 rewrites33.1%

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

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

                                  Alternative 15: 55.5% accurate, 2.0× speedup?

                                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;mu \leq 7.2 \cdot 10^{+229}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{\left(EDonor + Vef\right) - Ec}{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
                                   (if (<= mu 7.2e+229)
                                     (/ NdChar (- (exp (/ (- (+ EDonor Vef) Ec) 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 tmp;
                                  	if (mu <= 7.2e+229) {
                                  		tmp = NdChar / (exp((((EDonor + Vef) - Ec) / 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) :: tmp
                                      if (mu <= 7.2d+229) then
                                          tmp = ndchar / (exp((((edonor + vef) - ec) / 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 tmp;
                                  	if (mu <= 7.2e+229) {
                                  		tmp = NdChar / (Math.exp((((EDonor + Vef) - Ec) / 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):
                                  	tmp = 0
                                  	if mu <= 7.2e+229:
                                  		tmp = NdChar / (math.exp((((EDonor + Vef) - Ec) / 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)
                                  	tmp = 0.0
                                  	if (mu <= 7.2e+229)
                                  		tmp = Float64(NdChar / Float64(exp(Float64(Float64(Float64(EDonor + Vef) - Ec) / 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)
                                  	tmp = 0.0;
                                  	if (mu <= 7.2e+229)
                                  		tmp = NdChar / (exp((((EDonor + Vef) - Ec) / 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_] := If[LessEqual[mu, 7.2e+229], N[(NdChar / N[(N[Exp[N[(N[(N[(EDonor + Vef), $MachinePrecision] - Ec), $MachinePrecision] / 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}
                                  \mathbf{if}\;mu \leq 7.2 \cdot 10^{+229}:\\
                                  \;\;\;\;\frac{NdChar}{e^{\frac{\left(EDonor + Vef\right) - Ec}{KbT}} - -1}\\
                                  
                                  \mathbf{else}:\\
                                  \;\;\;\;\frac{NdChar}{e^{\frac{mu}{KbT}} - -1}\\
                                  
                                  
                                  \end{array}
                                  \end{array}
                                  
                                  Derivation
                                  1. Split input into 2 regimes
                                  2. if mu < 7.19999999999999973e229

                                    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                      if 7.19999999999999973e229 < mu

                                      1. Initial program 100.0%

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

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

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

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

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

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

                                      Alternative 16: 41.2% accurate, 2.1× speedup?

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

                                        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                          if 7.6000000000000001e71 < EDonor

                                          1. Initial program 100.0%

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

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

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

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

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

                                            \[\leadsto \begin{array}{l} \mathbf{if}\;EDonor \leq 7.6 \cdot 10^{+71}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} - -1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\ \end{array} \]
                                          10. Add Preprocessing

                                          Alternative 17: 20.5% accurate, 23.0× speedup?

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

                                            1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                              if 8.39999999999999945e89 < NaChar

                                              1. Initial program 99.9%

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

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

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

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

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

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

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

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

                                              Alternative 18: 27.6% accurate, 30.7× speedup?

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

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

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

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

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

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

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

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

                                              Alternative 19: 18.0% accurate, 46.0× speedup?

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

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

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

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

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

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

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

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

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

                                                Reproduce

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