Bulmash initializePoisson

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 20 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{NdChar}{e^{\frac{mu + \left(EDonor + \left(Vef - Ec\right)\right)}{KbT}} + 1} + \frac{NaChar}{{e}^{\left(\frac{EAccept + \left(\left(Vef + Ev\right) - mu\right)}{KbT}\right)} + 1} \end{array} \]
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
 :precision binary64
 (+
  (/ NdChar (+ (exp (/ (+ mu (+ EDonor (- Vef Ec))) KbT)) 1.0))
  (/ NaChar (+ (pow E (/ (+ EAccept (- (+ Vef Ev) mu)) KbT)) 1.0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
	return (NdChar / (exp(((mu + (EDonor + (Vef - Ec))) / KbT)) + 1.0)) + (NaChar / (pow(((double) M_E), ((EAccept + ((Vef + Ev) - mu)) / KbT)) + 1.0));
}
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
	return (NdChar / (Math.exp(((mu + (EDonor + (Vef - Ec))) / KbT)) + 1.0)) + (NaChar / (Math.pow(Math.E, ((EAccept + ((Vef + Ev) - mu)) / KbT)) + 1.0));
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
	return (NdChar / (math.exp(((mu + (EDonor + (Vef - Ec))) / KbT)) + 1.0)) + (NaChar / (math.pow(math.e, ((EAccept + ((Vef + Ev) - mu)) / KbT)) + 1.0))
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	return Float64(Float64(NdChar / Float64(exp(Float64(Float64(mu + Float64(EDonor + Float64(Vef - Ec))) / KbT)) + 1.0)) + Float64(NaChar / Float64((exp(1) ^ Float64(Float64(EAccept + Float64(Float64(Vef + Ev) - mu)) / KbT)) + 1.0)))
end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	tmp = (NdChar / (exp(((mu + (EDonor + (Vef - Ec))) / KbT)) + 1.0)) + (NaChar / ((2.71828182845904523536 ^ ((EAccept + ((Vef + Ev) - mu)) / KbT)) + 1.0));
end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(N[(NdChar / N[(N[Exp[N[(N[(mu + N[(EDonor + N[(Vef - Ec), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(N[Power[E, N[(N[(EAccept + N[(N[(Vef + Ev), $MachinePrecision] - mu), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 48.3% accurate, 0.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ t_1 := \left(mu - Ec\right) + \left(Vef + EDonor\right)\\ t_2 := \frac{NdChar}{e^{\frac{mu + \left(EDonor + \left(Vef - Ec\right)\right)}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(EAccept + \left(Vef + Ev\right)\right) - mu}{KbT}} + 1}\\ t_3 := \frac{NdChar}{e^{\frac{mu}{KbT}} + 1}\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{-49}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-302}:\\ \;\;\;\;t\_3\\ \mathbf{elif}\;t\_2 \leq 0:\\ \;\;\;\;\frac{NdChar}{2 - \frac{\mathsf{fma}\left(-0.5, \frac{t\_1 \cdot t\_1}{KbT}, \left(Ec - mu\right) - \left(Vef + EDonor\right)\right)}{KbT}}\\ \mathbf{elif}\;t\_2 \leq 10^{+24}:\\ \;\;\;\;t\_3\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
 :precision binary64
 (let* ((t_0 (* 0.5 (+ NdChar NaChar)))
        (t_1 (+ (- mu Ec) (+ Vef EDonor)))
        (t_2
         (+
          (/ NdChar (+ (exp (/ (+ mu (+ EDonor (- Vef Ec))) KbT)) 1.0))
          (/ NaChar (+ (exp (/ (- (+ EAccept (+ Vef Ev)) mu) KbT)) 1.0))))
        (t_3 (/ NdChar (+ (exp (/ mu KbT)) 1.0))))
   (if (<= t_2 -1e-49)
     t_0
     (if (<= t_2 -5e-302)
       t_3
       (if (<= t_2 0.0)
         (/
          NdChar
          (-
           2.0
           (/
            (fma -0.5 (/ (* t_1 t_1) KbT) (- (- Ec mu) (+ Vef EDonor)))
            KbT)))
         (if (<= t_2 1e+24) t_3 t_0))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
	double t_0 = 0.5 * (NdChar + NaChar);
	double t_1 = (mu - Ec) + (Vef + EDonor);
	double t_2 = (NdChar / (exp(((mu + (EDonor + (Vef - Ec))) / KbT)) + 1.0)) + (NaChar / (exp((((EAccept + (Vef + Ev)) - mu) / KbT)) + 1.0));
	double t_3 = NdChar / (exp((mu / KbT)) + 1.0);
	double tmp;
	if (t_2 <= -1e-49) {
		tmp = t_0;
	} else if (t_2 <= -5e-302) {
		tmp = t_3;
	} else if (t_2 <= 0.0) {
		tmp = NdChar / (2.0 - (fma(-0.5, ((t_1 * t_1) / KbT), ((Ec - mu) - (Vef + EDonor))) / KbT));
	} else if (t_2 <= 1e+24) {
		tmp = t_3;
	} else {
		tmp = t_0;
	}
	return tmp;
}
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	t_0 = Float64(0.5 * Float64(NdChar + NaChar))
	t_1 = Float64(Float64(mu - Ec) + Float64(Vef + EDonor))
	t_2 = Float64(Float64(NdChar / Float64(exp(Float64(Float64(mu + Float64(EDonor + Float64(Vef - Ec))) / KbT)) + 1.0)) + Float64(NaChar / Float64(exp(Float64(Float64(Float64(EAccept + Float64(Vef + Ev)) - mu) / KbT)) + 1.0)))
	t_3 = Float64(NdChar / Float64(exp(Float64(mu / KbT)) + 1.0))
	tmp = 0.0
	if (t_2 <= -1e-49)
		tmp = t_0;
	elseif (t_2 <= -5e-302)
		tmp = t_3;
	elseif (t_2 <= 0.0)
		tmp = Float64(NdChar / Float64(2.0 - Float64(fma(-0.5, Float64(Float64(t_1 * t_1) / KbT), Float64(Float64(Ec - mu) - Float64(Vef + EDonor))) / KbT)));
	elseif (t_2 <= 1e+24)
		tmp = t_3;
	else
		tmp = t_0;
	end
	return tmp
end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(mu - Ec), $MachinePrecision] + N[(Vef + EDonor), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(NdChar / N[(N[Exp[N[(N[(mu + N[(EDonor + N[(Vef - Ec), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(N[Exp[N[(N[(N[(EAccept + N[(Vef + Ev), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(NdChar / N[(N[Exp[N[(mu / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-49], t$95$0, If[LessEqual[t$95$2, -5e-302], t$95$3, If[LessEqual[t$95$2, 0.0], N[(NdChar / N[(2.0 - N[(N[(-0.5 * N[(N[(t$95$1 * t$95$1), $MachinePrecision] / KbT), $MachinePrecision] + N[(N[(Ec - mu), $MachinePrecision] - N[(Vef + EDonor), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 1e+24], t$95$3, t$95$0]]]]]]]]
\begin{array}{l}

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

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

\mathbf{elif}\;t\_2 \leq 0:\\
\;\;\;\;\frac{NdChar}{2 - \frac{\mathsf{fma}\left(-0.5, \frac{t\_1 \cdot t\_1}{KbT}, \left(Ec - mu\right) - \left(Vef + EDonor\right)\right)}{KbT}}\\

\mathbf{elif}\;t\_2 \leq 10^{+24}:\\
\;\;\;\;t\_3\\

\mathbf{else}:\\
\;\;\;\;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))))) < -9.99999999999999936e-50 or 9.9999999999999998e23 < (+.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-+.f6444.2

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

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

    if -9.99999999999999936e-50 < (+.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.00000000000000033e-302 or 0.0 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 9.9999999999999998e23

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

      \[\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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

      1. Initial program 98.1%

        \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(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 NdChar around inf

        \[\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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{NdChar}{2 - \color{blue}{\frac{\mathsf{fma}\left(-0.5, \frac{\left(\left(EDonor + Vef\right) + \left(mu - Ec\right)\right) \cdot \left(\left(EDonor + Vef\right) + \left(mu - Ec\right)\right)}{KbT}, -\left(\left(EDonor + Vef\right) + \left(mu - Ec\right)\right)\right)}{KbT}}} \]
      8. Recombined 3 regimes into one program.
      9. Final simplification51.0%

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

      Alternative 3: 77.0% accurate, 0.3× speedup?

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

        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{\mathsf{neg}\left(\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
        4. Step-by-step derivation
          1. lower-/.f6495.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 rewrites95.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 -2.0000000000000001e241 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -5.0000000000000004e-131 or 9.9999999999999992e-72 < (+.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 EDonor around inf

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

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

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

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

        1. Initial program 99.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 NdChar around inf

          \[\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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

      Alternative 4: 46.1% accurate, 0.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ t_1 := \left(mu - Ec\right) + \left(Vef + EDonor\right)\\ t_2 := \frac{NdChar}{e^{\frac{mu + \left(EDonor + \left(Vef - Ec\right)\right)}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(EAccept + \left(Vef + Ev\right)\right) - mu}{KbT}} + 1}\\ \mathbf{if}\;t\_2 \leq -5 \cdot 10^{-44}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-304}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-268}:\\ \;\;\;\;\frac{NdChar}{2 - \frac{\mathsf{fma}\left(-0.5, \frac{t\_1 \cdot t\_1}{KbT}, \left(Ec - mu\right) - \left(Vef + EDonor\right)\right)}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
      (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
       :precision binary64
       (let* ((t_0 (* 0.5 (+ NdChar NaChar)))
              (t_1 (+ (- mu Ec) (+ Vef EDonor)))
              (t_2
               (+
                (/ NdChar (+ (exp (/ (+ mu (+ EDonor (- Vef Ec))) KbT)) 1.0))
                (/ NaChar (+ (exp (/ (- (+ EAccept (+ Vef Ev)) mu) KbT)) 1.0)))))
         (if (<= t_2 -5e-44)
           t_0
           (if (<= t_2 -5e-304)
             (/ NdChar (+ (exp (/ EDonor KbT)) 1.0))
             (if (<= t_2 5e-268)
               (/
                NdChar
                (-
                 2.0
                 (/
                  (fma -0.5 (/ (* t_1 t_1) KbT) (- (- Ec mu) (+ Vef EDonor)))
                  KbT)))
               t_0)))))
      double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
      	double t_0 = 0.5 * (NdChar + NaChar);
      	double t_1 = (mu - Ec) + (Vef + EDonor);
      	double t_2 = (NdChar / (exp(((mu + (EDonor + (Vef - Ec))) / KbT)) + 1.0)) + (NaChar / (exp((((EAccept + (Vef + Ev)) - mu) / KbT)) + 1.0));
      	double tmp;
      	if (t_2 <= -5e-44) {
      		tmp = t_0;
      	} else if (t_2 <= -5e-304) {
      		tmp = NdChar / (exp((EDonor / KbT)) + 1.0);
      	} else if (t_2 <= 5e-268) {
      		tmp = NdChar / (2.0 - (fma(-0.5, ((t_1 * t_1) / KbT), ((Ec - mu) - (Vef + EDonor))) / KbT));
      	} else {
      		tmp = t_0;
      	}
      	return tmp;
      }
      
      function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
      	t_0 = Float64(0.5 * Float64(NdChar + NaChar))
      	t_1 = Float64(Float64(mu - Ec) + Float64(Vef + EDonor))
      	t_2 = Float64(Float64(NdChar / Float64(exp(Float64(Float64(mu + Float64(EDonor + Float64(Vef - Ec))) / KbT)) + 1.0)) + Float64(NaChar / Float64(exp(Float64(Float64(Float64(EAccept + Float64(Vef + Ev)) - mu) / KbT)) + 1.0)))
      	tmp = 0.0
      	if (t_2 <= -5e-44)
      		tmp = t_0;
      	elseif (t_2 <= -5e-304)
      		tmp = Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) + 1.0));
      	elseif (t_2 <= 5e-268)
      		tmp = Float64(NdChar / Float64(2.0 - Float64(fma(-0.5, Float64(Float64(t_1 * t_1) / KbT), Float64(Float64(Ec - mu) - Float64(Vef + EDonor))) / KbT)));
      	else
      		tmp = t_0;
      	end
      	return tmp
      end
      
      code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(mu - Ec), $MachinePrecision] + N[(Vef + EDonor), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(NdChar / N[(N[Exp[N[(N[(mu + N[(EDonor + N[(Vef - Ec), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(N[Exp[N[(N[(N[(EAccept + N[(Vef + Ev), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-44], t$95$0, If[LessEqual[t$95$2, -5e-304], N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e-268], N[(NdChar / N[(2.0 - N[(N[(-0.5 * N[(N[(t$95$1 * t$95$1), $MachinePrecision] / KbT), $MachinePrecision] + N[(N[(Ec - mu), $MachinePrecision] - N[(Vef + EDonor), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
      t_1 := \left(mu - Ec\right) + \left(Vef + EDonor\right)\\
      t_2 := \frac{NdChar}{e^{\frac{mu + \left(EDonor + \left(Vef - Ec\right)\right)}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(EAccept + \left(Vef + Ev\right)\right) - mu}{KbT}} + 1}\\
      \mathbf{if}\;t\_2 \leq -5 \cdot 10^{-44}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;t\_2 \leq -5 \cdot 10^{-304}:\\
      \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\
      
      \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-268}:\\
      \;\;\;\;\frac{NdChar}{2 - \frac{\mathsf{fma}\left(-0.5, \frac{t\_1 \cdot t\_1}{KbT}, \left(Ec - mu\right) - \left(Vef + EDonor\right)\right)}{KbT}}\\
      
      \mathbf{else}:\\
      \;\;\;\;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.00000000000000039e-44 or 4.9999999999999999e-268 < (+.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-+.f6440.3

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

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

        if -5.00000000000000039e-44 < (+.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.99999999999999965e-304

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

          \[\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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

          1. Initial program 98.2%

            \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(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 NdChar around inf

            \[\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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

              \[\leadsto \frac{NdChar}{2 - \color{blue}{\frac{\mathsf{fma}\left(-0.5, \frac{\left(\left(EDonor + Vef\right) + \left(mu - Ec\right)\right) \cdot \left(\left(EDonor + Vef\right) + \left(mu - Ec\right)\right)}{KbT}, -\left(\left(EDonor + Vef\right) + \left(mu - Ec\right)\right)\right)}{KbT}}} \]
          8. Recombined 3 regimes into one program.
          9. Final simplification46.3%

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

          Alternative 5: 44.6% accurate, 0.3× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ t_1 := \left(mu - Ec\right) + \left(Vef + EDonor\right)\\ t_2 := \frac{NdChar}{e^{\frac{mu + \left(EDonor + \left(Vef - Ec\right)\right)}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(EAccept + \left(Vef + Ev\right)\right) - mu}{KbT}} + 1}\\ \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-96}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-277}:\\ \;\;\;\;NaChar \cdot 0.5\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-268}:\\ \;\;\;\;\frac{NdChar}{2 - \frac{\mathsf{fma}\left(-0.5, \frac{t\_1 \cdot t\_1}{KbT}, \left(Ec - mu\right) - \left(Vef + EDonor\right)\right)}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
          (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
           :precision binary64
           (let* ((t_0 (* 0.5 (+ NdChar NaChar)))
                  (t_1 (+ (- mu Ec) (+ Vef EDonor)))
                  (t_2
                   (+
                    (/ NdChar (+ (exp (/ (+ mu (+ EDonor (- Vef Ec))) KbT)) 1.0))
                    (/ NaChar (+ (exp (/ (- (+ EAccept (+ Vef Ev)) mu) KbT)) 1.0)))))
             (if (<= t_2 -2e-96)
               t_0
               (if (<= t_2 -1e-277)
                 (* NaChar 0.5)
                 (if (<= t_2 5e-268)
                   (/
                    NdChar
                    (-
                     2.0
                     (/
                      (fma -0.5 (/ (* t_1 t_1) KbT) (- (- Ec mu) (+ Vef EDonor)))
                      KbT)))
                   t_0)))))
          double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
          	double t_0 = 0.5 * (NdChar + NaChar);
          	double t_1 = (mu - Ec) + (Vef + EDonor);
          	double t_2 = (NdChar / (exp(((mu + (EDonor + (Vef - Ec))) / KbT)) + 1.0)) + (NaChar / (exp((((EAccept + (Vef + Ev)) - mu) / KbT)) + 1.0));
          	double tmp;
          	if (t_2 <= -2e-96) {
          		tmp = t_0;
          	} else if (t_2 <= -1e-277) {
          		tmp = NaChar * 0.5;
          	} else if (t_2 <= 5e-268) {
          		tmp = NdChar / (2.0 - (fma(-0.5, ((t_1 * t_1) / KbT), ((Ec - mu) - (Vef + EDonor))) / KbT));
          	} else {
          		tmp = t_0;
          	}
          	return tmp;
          }
          
          function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
          	t_0 = Float64(0.5 * Float64(NdChar + NaChar))
          	t_1 = Float64(Float64(mu - Ec) + Float64(Vef + EDonor))
          	t_2 = Float64(Float64(NdChar / Float64(exp(Float64(Float64(mu + Float64(EDonor + Float64(Vef - Ec))) / KbT)) + 1.0)) + Float64(NaChar / Float64(exp(Float64(Float64(Float64(EAccept + Float64(Vef + Ev)) - mu) / KbT)) + 1.0)))
          	tmp = 0.0
          	if (t_2 <= -2e-96)
          		tmp = t_0;
          	elseif (t_2 <= -1e-277)
          		tmp = Float64(NaChar * 0.5);
          	elseif (t_2 <= 5e-268)
          		tmp = Float64(NdChar / Float64(2.0 - Float64(fma(-0.5, Float64(Float64(t_1 * t_1) / KbT), Float64(Float64(Ec - mu) - Float64(Vef + EDonor))) / KbT)));
          	else
          		tmp = t_0;
          	end
          	return tmp
          end
          
          code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(mu - Ec), $MachinePrecision] + N[(Vef + EDonor), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(NdChar / N[(N[Exp[N[(N[(mu + N[(EDonor + N[(Vef - Ec), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(N[Exp[N[(N[(N[(EAccept + N[(Vef + Ev), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-96], t$95$0, If[LessEqual[t$95$2, -1e-277], N[(NaChar * 0.5), $MachinePrecision], If[LessEqual[t$95$2, 5e-268], N[(NdChar / N[(2.0 - N[(N[(-0.5 * N[(N[(t$95$1 * t$95$1), $MachinePrecision] / KbT), $MachinePrecision] + N[(N[(Ec - mu), $MachinePrecision] - N[(Vef + EDonor), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
          t_1 := \left(mu - Ec\right) + \left(Vef + EDonor\right)\\
          t_2 := \frac{NdChar}{e^{\frac{mu + \left(EDonor + \left(Vef - Ec\right)\right)}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(EAccept + \left(Vef + Ev\right)\right) - mu}{KbT}} + 1}\\
          \mathbf{if}\;t\_2 \leq -2 \cdot 10^{-96}:\\
          \;\;\;\;t\_0\\
          
          \mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-277}:\\
          \;\;\;\;NaChar \cdot 0.5\\
          
          \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-268}:\\
          \;\;\;\;\frac{NdChar}{2 - \frac{\mathsf{fma}\left(-0.5, \frac{t\_1 \cdot t\_1}{KbT}, \left(Ec - mu\right) - \left(Vef + EDonor\right)\right)}{KbT}}\\
          
          \mathbf{else}:\\
          \;\;\;\;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.9999999999999998e-96 or 4.9999999999999999e-268 < (+.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-+.f6439.1

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

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

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

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

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

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

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

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

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

              1. Initial program 98.3%

                \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(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 NdChar around inf

                \[\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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

              Alternative 6: 36.7% accurate, 0.3× speedup?

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

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

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

                if -1.9999999999999998e-96 < (+.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.00000000000000014e-307

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

                    \[\leadsto 0.5 \cdot \color{blue}{\left(NaChar + NdChar\right)} \]
                5. Applied rewrites7.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 rewrites23.8%

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

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

                  1. Initial program 98.2%

                    \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(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 NdChar around inf

                    \[\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. lower-+.f64N/A

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

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

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

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

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

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

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

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

                      \[\leadsto \frac{NdChar}{\left(\left(2 + \frac{EDonor}{KbT}\right) + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right) - \color{blue}{\frac{Ec}{KbT}}} \]
                  8. Recombined 3 regimes into one program.
                  9. Final simplification38.9%

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

                  Alternative 7: 36.1% accurate, 0.3× speedup?

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

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

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

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

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

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

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

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

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

                      if -9.99999999999999969e-278 < (+.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.0000000000000002e-208

                      1. Initial program 98.4%

                        \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(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.0

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

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

                          \[\leadsto 0.5 \cdot \frac{1}{\color{blue}{\frac{NaChar - NdChar}{\left(NdChar + NaChar\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 rewrites39.5%

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

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

                        Alternative 8: 35.6% accurate, 0.3× speedup?

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

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

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

                          if -1.9999999999999998e-96 < (+.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.00000000000000014e-307

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

                              \[\leadsto 0.5 \cdot \color{blue}{\left(NaChar + NdChar\right)} \]
                          5. Applied rewrites7.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 rewrites23.8%

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

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

                            1. Initial program 98.2%

                              \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(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.7

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

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

                                \[\leadsto 0.5 \cdot \frac{1}{\color{blue}{\frac{NaChar - NdChar}{\left(NdChar + NaChar\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 rewrites41.1%

                                  \[\leadsto 0.5 \cdot \frac{1}{-\frac{\left(-\frac{\frac{NdChar \cdot NdChar}{NaChar} - NdChar}{NaChar}\right) + -1}{NaChar}} \]
                              4. Recombined 3 regimes into one program.
                              5. Final simplification38.0%

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

                              Alternative 9: 34.9% accurate, 0.3× speedup?

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

                                1. Initial program 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-+.f6439.0

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

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

                                if -1.9999999999999998e-96 < (+.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.00000000000000014e-307

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

                                    \[\leadsto 0.5 \cdot \color{blue}{\left(NaChar + NdChar\right)} \]
                                5. Applied rewrites7.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 rewrites23.8%

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

                                  if -5.00000000000000014e-307 < (+.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))))) < 3.9999999999999998e-269

                                  1. Initial program 98.2%

                                    \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(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.6

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

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

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

                                      \[\leadsto \frac{{NdChar}^{3} \cdot \frac{1}{2}}{\mathsf{fma}\left(NdChar, NdChar - NaChar, NaChar \cdot NaChar\right)} \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites28.6%

                                        \[\leadsto \frac{\left(NdChar \cdot \left(NdChar \cdot NdChar\right)\right) \cdot 0.5}{\mathsf{fma}\left(NdChar, NdChar - NaChar, NaChar \cdot NaChar\right)} \]
                                    4. Recombined 3 regimes into one program.
                                    5. Final simplification35.5%

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

                                    Alternative 10: 33.8% accurate, 0.3× speedup?

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

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

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

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

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

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

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

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

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

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

                                        1. Initial program 98.3%

                                          \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(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.7

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

                                          \[\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(NdChar + NaChar\right) \cdot \left(NaChar - NdChar\right)}}} \]
                                          2. Taylor expanded in NdChar around inf

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

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

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

                                          Alternative 11: 77.3% accurate, 0.3× speedup?

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

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

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

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

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

                                            1. Initial program 99.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 NdChar around inf

                                              \[\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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

                                          Alternative 12: 100.0% accurate, 1.0× speedup?

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

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

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

                                          Alternative 13: 68.2% accurate, 1.9× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NaChar}{e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\right)}{KbT}} + 1}\\ \mathbf{if}\;NaChar \leq -2.2 \cdot 10^{-150}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;NaChar \leq 1.8 \cdot 10^{-85}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor + \left(\left(Vef + mu\right) - Ec\right)}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                          (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                           :precision binary64
                                           (let* ((t_0 (/ NaChar (+ (exp (/ (+ EAccept (+ Ev (- Vef mu))) KbT)) 1.0))))
                                             (if (<= NaChar -2.2e-150)
                                               t_0
                                               (if (<= NaChar 1.8e-85)
                                                 (/ NdChar (+ (exp (/ (+ EDonor (- (+ Vef mu) 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 / (exp(((EAccept + (Ev + (Vef - mu))) / KbT)) + 1.0);
                                          	double tmp;
                                          	if (NaChar <= -2.2e-150) {
                                          		tmp = t_0;
                                          	} else if (NaChar <= 1.8e-85) {
                                          		tmp = NdChar / (exp(((EDonor + ((Vef + mu) - 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 / (exp(((eaccept + (ev + (vef - mu))) / kbt)) + 1.0d0)
                                              if (nachar <= (-2.2d-150)) then
                                                  tmp = t_0
                                              else if (nachar <= 1.8d-85) then
                                                  tmp = ndchar / (exp(((edonor + ((vef + mu) - 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 / (Math.exp(((EAccept + (Ev + (Vef - mu))) / KbT)) + 1.0);
                                          	double tmp;
                                          	if (NaChar <= -2.2e-150) {
                                          		tmp = t_0;
                                          	} else if (NaChar <= 1.8e-85) {
                                          		tmp = NdChar / (Math.exp(((EDonor + ((Vef + mu) - Ec)) / KbT)) + 1.0);
                                          	} else {
                                          		tmp = t_0;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                          	t_0 = NaChar / (math.exp(((EAccept + (Ev + (Vef - mu))) / KbT)) + 1.0)
                                          	tmp = 0
                                          	if NaChar <= -2.2e-150:
                                          		tmp = t_0
                                          	elif NaChar <= 1.8e-85:
                                          		tmp = NdChar / (math.exp(((EDonor + ((Vef + mu) - 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(exp(Float64(Float64(EAccept + Float64(Ev + Float64(Vef - mu))) / KbT)) + 1.0))
                                          	tmp = 0.0
                                          	if (NaChar <= -2.2e-150)
                                          		tmp = t_0;
                                          	elseif (NaChar <= 1.8e-85)
                                          		tmp = Float64(NdChar / Float64(exp(Float64(Float64(EDonor + Float64(Float64(Vef + mu) - 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 / (exp(((EAccept + (Ev + (Vef - mu))) / KbT)) + 1.0);
                                          	tmp = 0.0;
                                          	if (NaChar <= -2.2e-150)
                                          		tmp = t_0;
                                          	elseif (NaChar <= 1.8e-85)
                                          		tmp = NdChar / (exp(((EDonor + ((Vef + mu) - 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[(N[Exp[N[(N[(EAccept + N[(Ev + N[(Vef - mu), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NaChar, -2.2e-150], t$95$0, If[LessEqual[NaChar, 1.8e-85], N[(NdChar / N[(N[Exp[N[(N[(EDonor + N[(N[(Vef + mu), $MachinePrecision] - Ec), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          t_0 := \frac{NaChar}{e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\right)}{KbT}} + 1}\\
                                          \mathbf{if}\;NaChar \leq -2.2 \cdot 10^{-150}:\\
                                          \;\;\;\;t\_0\\
                                          
                                          \mathbf{elif}\;NaChar \leq 1.8 \cdot 10^{-85}:\\
                                          \;\;\;\;\frac{NdChar}{e^{\frac{EDonor + \left(\left(Vef + mu\right) - Ec\right)}{KbT}} + 1}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;t\_0\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if NaChar < -2.1999999999999999e-150 or 1.7999999999999999e-85 < NaChar

                                            1. Initial program 99.5%

                                              \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(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 NdChar around 0

                                              \[\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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            if -2.1999999999999999e-150 < NaChar < 1.7999999999999999e-85

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

                                              \[\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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

                                          Alternative 14: 65.9% accurate, 1.9× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NaChar}{e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\right)}{KbT}} + 1}\\ \mathbf{if}\;NaChar \leq -2.2 \cdot 10^{-150}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;NaChar \leq 2.8 \cdot 10^{-86}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef + \left(mu - Ec\right)}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                          (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                           :precision binary64
                                           (let* ((t_0 (/ NaChar (+ (exp (/ (+ EAccept (+ Ev (- Vef mu))) KbT)) 1.0))))
                                             (if (<= NaChar -2.2e-150)
                                               t_0
                                               (if (<= NaChar 2.8e-86)
                                                 (/ NdChar (+ (exp (/ (+ Vef (- mu 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 / (exp(((EAccept + (Ev + (Vef - mu))) / KbT)) + 1.0);
                                          	double tmp;
                                          	if (NaChar <= -2.2e-150) {
                                          		tmp = t_0;
                                          	} else if (NaChar <= 2.8e-86) {
                                          		tmp = NdChar / (exp(((Vef + (mu - 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 / (exp(((eaccept + (ev + (vef - mu))) / kbt)) + 1.0d0)
                                              if (nachar <= (-2.2d-150)) then
                                                  tmp = t_0
                                              else if (nachar <= 2.8d-86) then
                                                  tmp = ndchar / (exp(((vef + (mu - 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 / (Math.exp(((EAccept + (Ev + (Vef - mu))) / KbT)) + 1.0);
                                          	double tmp;
                                          	if (NaChar <= -2.2e-150) {
                                          		tmp = t_0;
                                          	} else if (NaChar <= 2.8e-86) {
                                          		tmp = NdChar / (Math.exp(((Vef + (mu - Ec)) / KbT)) + 1.0);
                                          	} else {
                                          		tmp = t_0;
                                          	}
                                          	return tmp;
                                          }
                                          
                                          def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                          	t_0 = NaChar / (math.exp(((EAccept + (Ev + (Vef - mu))) / KbT)) + 1.0)
                                          	tmp = 0
                                          	if NaChar <= -2.2e-150:
                                          		tmp = t_0
                                          	elif NaChar <= 2.8e-86:
                                          		tmp = NdChar / (math.exp(((Vef + (mu - 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(exp(Float64(Float64(EAccept + Float64(Ev + Float64(Vef - mu))) / KbT)) + 1.0))
                                          	tmp = 0.0
                                          	if (NaChar <= -2.2e-150)
                                          		tmp = t_0;
                                          	elseif (NaChar <= 2.8e-86)
                                          		tmp = Float64(NdChar / Float64(exp(Float64(Float64(Vef + Float64(mu - 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 / (exp(((EAccept + (Ev + (Vef - mu))) / KbT)) + 1.0);
                                          	tmp = 0.0;
                                          	if (NaChar <= -2.2e-150)
                                          		tmp = t_0;
                                          	elseif (NaChar <= 2.8e-86)
                                          		tmp = NdChar / (exp(((Vef + (mu - 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[(N[Exp[N[(N[(EAccept + N[(Ev + N[(Vef - mu), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NaChar, -2.2e-150], t$95$0, If[LessEqual[NaChar, 2.8e-86], N[(NdChar / N[(N[Exp[N[(N[(Vef + N[(mu - Ec), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          t_0 := \frac{NaChar}{e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\right)}{KbT}} + 1}\\
                                          \mathbf{if}\;NaChar \leq -2.2 \cdot 10^{-150}:\\
                                          \;\;\;\;t\_0\\
                                          
                                          \mathbf{elif}\;NaChar \leq 2.8 \cdot 10^{-86}:\\
                                          \;\;\;\;\frac{NdChar}{e^{\frac{Vef + \left(mu - Ec\right)}{KbT}} + 1}\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;t\_0\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if NaChar < -2.1999999999999999e-150 or 2.80000000000000009e-86 < NaChar

                                            1. Initial program 99.5%

                                              \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(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 NdChar around 0

                                              \[\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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

                                            if -2.1999999999999999e-150 < NaChar < 2.80000000000000009e-86

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

                                              \[\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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                                            Alternative 15: 57.4% accurate, 1.9× speedup?

                                            \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1} + NaChar \cdot 0.5\\ \mathbf{if}\;KbT \leq -4 \cdot 10^{+90}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 6 \cdot 10^{+148}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef + \left(mu - Ec\right)}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                            (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                             :precision binary64
                                             (let* ((t_0 (+ (/ NdChar (+ (exp (/ EDonor KbT)) 1.0)) (* NaChar 0.5))))
                                               (if (<= KbT -4e+90)
                                                 t_0
                                                 (if (<= KbT 6e+148)
                                                   (/ NdChar (+ (exp (/ (+ Vef (- mu 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 = (NdChar / (exp((EDonor / KbT)) + 1.0)) + (NaChar * 0.5);
                                            	double tmp;
                                            	if (KbT <= -4e+90) {
                                            		tmp = t_0;
                                            	} else if (KbT <= 6e+148) {
                                            		tmp = NdChar / (exp(((Vef + (mu - 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 = (ndchar / (exp((edonor / kbt)) + 1.0d0)) + (nachar * 0.5d0)
                                                if (kbt <= (-4d+90)) then
                                                    tmp = t_0
                                                else if (kbt <= 6d+148) then
                                                    tmp = ndchar / (exp(((vef + (mu - 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 = (NdChar / (Math.exp((EDonor / KbT)) + 1.0)) + (NaChar * 0.5);
                                            	double tmp;
                                            	if (KbT <= -4e+90) {
                                            		tmp = t_0;
                                            	} else if (KbT <= 6e+148) {
                                            		tmp = NdChar / (Math.exp(((Vef + (mu - Ec)) / KbT)) + 1.0);
                                            	} else {
                                            		tmp = t_0;
                                            	}
                                            	return tmp;
                                            }
                                            
                                            def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                            	t_0 = (NdChar / (math.exp((EDonor / KbT)) + 1.0)) + (NaChar * 0.5)
                                            	tmp = 0
                                            	if KbT <= -4e+90:
                                            		tmp = t_0
                                            	elif KbT <= 6e+148:
                                            		tmp = NdChar / (math.exp(((Vef + (mu - Ec)) / KbT)) + 1.0)
                                            	else:
                                            		tmp = t_0
                                            	return tmp
                                            
                                            function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                            	t_0 = Float64(Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) + 1.0)) + Float64(NaChar * 0.5))
                                            	tmp = 0.0
                                            	if (KbT <= -4e+90)
                                            		tmp = t_0;
                                            	elseif (KbT <= 6e+148)
                                            		tmp = Float64(NdChar / Float64(exp(Float64(Float64(Vef + Float64(mu - 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 = (NdChar / (exp((EDonor / KbT)) + 1.0)) + (NaChar * 0.5);
                                            	tmp = 0.0;
                                            	if (KbT <= -4e+90)
                                            		tmp = t_0;
                                            	elseif (KbT <= 6e+148)
                                            		tmp = NdChar / (exp(((Vef + (mu - Ec)) / KbT)) + 1.0);
                                            	else
                                            		tmp = t_0;
                                            	end
                                            	tmp_2 = tmp;
                                            end
                                            
                                            code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar * 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -4e+90], t$95$0, If[LessEqual[KbT, 6e+148], N[(NdChar / N[(N[Exp[N[(N[(Vef + N[(mu - Ec), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                                            
                                            \begin{array}{l}
                                            
                                            \\
                                            \begin{array}{l}
                                            t_0 := \frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1} + NaChar \cdot 0.5\\
                                            \mathbf{if}\;KbT \leq -4 \cdot 10^{+90}:\\
                                            \;\;\;\;t\_0\\
                                            
                                            \mathbf{elif}\;KbT \leq 6 \cdot 10^{+148}:\\
                                            \;\;\;\;\frac{NdChar}{e^{\frac{Vef + \left(mu - Ec\right)}{KbT}} + 1}\\
                                            
                                            \mathbf{else}:\\
                                            \;\;\;\;t\_0\\
                                            
                                            
                                            \end{array}
                                            \end{array}
                                            
                                            Derivation
                                            1. Split input into 2 regimes
                                            2. if KbT < -3.99999999999999987e90 or 6.00000000000000029e148 < 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 \frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)\right)}{KbT}}} + \color{blue}{\frac{1}{2} \cdot NaChar} \]
                                              4. Step-by-step derivation
                                                1. *-commutativeN/A

                                                  \[\leadsto \frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)\right)}{KbT}}} + \color{blue}{NaChar \cdot \frac{1}{2}} \]
                                                2. lower-*.f6471.5

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

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

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

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

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

                                              if -3.99999999999999987e90 < KbT < 6.00000000000000029e148

                                              1. Initial program 99.5%

                                                \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(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 NdChar around inf

                                                \[\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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                                              Alternative 16: 58.0% accurate, 1.9× speedup?

                                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NaChar}{e^{\frac{Vef}{KbT}} + 1} + NdChar \cdot 0.5\\ \mathbf{if}\;KbT \leq -2.1 \cdot 10^{+191}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 5.4 \cdot 10^{+148}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef + \left(mu - Ec\right)}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
                                              (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                               :precision binary64
                                               (let* ((t_0 (+ (/ NaChar (+ (exp (/ Vef KbT)) 1.0)) (* NdChar 0.5))))
                                                 (if (<= KbT -2.1e+191)
                                                   t_0
                                                   (if (<= KbT 5.4e+148)
                                                     (/ NdChar (+ (exp (/ (+ Vef (- mu 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 / (exp((Vef / KbT)) + 1.0)) + (NdChar * 0.5);
                                              	double tmp;
                                              	if (KbT <= -2.1e+191) {
                                              		tmp = t_0;
                                              	} else if (KbT <= 5.4e+148) {
                                              		tmp = NdChar / (exp(((Vef + (mu - 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 / (exp((vef / kbt)) + 1.0d0)) + (ndchar * 0.5d0)
                                                  if (kbt <= (-2.1d+191)) then
                                                      tmp = t_0
                                                  else if (kbt <= 5.4d+148) then
                                                      tmp = ndchar / (exp(((vef + (mu - 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 / (Math.exp((Vef / KbT)) + 1.0)) + (NdChar * 0.5);
                                              	double tmp;
                                              	if (KbT <= -2.1e+191) {
                                              		tmp = t_0;
                                              	} else if (KbT <= 5.4e+148) {
                                              		tmp = NdChar / (Math.exp(((Vef + (mu - Ec)) / KbT)) + 1.0);
                                              	} else {
                                              		tmp = t_0;
                                              	}
                                              	return tmp;
                                              }
                                              
                                              def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                              	t_0 = (NaChar / (math.exp((Vef / KbT)) + 1.0)) + (NdChar * 0.5)
                                              	tmp = 0
                                              	if KbT <= -2.1e+191:
                                              		tmp = t_0
                                              	elif KbT <= 5.4e+148:
                                              		tmp = NdChar / (math.exp(((Vef + (mu - Ec)) / KbT)) + 1.0)
                                              	else:
                                              		tmp = t_0
                                              	return tmp
                                              
                                              function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                              	t_0 = Float64(Float64(NaChar / Float64(exp(Float64(Vef / KbT)) + 1.0)) + Float64(NdChar * 0.5))
                                              	tmp = 0.0
                                              	if (KbT <= -2.1e+191)
                                              		tmp = t_0;
                                              	elseif (KbT <= 5.4e+148)
                                              		tmp = Float64(NdChar / Float64(exp(Float64(Float64(Vef + Float64(mu - 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 / (exp((Vef / KbT)) + 1.0)) + (NdChar * 0.5);
                                              	tmp = 0.0;
                                              	if (KbT <= -2.1e+191)
                                              		tmp = t_0;
                                              	elseif (KbT <= 5.4e+148)
                                              		tmp = NdChar / (exp(((Vef + (mu - Ec)) / KbT)) + 1.0);
                                              	else
                                              		tmp = t_0;
                                              	end
                                              	tmp_2 = tmp;
                                              end
                                              
                                              code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar / N[(N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NdChar * 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -2.1e+191], t$95$0, If[LessEqual[KbT, 5.4e+148], N[(NdChar / N[(N[Exp[N[(N[(Vef + N[(mu - Ec), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
                                              
                                              \begin{array}{l}
                                              
                                              \\
                                              \begin{array}{l}
                                              t_0 := \frac{NaChar}{e^{\frac{Vef}{KbT}} + 1} + NdChar \cdot 0.5\\
                                              \mathbf{if}\;KbT \leq -2.1 \cdot 10^{+191}:\\
                                              \;\;\;\;t\_0\\
                                              
                                              \mathbf{elif}\;KbT \leq 5.4 \cdot 10^{+148}:\\
                                              \;\;\;\;\frac{NdChar}{e^{\frac{Vef + \left(mu - Ec\right)}{KbT}} + 1}\\
                                              
                                              \mathbf{else}:\\
                                              \;\;\;\;t\_0\\
                                              
                                              
                                              \end{array}
                                              \end{array}
                                              
                                              Derivation
                                              1. Split input into 2 regimes
                                              2. if KbT < -2.1000000000000001e191 or 5.40000000000000038e148 < 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{\mathsf{neg}\left(\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
                                                4. Step-by-step derivation
                                                  1. lower-/.f6482.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 rewrites82.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. *-commutativeN/A

                                                    \[\leadsto \color{blue}{NdChar \cdot \frac{1}{2}} + \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} \]
                                                  2. lower-*.f6470.7

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

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

                                                if -2.1000000000000001e191 < KbT < 5.40000000000000038e148

                                                1. Initial program 99.6%

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

                                                  \[\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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

                                                Alternative 17: 57.3% accurate, 1.9× speedup?

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

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

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

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

                                                  if -2.1000000000000001e191 < KbT < 1.97999999999999995e149

                                                  1. Initial program 99.6%

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

                                                    \[\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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

                                                    if 1.97999999999999995e149 < KbT

                                                    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                                                      Alternative 18: 23.3% accurate, 15.3× speedup?

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

                                                        1. Initial program 100.0%

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

                                                          \[\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. lower-+.f64N/A

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

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

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

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

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

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

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

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

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

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

                                                          if -1.1500000000000001e71 < NdChar < 1.45e49

                                                          1. Initial program 99.4%

                                                            \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(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-+.f6429.3

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

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

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

                                                          Alternative 19: 28.1% accurate, 30.7× speedup?

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

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

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

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

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

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

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

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

                                                          Alternative 20: 18.5% accurate, 46.0× speedup?

                                                          \[\begin{array}{l} \\ NaChar \cdot 0.5 \end{array} \]
                                                          (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
                                                           :precision binary64
                                                           (* NaChar 0.5))
                                                          double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
                                                          	return NaChar * 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 * 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 * 0.5;
                                                          }
                                                          
                                                          def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
                                                          	return NaChar * 0.5
                                                          
                                                          function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                          	return Float64(NaChar * 0.5)
                                                          end
                                                          
                                                          function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
                                                          	tmp = NaChar * 0.5;
                                                          end
                                                          
                                                          code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(NaChar * 0.5), $MachinePrecision]
                                                          
                                                          \begin{array}{l}
                                                          
                                                          \\
                                                          NaChar \cdot 0.5
                                                          \end{array}
                                                          
                                                          Derivation
                                                          1. Initial program 99.6%

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

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

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

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

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

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

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

                                                            Reproduce

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