Bulmash initializePoisson

Percentage Accurate: 100.0% → 100.0%
Time: 19.9s
Alternatives: 28
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 28 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, 0.7× speedup?

\[\begin{array}{l} \\ \frac{NdChar}{{\left(e^{-1}\right)}^{\left(\frac{\left(Ec - Vef\right) - \left(EDonor + mu\right)}{KbT}\right)} + 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 (+ (pow (exp -1.0) (/ (- (- Ec Vef) (+ EDonor mu)) 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 / (pow(exp(-1.0), (((Ec - Vef) - (EDonor + mu)) / 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((-1.0d0)) ** (((ec - vef) - (edonor + mu)) / 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.pow(Math.exp(-1.0), (((Ec - Vef) - (EDonor + mu)) / 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.pow(math.exp(-1.0), (((Ec - Vef) - (EDonor + mu)) / 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(-1.0) ^ Float64(Float64(Float64(Ec - Vef) - Float64(EDonor + mu)) / 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(-1.0) ^ (((Ec - Vef) - (EDonor + mu)) / 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[Power[N[Exp[-1.0], $MachinePrecision], N[(N[(N[(Ec - Vef), $MachinePrecision] - N[(EDonor + mu), $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}{{\left(e^{-1}\right)}^{\left(\frac{\left(Ec - Vef\right) - \left(EDonor + mu\right)}{KbT}\right)} + 1} + \frac{NaChar}{e^{\frac{\left(EAccept + \left(Vef + Ev\right)\right) - mu}{KbT}} + 1}
\end{array}
Derivation
  1. Initial program 100.0%

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

      \[\leadsto \frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\color{blue}{\left(Ec - Vef\right)} - EDonor\right) - mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + 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(\color{blue}{\left(\left(Ec - Vef\right) - EDonor\right)} - mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(\mathsf{neg}\left(mu\right)\right)}{KbT}}} \]
    3. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 51.3% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_0 \leq -2 \cdot 10^{-281}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{mu}{KbT}} + 1}\\

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

\mathbf{elif}\;t\_0 \leq 10^{+93}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\

\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1} + NdChar \cdot 0.5\\


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

    1. Initial program 99.9%

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

        \[\leadsto \frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\color{blue}{\left(Ec - Vef\right)} - EDonor\right) - mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + 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(\color{blue}{\left(\left(Ec - Vef\right) - EDonor\right)} - mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(\mathsf{neg}\left(mu\right)\right)}{KbT}}} \]
      3. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} \]
    9. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

    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 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. sub-negN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{mu}{KbT}}}} \]
    8. Applied rewrites53.5%

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

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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{NdChar}{2 + \color{blue}{\left(\mathsf{neg}\left(\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}\right)\right)}} \]
      2. unsub-negN/A

        \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
      3. lower--.f64N/A

        \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{NdChar}{2 - \color{blue}{\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}}} \]
    8. Applied rewrites88.9%

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

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

    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. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

    if 1.00000000000000004e93 < (+.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 EAccept 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{EAccept}{KbT}}}} \]
    4. Step-by-step derivation
      1. lower-/.f6480.1

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

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

Alternative 3: 51.7% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-281}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{mu}{KbT}} + 1}\\

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

\mathbf{elif}\;t\_1 \leq 10^{+93}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\

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


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

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

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

      \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

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

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

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

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

    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 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. sub-negN/A

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{mu}{KbT}}}} \]
    8. Applied rewrites45.5%

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

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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{NdChar}{2 + \color{blue}{\left(\mathsf{neg}\left(\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}\right)\right)}} \]
      2. unsub-negN/A

        \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
      3. lower--.f64N/A

        \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{NdChar}{2 - \color{blue}{\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}}} \]
    8. Applied rewrites88.9%

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

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

    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. sub-negN/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{EDonor}{KbT}}}} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification57.7%

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

Alternative 4: 45.2% accurate, 0.2× speedup?

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

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

\mathbf{elif}\;t\_2 \leq -1 \cdot 10^{-291}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\

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

\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-70}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 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.00000000000000007e121 or 4.9999999999999998e-70 < (+.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-+.f6446.1

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

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

    if -2.00000000000000007e121 < (+.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.99999999999999962e-292

    1. Initial program 99.9%

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

        \[\leadsto \frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\color{blue}{\left(Ec - Vef\right)} - EDonor\right) - mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + 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(\color{blue}{\left(\left(Ec - Vef\right) - EDonor\right)} - mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(\mathsf{neg}\left(mu\right)\right)}{KbT}}} \]
      3. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}} \]
    9. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}} \]
      2. lower-+.f64N/A

        \[\leadsto \frac{NaChar}{\color{blue}{1 + e^{\frac{Vef}{KbT}}}} \]
      3. lower-exp.f64N/A

        \[\leadsto \frac{NaChar}{1 + \color{blue}{e^{\frac{Vef}{KbT}}}} \]
      4. lower-/.f6443.0

        \[\leadsto \frac{NaChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
    10. Applied rewrites43.0%

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

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

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{NdChar}{2 + \color{blue}{\left(\mathsf{neg}\left(\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}\right)\right)}} \]
      2. unsub-negN/A

        \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
      3. lower--.f64N/A

        \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
      4. lower-/.f64N/A

        \[\leadsto \frac{NdChar}{2 - \color{blue}{\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}}} \]
    8. Applied rewrites90.6%

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

    if 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))))) < 4.9999999999999998e-70

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}} \]
    7. Step-by-step derivation
      1. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}} \]
      2. lower-+.f64N/A

        \[\leadsto \frac{NaChar}{\color{blue}{1 + e^{\frac{EAccept}{KbT}}}} \]
      3. lower-exp.f64N/A

        \[\leadsto \frac{NaChar}{1 + \color{blue}{e^{\frac{EAccept}{KbT}}}} \]
      4. lower-/.f6430.5

        \[\leadsto \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
    8. Applied rewrites30.5%

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

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

Alternative 5: 67.1% 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{mu + \left(EDonor + \left(Vef - Ec\right)\right)}{KbT}} + 1}\\ \mathbf{if}\;t\_1 \leq -1 \cdot 10^{+107}:\\ \;\;\;\;\frac{NdChar}{{\left(e^{-1}\right)}^{\left(\frac{\left(Ec - Vef\right) - \left(EDonor + mu\right)}{KbT}\right)} + 1} + \frac{NaChar}{2}\\ \mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-46}:\\ \;\;\;\;t\_0 + NdChar \cdot 0.5\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-30}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\right)}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(NaChar, 0.5, \frac{NdChar}{e^{\frac{EDonor + \left(Vef + \left(mu - Ec\right)\right)}{KbT}} + 1}\right)\\ \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 (/ (+ mu (+ EDonor (- Vef Ec))) KbT)) 1.0)))))
   (if (<= t_1 -1e+107)
     (+
      (/ NdChar (+ (pow (exp -1.0) (/ (- (- Ec Vef) (+ EDonor mu)) KbT)) 1.0))
      (/ NaChar 2.0))
     (if (<= t_1 -2e-46)
       (+ t_0 (* NdChar 0.5))
       (if (<= t_1 5e-30)
         (/ NaChar (+ (exp (/ (+ EAccept (+ Ev (- Vef mu))) KbT)) 1.0))
         (fma
          NaChar
          0.5
          (/ NdChar (+ (exp (/ (+ EDonor (+ Vef (- mu Ec))) KbT)) 1.0))))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
	double t_0 = NaChar / (exp((((EAccept + (Vef + Ev)) - mu) / KbT)) + 1.0);
	double t_1 = t_0 + (NdChar / (exp(((mu + (EDonor + (Vef - Ec))) / KbT)) + 1.0));
	double tmp;
	if (t_1 <= -1e+107) {
		tmp = (NdChar / (pow(exp(-1.0), (((Ec - Vef) - (EDonor + mu)) / KbT)) + 1.0)) + (NaChar / 2.0);
	} else if (t_1 <= -2e-46) {
		tmp = t_0 + (NdChar * 0.5);
	} else if (t_1 <= 5e-30) {
		tmp = NaChar / (exp(((EAccept + (Ev + (Vef - mu))) / KbT)) + 1.0);
	} else {
		tmp = fma(NaChar, 0.5, (NdChar / (exp(((EDonor + (Vef + (mu - Ec))) / KbT)) + 1.0)));
	}
	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(Float64(mu + Float64(EDonor + Float64(Vef - Ec))) / KbT)) + 1.0)))
	tmp = 0.0
	if (t_1 <= -1e+107)
		tmp = Float64(Float64(NdChar / Float64((exp(-1.0) ^ Float64(Float64(Float64(Ec - Vef) - Float64(EDonor + mu)) / KbT)) + 1.0)) + Float64(NaChar / 2.0));
	elseif (t_1 <= -2e-46)
		tmp = Float64(t_0 + Float64(NdChar * 0.5));
	elseif (t_1 <= 5e-30)
		tmp = Float64(NaChar / Float64(exp(Float64(Float64(EAccept + Float64(Ev + Float64(Vef - mu))) / KbT)) + 1.0));
	else
		tmp = fma(NaChar, 0.5, Float64(NdChar / Float64(exp(Float64(Float64(EDonor + Float64(Vef + Float64(mu - Ec))) / KbT)) + 1.0)));
	end
	return 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[(N[(mu + N[(EDonor + N[(Vef - Ec), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+107], N[(N[(NdChar / N[(N[Power[N[Exp[-1.0], $MachinePrecision], N[(N[(N[(Ec - Vef), $MachinePrecision] - N[(EDonor + mu), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, -2e-46], N[(t$95$0 + N[(NdChar * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 5e-30], N[(NaChar / N[(N[Exp[N[(N[(EAccept + N[(Ev + N[(Vef - mu), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(NaChar * 0.5 + N[(NdChar / N[(N[Exp[N[(N[(EDonor + N[(Vef + N[(mu - Ec), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\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{mu + \left(EDonor + \left(Vef - Ec\right)\right)}{KbT}} + 1}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+107}:\\
\;\;\;\;\frac{NdChar}{{\left(e^{-1}\right)}^{\left(\frac{\left(Ec - Vef\right) - \left(EDonor + mu\right)}{KbT}\right)} + 1} + \frac{NaChar}{2}\\

\mathbf{elif}\;t\_1 \leq -2 \cdot 10^{-46}:\\
\;\;\;\;t\_0 + NdChar \cdot 0.5\\

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

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(NaChar, 0.5, \frac{NdChar}{e^{\frac{EDonor + \left(Vef + \left(mu - Ec\right)\right)}{KbT}} + 1}\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 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.9999999999999997e106

    1. Initial program 99.9%

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

        \[\leadsto \frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\color{blue}{\left(Ec - Vef\right)} - EDonor\right) - mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + 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(\color{blue}{\left(\left(Ec - Vef\right) - EDonor\right)} - mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(\mathsf{neg}\left(mu\right)\right)}{KbT}}} \]
      3. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -9.9999999999999997e106 < (+.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.00000000000000005e-46

      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 NdChar} + \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. *-commutativeN/A

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

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

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

      if -2.00000000000000005e-46 < (+.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.99999999999999972e-30

      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 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--.f6475.3

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

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

      if 4.99999999999999972e-30 < (+.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 EAccept 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{EAccept}{KbT}}}} \]
      4. Step-by-step derivation
        1. lower-/.f6482.6

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(NaChar, \frac{1}{2}, \frac{NdChar}{1 + e^{\frac{EDonor + \color{blue}{\left(Vef + \left(mu - Ec\right)\right)}}{KbT}}}\right) \]
        11. lower--.f6471.7

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(NaChar, 0.5, \frac{NdChar}{1 + e^{\frac{EDonor + \left(Vef + \left(mu - Ec\right)\right)}{KbT}}}\right)} \]
    10. Recombined 4 regimes into one program.
    11. Final simplification76.4%

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

    Alternative 6: 67.1% accurate, 0.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{fma}\left(NaChar, 0.5, \frac{NdChar}{e^{\frac{EDonor + \left(Vef + \left(mu - Ec\right)\right)}{KbT}} + 1}\right)\\ t_1 := \frac{NaChar}{e^{\frac{\left(EAccept + \left(Vef + Ev\right)\right) - mu}{KbT}} + 1}\\ t_2 := t\_1 + \frac{NdChar}{e^{\frac{mu + \left(EDonor + \left(Vef - Ec\right)\right)}{KbT}} + 1}\\ \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+107}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-46}:\\ \;\;\;\;t\_1 + NdChar \cdot 0.5\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-30}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\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
             (fma
              NaChar
              0.5
              (/ NdChar (+ (exp (/ (+ EDonor (+ Vef (- mu Ec))) KbT)) 1.0))))
            (t_1 (/ NaChar (+ (exp (/ (- (+ EAccept (+ Vef Ev)) mu) KbT)) 1.0)))
            (t_2
             (+
              t_1
              (/ NdChar (+ (exp (/ (+ mu (+ EDonor (- Vef Ec))) KbT)) 1.0)))))
       (if (<= t_2 -1e+107)
         t_0
         (if (<= t_2 -2e-46)
           (+ t_1 (* NdChar 0.5))
           (if (<= t_2 5e-30)
             (/ NaChar (+ (exp (/ (+ EAccept (+ Ev (- Vef mu))) KbT)) 1.0))
             t_0)))))
    double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
    	double t_0 = fma(NaChar, 0.5, (NdChar / (exp(((EDonor + (Vef + (mu - Ec))) / KbT)) + 1.0)));
    	double t_1 = NaChar / (exp((((EAccept + (Vef + Ev)) - mu) / KbT)) + 1.0);
    	double t_2 = t_1 + (NdChar / (exp(((mu + (EDonor + (Vef - Ec))) / KbT)) + 1.0));
    	double tmp;
    	if (t_2 <= -1e+107) {
    		tmp = t_0;
    	} else if (t_2 <= -2e-46) {
    		tmp = t_1 + (NdChar * 0.5);
    	} else if (t_2 <= 5e-30) {
    		tmp = NaChar / (exp(((EAccept + (Ev + (Vef - mu))) / KbT)) + 1.0);
    	} else {
    		tmp = t_0;
    	}
    	return tmp;
    }
    
    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = fma(NaChar, 0.5, Float64(NdChar / Float64(exp(Float64(Float64(EDonor + Float64(Vef + Float64(mu - Ec))) / KbT)) + 1.0)))
    	t_1 = Float64(NaChar / Float64(exp(Float64(Float64(Float64(EAccept + Float64(Vef + Ev)) - mu) / KbT)) + 1.0))
    	t_2 = Float64(t_1 + Float64(NdChar / Float64(exp(Float64(Float64(mu + Float64(EDonor + Float64(Vef - Ec))) / KbT)) + 1.0)))
    	tmp = 0.0
    	if (t_2 <= -1e+107)
    		tmp = t_0;
    	elseif (t_2 <= -2e-46)
    		tmp = Float64(t_1 + Float64(NdChar * 0.5));
    	elseif (t_2 <= 5e-30)
    		tmp = Float64(NaChar / Float64(exp(Float64(Float64(EAccept + Float64(Ev + Float64(Vef - mu))) / KbT)) + 1.0));
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NaChar * 0.5 + N[(NdChar / N[(N[Exp[N[(N[(EDonor + N[(Vef + N[(mu - Ec), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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$2 = N[(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]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+107], t$95$0, If[LessEqual[t$95$2, -2e-46], N[(t$95$1 + N[(NdChar * 0.5), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e-30], N[(NaChar / N[(N[Exp[N[(N[(EAccept + N[(Ev + N[(Vef - mu), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \mathsf{fma}\left(NaChar, 0.5, \frac{NdChar}{e^{\frac{EDonor + \left(Vef + \left(mu - Ec\right)\right)}{KbT}} + 1}\right)\\
    t_1 := \frac{NaChar}{e^{\frac{\left(EAccept + \left(Vef + Ev\right)\right) - mu}{KbT}} + 1}\\
    t_2 := t\_1 + \frac{NdChar}{e^{\frac{mu + \left(EDonor + \left(Vef - Ec\right)\right)}{KbT}} + 1}\\
    \mathbf{if}\;t\_2 \leq -1 \cdot 10^{+107}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-46}:\\
    \;\;\;\;t\_1 + NdChar \cdot 0.5\\
    
    \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-30}:\\
    \;\;\;\;\frac{NaChar}{e^{\frac{EAccept + \left(Ev + \left(Vef - mu\right)\right)}{KbT}} + 1}\\
    
    \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.9999999999999997e106 or 4.99999999999999972e-30 < (+.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 EAccept 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{EAccept}{KbT}}}} \]
      4. Step-by-step derivation
        1. lower-/.f6484.5

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(NaChar, \frac{1}{2}, \frac{NdChar}{1 + e^{\frac{EDonor + \color{blue}{\left(Vef + \left(mu - Ec\right)\right)}}{KbT}}}\right) \]
        11. lower--.f6475.3

          \[\leadsto \mathsf{fma}\left(NaChar, 0.5, \frac{NdChar}{1 + e^{\frac{EDonor + \left(Vef + \color{blue}{\left(mu - Ec\right)}\right)}{KbT}}}\right) \]
      8. Applied rewrites75.3%

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

      if -9.9999999999999997e106 < (+.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.00000000000000005e-46

      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 NdChar} + \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. *-commutativeN/A

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

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

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

      if -2.00000000000000005e-46 < (+.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.99999999999999972e-30

      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 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--.f6475.3

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

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

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

    Alternative 7: 44.8% accurate, 0.3× speedup?

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

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

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

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{NdChar}{2 + \color{blue}{\left(\mathsf{neg}\left(\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}\right)\right)}} \]
        2. unsub-negN/A

          \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
        3. lower--.f64N/A

          \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
        4. lower-/.f64N/A

          \[\leadsto \frac{NdChar}{2 - \color{blue}{\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}}} \]
      8. Applied rewrites81.2%

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

      if 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))))) < 4.9999999999999998e-70

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

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

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

        \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}} \]
      7. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}} \]
        2. lower-+.f64N/A

          \[\leadsto \frac{NaChar}{\color{blue}{1 + e^{\frac{EAccept}{KbT}}}} \]
        3. lower-exp.f64N/A

          \[\leadsto \frac{NaChar}{1 + \color{blue}{e^{\frac{EAccept}{KbT}}}} \]
        4. lower-/.f6430.5

          \[\leadsto \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
      8. Applied rewrites30.5%

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

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

    Alternative 8: 74.0% accurate, 0.3× speedup?

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

      1. Initial program 99.9%

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

          \[\leadsto \frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\color{blue}{\left(Ec - Vef\right)} - EDonor\right) - mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + 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(\color{blue}{\left(\left(Ec - Vef\right) - EDonor\right)} - mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(\mathsf{neg}\left(mu\right)\right)}{KbT}}} \]
        3. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if 1e-79 < (+.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 EAccept 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{EAccept}{KbT}}}} \]
      4. Step-by-step derivation
        1. lower-/.f6479.6

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

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

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

    Alternative 9: 71.3% accurate, 0.3× speedup?

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

          \[\leadsto \frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\color{blue}{\left(Ec - Vef\right)} - EDonor\right) - mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + 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(\color{blue}{\left(\left(Ec - Vef\right) - EDonor\right)} - mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(\mathsf{neg}\left(mu\right)\right)}{KbT}}} \]
        3. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -5.00000000000000008e-252 < (+.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.99999999999999972e-30

      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 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--.f6480.9

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

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

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

    Alternative 10: 66.3% accurate, 0.4× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{fma}\left(NaChar, \frac{1}{2}, \frac{NdChar}{1 + e^{\frac{EDonor + \color{blue}{\left(Vef + \left(mu - Ec\right)\right)}}{KbT}}}\right) \]
        11. lower--.f6475.3

          \[\leadsto \mathsf{fma}\left(NaChar, 0.5, \frac{NdChar}{1 + e^{\frac{EDonor + \left(Vef + \color{blue}{\left(mu - Ec\right)}\right)}{KbT}}}\right) \]
      8. Applied rewrites75.3%

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

      if -9.9999999999999997e106 < (+.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.99999999999999972e-30

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

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

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

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

    Alternative 11: 43.3% accurate, 0.4× speedup?

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

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

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

      if -1.0000000000000001e-239 < (+.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-149

      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. sub-negN/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{NdChar}{2 + \color{blue}{\left(\mathsf{neg}\left(\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}\right)\right)}} \]
        2. unsub-negN/A

          \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
        3. lower--.f64N/A

          \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
        4. lower-/.f64N/A

          \[\leadsto \frac{NdChar}{2 - \color{blue}{\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}}} \]
      8. Applied rewrites62.0%

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

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

    Alternative 12: 42.4% accurate, 0.4× speedup?

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

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

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

      if -1.0000000000000001e-239 < (+.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-149

      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. sub-negN/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{NdChar}{2 + \color{blue}{\left(\mathsf{neg}\left(\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}\right)\right)}} \]
        2. unsub-negN/A

          \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
        3. lower--.f64N/A

          \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
        4. lower-/.f64N/A

          \[\leadsto \frac{NdChar}{2 - \color{blue}{\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}}} \]
      8. Applied rewrites62.0%

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

        \[\leadsto \frac{NdChar}{2 - \frac{\color{blue}{\frac{-1}{2} \cdot \frac{{\left(EDonor + \left(Vef + mu\right)\right)}^{2}}{KbT} - \left(EDonor + \left(Vef + mu\right)\right)}}{KbT}} \]
      10. Step-by-step derivation
        1. sub-negN/A

          \[\leadsto \frac{NdChar}{2 - \frac{\color{blue}{\frac{-1}{2} \cdot \frac{{\left(EDonor + \left(Vef + mu\right)\right)}^{2}}{KbT} + \left(\mathsf{neg}\left(\left(EDonor + \left(Vef + mu\right)\right)\right)\right)}}{KbT}} \]
        2. lower-fma.f64N/A

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

          \[\leadsto \frac{NdChar}{2 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \color{blue}{\frac{{\left(EDonor + \left(Vef + mu\right)\right)}^{2}}{KbT}}, \mathsf{neg}\left(\left(EDonor + \left(Vef + mu\right)\right)\right)\right)}{KbT}} \]
        4. unpow2N/A

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

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

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

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

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

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

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

          \[\leadsto \frac{NdChar}{2 - \frac{\mathsf{fma}\left(\frac{-1}{2}, \frac{\left(EDonor + \left(Vef + mu\right)\right) \cdot \left(EDonor + \left(Vef + mu\right)\right)}{KbT}, \mathsf{neg}\left(\color{blue}{\left(EDonor + \left(Vef + mu\right)\right)}\right)\right)}{KbT}} \]
        12. lower-+.f6459.5

          \[\leadsto \frac{NdChar}{2 - \frac{\mathsf{fma}\left(-0.5, \frac{\left(EDonor + \left(Vef + mu\right)\right) \cdot \left(EDonor + \left(Vef + mu\right)\right)}{KbT}, -\left(EDonor + \color{blue}{\left(Vef + mu\right)}\right)\right)}{KbT}} \]
      11. Applied rewrites59.5%

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

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

    Alternative 13: 37.4% accurate, 0.5× speedup?

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

      1. Initial program 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-+.f6438.5

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

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

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{NdChar}{2 + \color{blue}{\left(\mathsf{neg}\left(\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}\right)\right)}} \]
        2. unsub-negN/A

          \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
        3. lower--.f64N/A

          \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
        4. lower-/.f64N/A

          \[\leadsto \frac{NdChar}{2 - \color{blue}{\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}}} \]
      8. Applied rewrites81.2%

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

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

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

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

          \[\leadsto \frac{NdChar}{2 - \frac{Ec - \left(EDonor + \color{blue}{\left(Vef + mu\right)}\right)}{KbT}} \]
      11. Applied rewrites58.8%

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

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

    Alternative 14: 36.6% accurate, 0.5× speedup?

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{NdChar}{2 + \color{blue}{\left(\mathsf{neg}\left(\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}\right)\right)}} \]
        2. unsub-negN/A

          \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
        3. lower--.f64N/A

          \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
        4. lower-/.f64N/A

          \[\leadsto \frac{NdChar}{2 - \color{blue}{\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}}} \]
      8. Applied rewrites90.6%

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

        \[\leadsto \color{blue}{2 \cdot \frac{{KbT}^{2} \cdot NdChar}{{Vef}^{2}}} \]
      10. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{2 \cdot \left({KbT}^{2} \cdot NdChar\right)}{{Vef}^{2}}} \]
        2. lower-/.f64N/A

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

          \[\leadsto \frac{\color{blue}{2 \cdot \left({KbT}^{2} \cdot NdChar\right)}}{{Vef}^{2}} \]
        4. *-commutativeN/A

          \[\leadsto \frac{2 \cdot \color{blue}{\left(NdChar \cdot {KbT}^{2}\right)}}{{Vef}^{2}} \]
        5. lower-*.f64N/A

          \[\leadsto \frac{2 \cdot \color{blue}{\left(NdChar \cdot {KbT}^{2}\right)}}{{Vef}^{2}} \]
        6. unpow2N/A

          \[\leadsto \frac{2 \cdot \left(NdChar \cdot \color{blue}{\left(KbT \cdot KbT\right)}\right)}{{Vef}^{2}} \]
        7. lower-*.f64N/A

          \[\leadsto \frac{2 \cdot \left(NdChar \cdot \color{blue}{\left(KbT \cdot KbT\right)}\right)}{{Vef}^{2}} \]
        8. unpow2N/A

          \[\leadsto \frac{2 \cdot \left(NdChar \cdot \left(KbT \cdot KbT\right)\right)}{\color{blue}{Vef \cdot Vef}} \]
        9. lower-*.f6462.7

          \[\leadsto \frac{2 \cdot \left(NdChar \cdot \left(KbT \cdot KbT\right)\right)}{\color{blue}{Vef \cdot Vef}} \]
      11. Applied rewrites62.7%

        \[\leadsto \color{blue}{\frac{2 \cdot \left(NdChar \cdot \left(KbT \cdot KbT\right)\right)}{Vef \cdot Vef}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification42.2%

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

    Alternative 15: 35.1% accurate, 0.5× speedup?

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{NdChar}{2 + \color{blue}{\left(\mathsf{neg}\left(\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}\right)\right)}} \]
        2. unsub-negN/A

          \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
        3. lower--.f64N/A

          \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
        4. lower-/.f64N/A

          \[\leadsto \frac{NdChar}{2 - \color{blue}{\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}}} \]
      8. Applied rewrites87.2%

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

        \[\leadsto \color{blue}{2 \cdot \frac{{KbT}^{2} \cdot NdChar}{{Ec}^{2}}} \]
      10. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{2 \cdot \left({KbT}^{2} \cdot NdChar\right)}{{Ec}^{2}}} \]
        2. lower-/.f64N/A

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

          \[\leadsto \frac{\color{blue}{2 \cdot \left({KbT}^{2} \cdot NdChar\right)}}{{Ec}^{2}} \]
        4. *-commutativeN/A

          \[\leadsto \frac{2 \cdot \color{blue}{\left(NdChar \cdot {KbT}^{2}\right)}}{{Ec}^{2}} \]
        5. lower-*.f64N/A

          \[\leadsto \frac{2 \cdot \color{blue}{\left(NdChar \cdot {KbT}^{2}\right)}}{{Ec}^{2}} \]
        6. unpow2N/A

          \[\leadsto \frac{2 \cdot \left(NdChar \cdot \color{blue}{\left(KbT \cdot KbT\right)}\right)}{{Ec}^{2}} \]
        7. lower-*.f64N/A

          \[\leadsto \frac{2 \cdot \left(NdChar \cdot \color{blue}{\left(KbT \cdot KbT\right)}\right)}{{Ec}^{2}} \]
        8. unpow2N/A

          \[\leadsto \frac{2 \cdot \left(NdChar \cdot \left(KbT \cdot KbT\right)\right)}{\color{blue}{Ec \cdot Ec}} \]
        9. lower-*.f6456.1

          \[\leadsto \frac{2 \cdot \left(NdChar \cdot \left(KbT \cdot KbT\right)\right)}{\color{blue}{Ec \cdot Ec}} \]
      11. Applied rewrites56.1%

        \[\leadsto \color{blue}{\frac{2 \cdot \left(NdChar \cdot \left(KbT \cdot KbT\right)\right)}{Ec \cdot Ec}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification41.4%

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

    Alternative 16: 35.4% accurate, 0.5× speedup?

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{NdChar}{2 + \color{blue}{\left(\mathsf{neg}\left(\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}\right)\right)}} \]
        2. unsub-negN/A

          \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
        3. lower--.f64N/A

          \[\leadsto \frac{NdChar}{\color{blue}{2 - \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}}} \]
        4. lower-/.f64N/A

          \[\leadsto \frac{NdChar}{2 - \color{blue}{\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}}} \]
      8. Applied rewrites90.6%

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

        \[\leadsto \color{blue}{2 \cdot \frac{{KbT}^{2} \cdot NdChar}{{EDonor}^{2}}} \]
      10. Step-by-step derivation
        1. associate-*r/N/A

          \[\leadsto \color{blue}{\frac{2 \cdot \left({KbT}^{2} \cdot NdChar\right)}{{EDonor}^{2}}} \]
        2. lower-/.f64N/A

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

          \[\leadsto \frac{\color{blue}{2 \cdot \left({KbT}^{2} \cdot NdChar\right)}}{{EDonor}^{2}} \]
        4. *-commutativeN/A

          \[\leadsto \frac{2 \cdot \color{blue}{\left(NdChar \cdot {KbT}^{2}\right)}}{{EDonor}^{2}} \]
        5. lower-*.f64N/A

          \[\leadsto \frac{2 \cdot \color{blue}{\left(NdChar \cdot {KbT}^{2}\right)}}{{EDonor}^{2}} \]
        6. unpow2N/A

          \[\leadsto \frac{2 \cdot \left(NdChar \cdot \color{blue}{\left(KbT \cdot KbT\right)}\right)}{{EDonor}^{2}} \]
        7. lower-*.f64N/A

          \[\leadsto \frac{2 \cdot \left(NdChar \cdot \color{blue}{\left(KbT \cdot KbT\right)}\right)}{{EDonor}^{2}} \]
        8. unpow2N/A

          \[\leadsto \frac{2 \cdot \left(NdChar \cdot \left(KbT \cdot KbT\right)\right)}{\color{blue}{EDonor \cdot EDonor}} \]
        9. lower-*.f6440.0

          \[\leadsto \frac{2 \cdot \left(NdChar \cdot \left(KbT \cdot KbT\right)\right)}{\color{blue}{EDonor \cdot EDonor}} \]
      11. Applied rewrites40.0%

        \[\leadsto \color{blue}{\frac{2 \cdot \left(NdChar \cdot \left(KbT \cdot KbT\right)\right)}{EDonor \cdot EDonor}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification38.0%

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

    Alternative 17: 32.6% accurate, 0.5× speedup?

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

      1. Initial program 100.0%

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

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

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

          \[\leadsto \color{blue}{\left(NaChar + NdChar\right)} \cdot \frac{1}{2} \]
        4. flip-+N/A

          \[\leadsto \color{blue}{\frac{NaChar \cdot NaChar - NdChar \cdot NdChar}{NaChar - NdChar}} \cdot \frac{1}{2} \]
        5. associate-*l/N/A

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

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

          \[\leadsto \frac{\color{blue}{\left(NaChar \cdot NaChar - NdChar \cdot NdChar\right) \cdot \frac{1}{2}}}{NaChar - NdChar} \]
        8. difference-of-squaresN/A

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

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

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

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

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

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

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

          \[\leadsto \frac{\left(\left(NdChar + NaChar\right) \cdot \left(NaChar - NdChar\right)\right) \cdot 0.5}{\color{blue}{NaChar - NdChar}} \]
      7. Applied rewrites4.4%

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

        \[\leadsto \frac{\color{blue}{\frac{-1}{2} \cdot {NdChar}^{2}}}{NaChar - NdChar} \]
      9. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{\color{blue}{\frac{-1}{2} \cdot {NdChar}^{2}}}{NaChar - NdChar} \]
        2. unpow2N/A

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

          \[\leadsto \frac{-0.5 \cdot \color{blue}{\left(NdChar \cdot NdChar\right)}}{NaChar - NdChar} \]
      10. Applied rewrites29.0%

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

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

    Alternative 18: 100.0% accurate, 1.0× speedup?

    \[\begin{array}{l} \\ \mathsf{fma}\left(\frac{1}{e^{\frac{\left(EDonor + mu\right) + \left(Vef - Ec\right)}{KbT}} + 1}, NdChar, \frac{NaChar}{e^{\frac{EAccept - \left(mu - \left(Vef + Ev\right)\right)}{KbT}} + 1}\right) \end{array} \]
    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
     :precision binary64
     (fma
      (/ 1.0 (+ (exp (/ (+ (+ EDonor mu) (- Vef Ec)) KbT)) 1.0))
      NdChar
      (/ NaChar (+ (exp (/ (- EAccept (- mu (+ Vef Ev))) KbT)) 1.0))))
    double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
    	return fma((1.0 / (exp((((EDonor + mu) + (Vef - Ec)) / KbT)) + 1.0)), NdChar, (NaChar / (exp(((EAccept - (mu - (Vef + Ev))) / KbT)) + 1.0)));
    }
    
    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	return fma(Float64(1.0 / Float64(exp(Float64(Float64(Float64(EDonor + mu) + Float64(Vef - Ec)) / KbT)) + 1.0)), NdChar, Float64(NaChar / Float64(exp(Float64(Float64(EAccept - Float64(mu - Float64(Vef + Ev))) / KbT)) + 1.0)))
    end
    
    code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(N[(1.0 / N[(N[Exp[N[(N[(N[(EDonor + mu), $MachinePrecision] + N[(Vef - Ec), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] * NdChar + N[(NaChar / N[(N[Exp[N[(N[(EAccept - N[(mu - N[(Vef + Ev), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \mathsf{fma}\left(\frac{1}{e^{\frac{\left(EDonor + mu\right) + \left(Vef - Ec\right)}{KbT}} + 1}, NdChar, \frac{NaChar}{e^{\frac{EAccept - \left(mu - \left(Vef + Ev\right)\right)}{KbT}} + 1}\right)
    \end{array}
    
    Derivation
    1. Initial program 100.0%

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

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

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

    Alternative 19: 100.0% accurate, 1.0× speedup?

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

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

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

    Alternative 20: 72.4% accurate, 1.0× speedup?

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

      1. Initial program 100.0%

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

        \[\leadsto \frac{NdChar}{1 + e^{\frac{\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-/.f6474.3

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

        \[\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 5.5000000000000002e191 < EAccept

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

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

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

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

    Alternative 21: 68.2% accurate, 1.9× speedup?

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

      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 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. sub-negN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -2.4e159 < NdChar < 2.8e32

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

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

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

      if 2.8e32 < 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. sub-negN/A

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

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

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

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

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

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

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

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

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

    Alternative 22: 68.2% accurate, 1.9× speedup?

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

      1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

      if -2.4e159 < NdChar < 2.8e32

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

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

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

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

    Alternative 23: 59.0% accurate, 1.9× speedup?

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

      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 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. sub-negN/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
      7. Step-by-step derivation
        1. lower-/.f6466.9

          \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
      8. Applied rewrites66.9%

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

      if -3.60000000000000037e159 < NdChar < 5.79999999999999977e41

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

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

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

      if 5.79999999999999977e41 < 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. sub-negN/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{-1 \cdot \frac{Ec}{KbT}}}} \]
      7. Step-by-step derivation
        1. mul-1-negN/A

          \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\mathsf{neg}\left(\frac{Ec}{KbT}\right)}}} \]
        2. lower-neg.f64N/A

          \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\mathsf{neg}\left(\frac{Ec}{KbT}\right)}}} \]
        3. lower-/.f6456.5

          \[\leadsto \frac{NdChar}{1 + e^{-\color{blue}{\frac{Ec}{KbT}}}} \]
      8. Applied rewrites56.5%

        \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{-\frac{Ec}{KbT}}}} \]
    3. Recombined 3 regimes into one program.
    4. Final simplification67.4%

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

    Alternative 24: 43.7% accurate, 2.0× speedup?

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

      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 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. sub-negN/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
      7. Step-by-step derivation
        1. lower-/.f6462.7

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

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

      if -9.5000000000000008e112 < NdChar < 8200

      1. Initial program 100.0%

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

          \[\leadsto \frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\color{blue}{\left(Ec - Vef\right)} - EDonor\right) - mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + 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(\color{blue}{\left(\left(Ec - Vef\right) - EDonor\right)} - mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(\mathsf{neg}\left(mu\right)\right)}{KbT}}} \]
        3. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}} \]
      9. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}} \]
        2. lower-+.f64N/A

          \[\leadsto \frac{NaChar}{\color{blue}{1 + e^{\frac{Vef}{KbT}}}} \]
        3. lower-exp.f64N/A

          \[\leadsto \frac{NaChar}{1 + \color{blue}{e^{\frac{Vef}{KbT}}}} \]
        4. lower-/.f6449.3

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

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

      if 8200 < 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. sub-negN/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{EDonor}{KbT}}}} \]
      8. Applied rewrites55.8%

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

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

    Alternative 25: 42.0% accurate, 2.0× speedup?

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

      1. Initial program 100.0%

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

          \[\leadsto \frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\color{blue}{\left(Ec - Vef\right)} - EDonor\right) - mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + 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(\color{blue}{\left(\left(Ec - Vef\right) - EDonor\right)} - mu\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(\mathsf{neg}\left(mu\right)\right)}{KbT}}} \]
        3. lift--.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}} \]
      9. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}} \]
        2. lower-+.f64N/A

          \[\leadsto \frac{NaChar}{\color{blue}{1 + e^{\frac{Vef}{KbT}}}} \]
        3. lower-exp.f64N/A

          \[\leadsto \frac{NaChar}{1 + \color{blue}{e^{\frac{Vef}{KbT}}}} \]
        4. lower-/.f6459.3

          \[\leadsto \frac{NaChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
      10. Applied rewrites59.3%

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

      if -1.4499999999999999e-107 < NaChar < 1.60000000000000015e57

      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 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. sub-negN/A

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

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

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

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

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

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

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

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

        \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{EDonor}{KbT}}}} \]
      7. Step-by-step derivation
        1. lower-/.f6450.0

          \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{EDonor}{KbT}}}} \]
      8. Applied rewrites50.0%

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

      if 1.60000000000000015e57 < NaChar

      1. Initial program 100.0%

        \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
      2. Add Preprocessing
      3. Taylor expanded in EAccept 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{EAccept}{KbT}}}} \]
      4. Step-by-step derivation
        1. lower-/.f6458.9

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

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

        \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}} \]
      7. Step-by-step derivation
        1. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}} \]
        2. lower-+.f64N/A

          \[\leadsto \frac{NaChar}{\color{blue}{1 + e^{\frac{EAccept}{KbT}}}} \]
        3. lower-exp.f64N/A

          \[\leadsto \frac{NaChar}{1 + \color{blue}{e^{\frac{EAccept}{KbT}}}} \]
        4. lower-/.f6441.3

          \[\leadsto \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
      8. Applied rewrites41.3%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;NaChar \leq -1.45 \cdot 10^{-107}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{elif}\;NaChar \leq 1.6 \cdot 10^{+57}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\ \end{array} \]
    5. Add Preprocessing

    Alternative 26: 22.4% accurate, 15.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;NdChar \leq -2.9 \cdot 10^{+129}:\\ \;\;\;\;NdChar \cdot 0.5\\ \mathbf{elif}\;NdChar \leq 2.8 \cdot 10^{+32}:\\ \;\;\;\;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 -2.9e+129)
       (* NdChar 0.5)
       (if (<= NdChar 2.8e+32) (* 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 <= -2.9e+129) {
    		tmp = NdChar * 0.5;
    	} else if (NdChar <= 2.8e+32) {
    		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 <= (-2.9d+129)) then
            tmp = ndchar * 0.5d0
        else if (ndchar <= 2.8d+32) 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 <= -2.9e+129) {
    		tmp = NdChar * 0.5;
    	} else if (NdChar <= 2.8e+32) {
    		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 <= -2.9e+129:
    		tmp = NdChar * 0.5
    	elif NdChar <= 2.8e+32:
    		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 <= -2.9e+129)
    		tmp = Float64(NdChar * 0.5);
    	elseif (NdChar <= 2.8e+32)
    		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 <= -2.9e+129)
    		tmp = NdChar * 0.5;
    	elseif (NdChar <= 2.8e+32)
    		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, -2.9e+129], N[(NdChar * 0.5), $MachinePrecision], If[LessEqual[NdChar, 2.8e+32], N[(NaChar * 0.5), $MachinePrecision], N[(NdChar * 0.5), $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;NdChar \leq -2.9 \cdot 10^{+129}:\\
    \;\;\;\;NdChar \cdot 0.5\\
    
    \mathbf{elif}\;NdChar \leq 2.8 \cdot 10^{+32}:\\
    \;\;\;\;NaChar \cdot 0.5\\
    
    \mathbf{else}:\\
    \;\;\;\;NdChar \cdot 0.5\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if NdChar < -2.90000000000000003e129 or 2.8e32 < NdChar

      1. Initial program 99.9%

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{NdChar \cdot \frac{1}{2}} \]
        2. lower-*.f6429.7

          \[\leadsto \color{blue}{NdChar \cdot 0.5} \]
      8. Applied rewrites29.7%

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

      if -2.90000000000000003e129 < NdChar < 2.8e32

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

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

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

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

          \[\leadsto \color{blue}{NaChar \cdot \frac{1}{2}} \]
        2. lower-*.f6425.2

          \[\leadsto \color{blue}{NaChar \cdot 0.5} \]
      8. Applied rewrites25.2%

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

    Alternative 27: 27.3% 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 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-+.f6431.1

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

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

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

    Alternative 28: 18.0% 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 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-+.f6431.1

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

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

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

        \[\leadsto \color{blue}{NaChar \cdot \frac{1}{2}} \]
      2. lower-*.f6419.2

        \[\leadsto \color{blue}{NaChar \cdot 0.5} \]
    8. Applied rewrites19.2%

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

    Reproduce

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