Bulmash initializePoisson

Percentage Accurate: 100.0% → 100.0%
Time: 19.5s
Alternatives: 21
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 21 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \left(e^{\frac{1}{\frac{KbT}{Vef + \left(mu + \left(EDonor - Ec\right)\right)}}}\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
    2. div-invN/A

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \left({\left(e^{1}\right)}^{\left(\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}\right)}\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
    5. pow-lowering-pow.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{pow.f64}\left(\left(e^{1}\right), \left(\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
    6. exp-lowering-exp.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(1\right), \left(\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
    7. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(1\right), \mathsf{/.f64}\left(\left(Vef + \left(mu + \left(EDonor - Ec\right)\right)\right), KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
    8. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(1\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \left(mu + \left(EDonor - Ec\right)\right)\right), KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
    9. associate-+r-N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(1\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \left(\left(mu + EDonor\right) - Ec\right)\right), KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
    10. --lowering--.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(1\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(\left(mu + EDonor\right), Ec\right)\right), KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
    11. +-lowering-+.f64100.0%

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{pow.f64}\left(\mathsf{exp.f64}\left(1\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(mu, EDonor\right), Ec\right)\right), KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
  5. Applied egg-rr100.0%

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

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

Alternative 2: 77.1% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;Vef \leq 1.35 \cdot 10^{-76}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}} + 1} + \frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Vef < -1.5e13 or 1.35e-76 < Vef

    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. Simplified99.9%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(mu, \mathsf{\_.f64}\left(EDonor, Ec\right)\right)\right), KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Vef}{KbT}\right)}\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. /-lowering-/.f6483.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(mu, \mathsf{\_.f64}\left(EDonor, Ec\right)\right)\right), KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right)\right)\right)\right)\right) \]
    6. Simplified83.4%

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

    if -1.5e13 < Vef < 1.35e-76

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EDonor}{KbT}\right)}\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. /-lowering-/.f6478.2%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
    6. Simplified78.2%

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

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

Alternative 3: 100.0% accurate, 1.0× speedup?

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

\\
\frac{NaChar}{e^{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}} + 1} + \frac{NdChar}{e^{\frac{Vef + \left(mu + \left(EDonor - 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. Simplified100.0%

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

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

Alternative 4: 68.7% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;mu \leq 1.6 \cdot 10^{+91}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}} + 1} + \frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if mu < 1.59999999999999995e91

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

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EDonor}{KbT}\right)}\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. /-lowering-/.f6471.8%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
    6. Simplified71.8%

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

    if 1.59999999999999995e91 < mu

    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. Simplified99.9%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
      4. /-lowering-/.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
      5. --lowering--.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(EDonor + \left(Vef + mu\right)\right), Ec\right), KbT\right)\right)\right)\right) \]
      6. associate-+r+N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\left(EDonor + Vef\right) + mu\right), Ec\right), KbT\right)\right)\right)\right) \]
      7. +-lowering-+.f64N/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(EDonor + Vef\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
      8. +-commutativeN/A

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(Vef + EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
      9. +-lowering-+.f6474.4%

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
    6. Simplified74.4%

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

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

Alternative 5: 42.8% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\
t_1 := \frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1} + \frac{NaChar}{2}\\
\mathbf{if}\;KbT \leq -5.8 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;KbT \leq -1.2 \cdot 10^{-120}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;KbT \leq -4 \cdot 10^{-210}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} + 1}\\

\mathbf{elif}\;KbT \leq 8.5 \cdot 10^{-186}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;KbT \leq 1.05 \cdot 10^{+139}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if KbT < -5.79999999999999996e144 or 1.0499999999999999e139 < 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. Simplified99.9%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EDonor}{KbT}\right)}\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. /-lowering-/.f6481.9%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
    6. Simplified81.9%

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

      \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \color{blue}{2}\right)\right) \]
    8. Step-by-step derivation
      1. Simplified77.1%

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

      if -5.79999999999999996e144 < KbT < -1.2e-120 or -4.0000000000000002e-210 < KbT < 8.4999999999999994e-186

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
        7. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
        11. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        12. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef - mu\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. --lowering--.f6466.0%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \mathsf{\_.f64}\left(Vef, mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified66.0%

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EAccept}{KbT}\right)}\right)\right)\right) \]
      8. Step-by-step derivation
        1. /-lowering-/.f6435.8%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right)\right)\right)\right) \]
      9. Simplified35.8%

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

      if -1.2e-120 < KbT < -4.0000000000000002e-210

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
        5. --lowering--.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(EDonor + \left(Vef + mu\right)\right), Ec\right), KbT\right)\right)\right)\right) \]
        6. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\left(EDonor + Vef\right) + mu\right), Ec\right), KbT\right)\right)\right)\right) \]
        7. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(EDonor + Vef\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
        8. +-commutativeN/A

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(Vef + EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
        9. +-lowering-+.f6487.6%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
      6. Simplified87.6%

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Vef}{KbT}\right)}\right)\right)\right) \]
      8. Step-by-step derivation
        1. /-lowering-/.f6456.1%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right)\right)\right)\right) \]
      9. Simplified56.1%

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

      if 8.4999999999999994e-186 < KbT < 1.0499999999999999e139

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
        5. associate--l+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
        6. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
        7. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        8. associate-+r+N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        9. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
        10. +-lowering-+.f64N/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
        11. mul-1-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
        12. sub-negN/A

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef - mu\right)\right)\right), KbT\right)\right)\right)\right) \]
        13. --lowering--.f6464.0%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \mathsf{\_.f64}\left(Vef, mu\right)\right)\right), KbT\right)\right)\right)\right) \]
      6. Simplified64.0%

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Ev}{KbT}\right)}\right)\right)\right) \]
      8. Step-by-step derivation
        1. /-lowering-/.f6443.5%

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Ev, KbT\right)\right)\right)\right) \]
      9. Simplified43.5%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -5.8 \cdot 10^{+144}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1} + \frac{NaChar}{2}\\ \mathbf{elif}\;KbT \leq -1.2 \cdot 10^{-120}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\ \mathbf{elif}\;KbT \leq -4 \cdot 10^{-210}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{elif}\;KbT \leq 8.5 \cdot 10^{-186}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\ \mathbf{elif}\;KbT \leq 1.05 \cdot 10^{+139}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1} + \frac{NaChar}{2}\\ \end{array} \]
    11. Add Preprocessing

    Alternative 6: 42.5% accurate, 1.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\ t_1 := e^{\frac{Vef}{KbT}} + 1\\ \mathbf{if}\;KbT \leq -1.1 \cdot 10^{+139}:\\ \;\;\;\;t\_0 + \frac{NdChar}{2}\\ \mathbf{elif}\;KbT \leq -3.7 \cdot 10^{-121}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq -8.4 \cdot 10^{-211}:\\ \;\;\;\;\frac{NdChar}{t\_1}\\ \mathbf{elif}\;KbT \leq 2 \cdot 10^{-188}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 4.8 \cdot 10^{+46}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{t\_1} + \frac{NdChar}{2}\\ \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)))
            (t_1 (+ (exp (/ Vef KbT)) 1.0)))
       (if (<= KbT -1.1e+139)
         (+ t_0 (/ NdChar 2.0))
         (if (<= KbT -3.7e-121)
           t_0
           (if (<= KbT -8.4e-211)
             (/ NdChar t_1)
             (if (<= KbT 2e-188)
               t_0
               (if (<= KbT 4.8e+46)
                 (/ NaChar (+ (exp (/ Ev KbT)) 1.0))
                 (+ (/ NaChar t_1) (/ NdChar 2.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);
    	double t_1 = exp((Vef / KbT)) + 1.0;
    	double tmp;
    	if (KbT <= -1.1e+139) {
    		tmp = t_0 + (NdChar / 2.0);
    	} else if (KbT <= -3.7e-121) {
    		tmp = t_0;
    	} else if (KbT <= -8.4e-211) {
    		tmp = NdChar / t_1;
    	} else if (KbT <= 2e-188) {
    		tmp = t_0;
    	} else if (KbT <= 4.8e+46) {
    		tmp = NaChar / (exp((Ev / KbT)) + 1.0);
    	} else {
    		tmp = (NaChar / t_1) + (NdChar / 2.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((eaccept / kbt)) + 1.0d0)
        t_1 = exp((vef / kbt)) + 1.0d0
        if (kbt <= (-1.1d+139)) then
            tmp = t_0 + (ndchar / 2.0d0)
        else if (kbt <= (-3.7d-121)) then
            tmp = t_0
        else if (kbt <= (-8.4d-211)) then
            tmp = ndchar / t_1
        else if (kbt <= 2d-188) then
            tmp = t_0
        else if (kbt <= 4.8d+46) then
            tmp = nachar / (exp((ev / kbt)) + 1.0d0)
        else
            tmp = (nachar / t_1) + (ndchar / 2.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 = NaChar / (Math.exp((EAccept / KbT)) + 1.0);
    	double t_1 = Math.exp((Vef / KbT)) + 1.0;
    	double tmp;
    	if (KbT <= -1.1e+139) {
    		tmp = t_0 + (NdChar / 2.0);
    	} else if (KbT <= -3.7e-121) {
    		tmp = t_0;
    	} else if (KbT <= -8.4e-211) {
    		tmp = NdChar / t_1;
    	} else if (KbT <= 2e-188) {
    		tmp = t_0;
    	} else if (KbT <= 4.8e+46) {
    		tmp = NaChar / (Math.exp((Ev / KbT)) + 1.0);
    	} else {
    		tmp = (NaChar / t_1) + (NdChar / 2.0);
    	}
    	return tmp;
    }
    
    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
    	t_0 = NaChar / (math.exp((EAccept / KbT)) + 1.0)
    	t_1 = math.exp((Vef / KbT)) + 1.0
    	tmp = 0
    	if KbT <= -1.1e+139:
    		tmp = t_0 + (NdChar / 2.0)
    	elif KbT <= -3.7e-121:
    		tmp = t_0
    	elif KbT <= -8.4e-211:
    		tmp = NdChar / t_1
    	elif KbT <= 2e-188:
    		tmp = t_0
    	elif KbT <= 4.8e+46:
    		tmp = NaChar / (math.exp((Ev / KbT)) + 1.0)
    	else:
    		tmp = (NaChar / t_1) + (NdChar / 2.0)
    	return tmp
    
    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = Float64(NaChar / Float64(exp(Float64(EAccept / KbT)) + 1.0))
    	t_1 = Float64(exp(Float64(Vef / KbT)) + 1.0)
    	tmp = 0.0
    	if (KbT <= -1.1e+139)
    		tmp = Float64(t_0 + Float64(NdChar / 2.0));
    	elseif (KbT <= -3.7e-121)
    		tmp = t_0;
    	elseif (KbT <= -8.4e-211)
    		tmp = Float64(NdChar / t_1);
    	elseif (KbT <= 2e-188)
    		tmp = t_0;
    	elseif (KbT <= 4.8e+46)
    		tmp = Float64(NaChar / Float64(exp(Float64(Ev / KbT)) + 1.0));
    	else
    		tmp = Float64(Float64(NaChar / t_1) + Float64(NdChar / 2.0));
    	end
    	return tmp
    end
    
    function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = NaChar / (exp((EAccept / KbT)) + 1.0);
    	t_1 = exp((Vef / KbT)) + 1.0;
    	tmp = 0.0;
    	if (KbT <= -1.1e+139)
    		tmp = t_0 + (NdChar / 2.0);
    	elseif (KbT <= -3.7e-121)
    		tmp = t_0;
    	elseif (KbT <= -8.4e-211)
    		tmp = NdChar / t_1;
    	elseif (KbT <= 2e-188)
    		tmp = t_0;
    	elseif (KbT <= 4.8e+46)
    		tmp = NaChar / (exp((Ev / KbT)) + 1.0);
    	else
    		tmp = (NaChar / t_1) + (NdChar / 2.0);
    	end
    	tmp_2 = tmp;
    end
    
    code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NaChar / N[(N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]}, If[LessEqual[KbT, -1.1e+139], N[(t$95$0 + N[(NdChar / 2.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, -3.7e-121], t$95$0, If[LessEqual[KbT, -8.4e-211], N[(NdChar / t$95$1), $MachinePrecision], If[LessEqual[KbT, 2e-188], t$95$0, If[LessEqual[KbT, 4.8e+46], N[(NaChar / N[(N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(NaChar / t$95$1), $MachinePrecision] + N[(NdChar / 2.0), $MachinePrecision]), $MachinePrecision]]]]]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\
    t_1 := e^{\frac{Vef}{KbT}} + 1\\
    \mathbf{if}\;KbT \leq -1.1 \cdot 10^{+139}:\\
    \;\;\;\;t\_0 + \frac{NdChar}{2}\\
    
    \mathbf{elif}\;KbT \leq -3.7 \cdot 10^{-121}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;KbT \leq -8.4 \cdot 10^{-211}:\\
    \;\;\;\;\frac{NdChar}{t\_1}\\
    
    \mathbf{elif}\;KbT \leq 2 \cdot 10^{-188}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;KbT \leq 4.8 \cdot 10^{+46}:\\
    \;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{NaChar}{t\_1} + \frac{NdChar}{2}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 5 regimes
    2. if KbT < -1.1e139

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \color{blue}{2}\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
      5. Step-by-step derivation
        1. Simplified82.8%

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

          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EAccept}{KbT}\right)}\right)\right)\right)\right) \]
        3. Step-by-step derivation
          1. /-lowering-/.f6482.4%

            \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right)\right)\right)\right)\right) \]
        4. Simplified82.4%

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

        if -1.1e139 < KbT < -3.7000000000000002e-121 or -8.4000000000000003e-211 < KbT < 1.9999999999999999e-188

        1. Initial program 100.0%

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
          4. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
          5. associate--l+N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
          6. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
          7. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
          8. associate-+r+N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
          9. mul-1-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
          10. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
          11. mul-1-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
          12. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef - mu\right)\right)\right), KbT\right)\right)\right)\right) \]
          13. --lowering--.f6466.0%

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \mathsf{\_.f64}\left(Vef, mu\right)\right)\right), KbT\right)\right)\right)\right) \]
        6. Simplified66.0%

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EAccept}{KbT}\right)}\right)\right)\right) \]
        8. Step-by-step derivation
          1. /-lowering-/.f6435.8%

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right)\right)\right)\right) \]
        9. Simplified35.8%

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

        if -3.7000000000000002e-121 < KbT < -8.4000000000000003e-211

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
          4. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
          5. --lowering--.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(EDonor + \left(Vef + mu\right)\right), Ec\right), KbT\right)\right)\right)\right) \]
          6. associate-+r+N/A

            \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\left(EDonor + Vef\right) + mu\right), Ec\right), KbT\right)\right)\right)\right) \]
          7. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(EDonor + Vef\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
          8. +-commutativeN/A

            \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(Vef + EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
          9. +-lowering-+.f6487.6%

            \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
        6. Simplified87.6%

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Vef}{KbT}\right)}\right)\right)\right) \]
        8. Step-by-step derivation
          1. /-lowering-/.f6456.1%

            \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right)\right)\right)\right) \]
        9. Simplified56.1%

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

        if 1.9999999999999999e-188 < KbT < 4.80000000000000017e46

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
          4. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
          5. associate--l+N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
          6. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
          7. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
          8. associate-+r+N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
          9. mul-1-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
          10. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
          11. mul-1-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
          12. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef - mu\right)\right)\right), KbT\right)\right)\right)\right) \]
          13. --lowering--.f6461.3%

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \mathsf{\_.f64}\left(Vef, mu\right)\right)\right), KbT\right)\right)\right)\right) \]
        6. Simplified61.3%

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Ev}{KbT}\right)}\right)\right)\right) \]
        8. Step-by-step derivation
          1. /-lowering-/.f6441.2%

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Ev, KbT\right)\right)\right)\right) \]
        9. Simplified41.2%

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

        if 4.80000000000000017e46 < KbT

        1. Initial program 99.8%

          \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
        2. Simplified99.8%

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

          \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \color{blue}{2}\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
        5. Step-by-step derivation
          1. Simplified66.2%

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Vef}{KbT}\right)}\right)\right)\right)\right) \]
          3. Step-by-step derivation
            1. /-lowering-/.f6458.7%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right)\right)\right)\right)\right) \]
          4. Simplified58.7%

            \[\leadsto \frac{NdChar}{2} + \frac{NaChar}{1 + e^{\color{blue}{\frac{Vef}{KbT}}}} \]
        6. Recombined 5 regimes into one program.
        7. Final simplification50.5%

          \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -1.1 \cdot 10^{+139}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1} + \frac{NdChar}{2}\\ \mathbf{elif}\;KbT \leq -3.7 \cdot 10^{-121}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\ \mathbf{elif}\;KbT \leq -8.4 \cdot 10^{-211}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{elif}\;KbT \leq 2 \cdot 10^{-188}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\ \mathbf{elif}\;KbT \leq 4.8 \cdot 10^{+46}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1} + \frac{NdChar}{2}\\ \end{array} \]
        8. Add Preprocessing

        Alternative 7: 42.7% accurate, 1.8× speedup?

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

          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. Simplified99.9%

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EDonor}{KbT}\right)}\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
          5. Step-by-step derivation
            1. /-lowering-/.f6490.3%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
          6. Simplified90.3%

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

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

              \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{\left(1 + e^{\frac{EDonor}{KbT}}\right)}\right) \]
            2. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{\frac{EDonor}{KbT}}\right)}\right)\right) \]
            3. exp-lowering-exp.f64N/A

              \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{EDonor}{KbT}\right)\right)\right)\right) \]
            4. /-lowering-/.f6457.3%

              \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right) \]
          9. Simplified57.3%

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

          if -1.72e115 < EDonor < -1.85e-155

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
            4. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
            5. associate--l+N/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
            6. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
            7. sub-negN/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
            8. associate-+r+N/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
            9. mul-1-negN/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
            10. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
            11. mul-1-negN/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
            12. sub-negN/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef - mu\right)\right)\right), KbT\right)\right)\right)\right) \]
            13. --lowering--.f6469.0%

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \mathsf{\_.f64}\left(Vef, mu\right)\right)\right), KbT\right)\right)\right)\right) \]
          6. Simplified69.0%

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EAccept}{KbT}\right)}\right)\right)\right) \]
          8. Step-by-step derivation
            1. /-lowering-/.f6451.3%

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right)\right)\right)\right) \]
          9. Simplified51.3%

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

          if -1.85e-155 < EDonor < 2.59999999999999987e116

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
            4. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
            5. --lowering--.f64N/A

              \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(EDonor + \left(Vef + mu\right)\right), Ec\right), KbT\right)\right)\right)\right) \]
            6. associate-+r+N/A

              \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\left(EDonor + Vef\right) + mu\right), Ec\right), KbT\right)\right)\right)\right) \]
            7. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(EDonor + Vef\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
            8. +-commutativeN/A

              \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(Vef + EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
            9. +-lowering-+.f6466.3%

              \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
          6. Simplified66.3%

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

            \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Vef}{KbT}\right)}\right)\right)\right) \]
          8. Step-by-step derivation
            1. /-lowering-/.f6452.1%

              \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right)\right)\right)\right) \]
          9. Simplified52.1%

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

          if 2.59999999999999987e116 < EDonor < 6.20000000000000022e235

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
            4. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
            5. associate--l+N/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
            6. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
            7. sub-negN/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
            8. associate-+r+N/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
            9. mul-1-negN/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
            10. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
            11. mul-1-negN/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
            12. sub-negN/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef - mu\right)\right)\right), KbT\right)\right)\right)\right) \]
            13. --lowering--.f6479.9%

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \mathsf{\_.f64}\left(Vef, mu\right)\right)\right), KbT\right)\right)\right)\right) \]
          6. Simplified79.9%

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Ev}{KbT}\right)}\right)\right)\right) \]
          8. Step-by-step derivation
            1. /-lowering-/.f6466.1%

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Ev, KbT\right)\right)\right)\right) \]
          9. Simplified66.1%

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;EDonor \leq -1.72 \cdot 10^{+115}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{elif}\;EDonor \leq -1.85 \cdot 10^{-155}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\ \mathbf{elif}\;EDonor \leq 2.6 \cdot 10^{+116}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{elif}\;EDonor \leq 6.2 \cdot 10^{+235}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \end{array} \]
        5. Add Preprocessing

        Alternative 8: 69.9% accurate, 1.9× speedup?

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

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
            4. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
            5. associate--l+N/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
            6. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
            7. sub-negN/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
            8. associate-+r+N/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
            9. mul-1-negN/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
            10. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
            11. mul-1-negN/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
            12. sub-negN/A

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef - mu\right)\right)\right), KbT\right)\right)\right)\right) \]
            13. --lowering--.f6472.0%

              \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \mathsf{\_.f64}\left(Vef, mu\right)\right)\right), KbT\right)\right)\right)\right) \]
          6. Simplified72.0%

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

          if -5.8000000000000004e-6 < NaChar < 2.8499999999999998e-27

          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. Simplified99.9%

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

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

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

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

              \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
            4. /-lowering-/.f64N/A

              \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
            5. --lowering--.f64N/A

              \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(EDonor + \left(Vef + mu\right)\right), Ec\right), KbT\right)\right)\right)\right) \]
            6. associate-+r+N/A

              \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\left(EDonor + Vef\right) + mu\right), Ec\right), KbT\right)\right)\right)\right) \]
            7. +-lowering-+.f64N/A

              \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(EDonor + Vef\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
            8. +-commutativeN/A

              \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(Vef + EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
            9. +-lowering-+.f6472.1%

              \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
          6. Simplified72.1%

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

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

        Alternative 9: 64.2% accurate, 1.9× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1} + \frac{NaChar}{2}\\ \mathbf{if}\;KbT \leq -2 \cdot 10^{+141}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 10^{+249}:\\ \;\;\;\;\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 KbT)) 1.0)) (/ NaChar 2.0))))
           (if (<= KbT -2e+141)
             t_0
             (if (<= KbT 1e+249)
               (/ 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 / KbT)) + 1.0)) + (NaChar / 2.0);
        	double tmp;
        	if (KbT <= -2e+141) {
        		tmp = t_0;
        	} else if (KbT <= 1e+249) {
        		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 / kbt)) + 1.0d0)) + (nachar / 2.0d0)
            if (kbt <= (-2d+141)) then
                tmp = t_0
            else if (kbt <= 1d+249) 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 / KbT)) + 1.0)) + (NaChar / 2.0);
        	double tmp;
        	if (KbT <= -2e+141) {
        		tmp = t_0;
        	} else if (KbT <= 1e+249) {
        		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 / KbT)) + 1.0)) + (NaChar / 2.0)
        	tmp = 0
        	if KbT <= -2e+141:
        		tmp = t_0
        	elif KbT <= 1e+249:
        		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(NdChar / Float64(exp(Float64(EDonor / KbT)) + 1.0)) + Float64(NaChar / 2.0))
        	tmp = 0.0
        	if (KbT <= -2e+141)
        		tmp = t_0;
        	elseif (KbT <= 1e+249)
        		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 / KbT)) + 1.0)) + (NaChar / 2.0);
        	tmp = 0.0;
        	if (KbT <= -2e+141)
        		tmp = t_0;
        	elseif (KbT <= 1e+249)
        		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[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / 2.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -2e+141], t$95$0, If[LessEqual[KbT, 1e+249], 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}{KbT}} + 1} + \frac{NaChar}{2}\\
        \mathbf{if}\;KbT \leq -2 \cdot 10^{+141}:\\
        \;\;\;\;t\_0\\
        
        \mathbf{elif}\;KbT \leq 10^{+249}:\\
        \;\;\;\;\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 KbT < -2.00000000000000003e141 or 9.9999999999999992e248 < 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. Simplified99.9%

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EDonor}{KbT}\right)}\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
          5. Step-by-step derivation
            1. /-lowering-/.f6490.0%

              \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
          6. Simplified90.0%

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

            \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \color{blue}{2}\right)\right) \]
          8. Step-by-step derivation
            1. Simplified88.1%

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

            if -2.00000000000000003e141 < KbT < 9.9999999999999992e248

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

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

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

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

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

                \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
              4. /-lowering-/.f64N/A

                \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
              5. associate--l+N/A

                \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
              6. +-lowering-+.f64N/A

                \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
              7. sub-negN/A

                \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
              8. associate-+r+N/A

                \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
              9. mul-1-negN/A

                \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
              10. +-lowering-+.f64N/A

                \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
              11. mul-1-negN/A

                \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
              12. sub-negN/A

                \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef - mu\right)\right)\right), KbT\right)\right)\right)\right) \]
              13. --lowering--.f6462.5%

                \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \mathsf{\_.f64}\left(Vef, mu\right)\right)\right), KbT\right)\right)\right)\right) \]
            6. Simplified62.5%

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

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

          Alternative 10: 41.0% accurate, 1.9× speedup?

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

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

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

              \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \color{blue}{2}\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
            5. Step-by-step derivation
              1. Simplified81.3%

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

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \color{blue}{\left(\left(2 + \left(\frac{EAccept}{KbT} + \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right)\right) - \frac{mu}{KbT}\right)}\right)\right) \]
              3. Step-by-step derivation
                1. --lowering--.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\left(2 + \left(\frac{EAccept}{KbT} + \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right)\right), \color{blue}{\left(\frac{mu}{KbT}\right)}\right)\right)\right) \]
                2. associate-+r+N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\left(\left(2 + \frac{EAccept}{KbT}\right) + \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right), \left(\frac{\color{blue}{mu}}{KbT}\right)\right)\right)\right) \]
                3. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(2 + \frac{EAccept}{KbT}\right), \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right), \left(\frac{\color{blue}{mu}}{KbT}\right)\right)\right)\right) \]
                4. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(2, \left(\frac{EAccept}{KbT}\right)\right), \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                5. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(EAccept, KbT\right)\right), \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                6. +-commutativeN/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(EAccept, KbT\right)\right), \left(\frac{Vef}{KbT} + \frac{Ev}{KbT}\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                7. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(EAccept, KbT\right)\right), \mathsf{+.f64}\left(\left(\frac{Vef}{KbT}\right), \left(\frac{Ev}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                8. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(EAccept, KbT\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right), \left(\frac{Ev}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                9. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(EAccept, KbT\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                10. /-lowering-/.f6479.0%

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(EAccept, KbT\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right)\right), \mathsf{/.f64}\left(mu, \color{blue}{KbT}\right)\right)\right)\right) \]
              4. Simplified79.0%

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

              if -1.90000000000000007e136 < KbT < 1.4500000000000001e-186

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

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

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

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

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

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
                4. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
                5. associate--l+N/A

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
                6. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
                7. sub-negN/A

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                8. associate-+r+N/A

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                9. mul-1-negN/A

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                10. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                11. mul-1-negN/A

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                12. sub-negN/A

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef - mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                13. --lowering--.f6462.4%

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \mathsf{\_.f64}\left(Vef, mu\right)\right)\right), KbT\right)\right)\right)\right) \]
              6. Simplified62.4%

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

                \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EAccept}{KbT}\right)}\right)\right)\right) \]
              8. Step-by-step derivation
                1. /-lowering-/.f6434.0%

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right)\right)\right)\right) \]
              9. Simplified34.0%

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

              if 1.4500000000000001e-186 < KbT < 4.1999999999999997e139

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

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

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

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

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

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
                4. /-lowering-/.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
                5. associate--l+N/A

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
                6. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
                7. sub-negN/A

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                8. associate-+r+N/A

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                9. mul-1-negN/A

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                10. +-lowering-+.f64N/A

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                11. mul-1-negN/A

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                12. sub-negN/A

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef - mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                13. --lowering--.f6464.0%

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \mathsf{\_.f64}\left(Vef, mu\right)\right)\right), KbT\right)\right)\right)\right) \]
              6. Simplified64.0%

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

                \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{Ev}{KbT}\right)}\right)\right)\right) \]
              8. Step-by-step derivation
                1. /-lowering-/.f6443.5%

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Ev, KbT\right)\right)\right)\right) \]
              9. Simplified43.5%

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

              if 4.1999999999999997e139 < KbT

              1. Initial program 99.8%

                \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
              2. Simplified99.8%

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

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

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

                  \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
                3. +-lowering-+.f6455.9%

                  \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
              6. Simplified55.9%

                \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
            6. Recombined 4 regimes into one program.
            7. Final simplification46.9%

              \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -1.9 \cdot 10^{+136}:\\ \;\;\;\;\frac{NdChar}{2} + \frac{NaChar}{\left(\left(2 + \frac{EAccept}{KbT}\right) + \left(\frac{Vef}{KbT} + \frac{Ev}{KbT}\right)\right) - \frac{mu}{KbT}}\\ \mathbf{elif}\;KbT \leq 1.45 \cdot 10^{-186}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\ \mathbf{elif}\;KbT \leq 4.2 \cdot 10^{+139}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
            8. Add Preprocessing

            Alternative 11: 40.7% accurate, 2.0× speedup?

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

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

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

                \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \color{blue}{2}\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(Ev, mu\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
              5. Step-by-step derivation
                1. Simplified81.3%

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

                  \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \color{blue}{\left(\left(2 + \left(\frac{EAccept}{KbT} + \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right)\right) - \frac{mu}{KbT}\right)}\right)\right) \]
                3. Step-by-step derivation
                  1. --lowering--.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\left(2 + \left(\frac{EAccept}{KbT} + \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right)\right), \color{blue}{\left(\frac{mu}{KbT}\right)}\right)\right)\right) \]
                  2. associate-+r+N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\left(\left(2 + \frac{EAccept}{KbT}\right) + \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right), \left(\frac{\color{blue}{mu}}{KbT}\right)\right)\right)\right) \]
                  3. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(2 + \frac{EAccept}{KbT}\right), \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right), \left(\frac{\color{blue}{mu}}{KbT}\right)\right)\right)\right) \]
                  4. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(2, \left(\frac{EAccept}{KbT}\right)\right), \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                  5. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(EAccept, KbT\right)\right), \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                  6. +-commutativeN/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(EAccept, KbT\right)\right), \left(\frac{Vef}{KbT} + \frac{Ev}{KbT}\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                  7. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(EAccept, KbT\right)\right), \mathsf{+.f64}\left(\left(\frac{Vef}{KbT}\right), \left(\frac{Ev}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                  8. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(EAccept, KbT\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right), \left(\frac{Ev}{KbT}\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                  9. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(EAccept, KbT\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right)\right), \left(\frac{mu}{KbT}\right)\right)\right)\right) \]
                  10. /-lowering-/.f6479.0%

                    \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, 2\right), \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(EAccept, KbT\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right), \mathsf{/.f64}\left(Ev, KbT\right)\right)\right), \mathsf{/.f64}\left(mu, \color{blue}{KbT}\right)\right)\right)\right) \]
                4. Simplified79.0%

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

                if -1.54999999999999992e136 < KbT < 2.9000000000000001e27

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

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

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

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

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

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
                  5. associate--l+N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
                  6. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
                  7. sub-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                  8. associate-+r+N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                  9. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                  10. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                  11. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                  12. sub-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef - mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                  13. --lowering--.f6462.2%

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \mathsf{\_.f64}\left(Vef, mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                6. Simplified62.2%

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

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EAccept}{KbT}\right)}\right)\right)\right) \]
                8. Step-by-step derivation
                  1. /-lowering-/.f6437.0%

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right)\right)\right)\right) \]
                9. Simplified37.0%

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

                if 2.9000000000000001e27 < 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. Simplified99.9%

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
                  3. +-lowering-+.f6446.7%

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
                6. Simplified46.7%

                  \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
              6. Recombined 3 regimes into one program.
              7. Final simplification46.1%

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

              Alternative 12: 35.9% accurate, 5.3× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -4.2 \cdot 10^{+83}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 3.7 \cdot 10^{-61}:\\ \;\;\;\;\frac{NdChar}{2 + \frac{\left(\left(Vef + EDonor\right) + \left(mu - Ec\right)\right) + \frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT} \cdot \left(\left(\left(\left(Ec - EDonor\right) - mu\right) - Vef\right) \cdot -0.5\right)}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
              (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
               :precision binary64
               (let* ((t_0 (* 0.5 (+ NdChar NaChar))))
                 (if (<= KbT -4.2e+83)
                   t_0
                   (if (<= KbT 3.7e-61)
                     (/
                      NdChar
                      (+
                       2.0
                       (/
                        (+
                         (+ (+ Vef EDonor) (- mu Ec))
                         (*
                          (/ (+ Vef (+ mu (- EDonor Ec))) KbT)
                          (* (- (- (- Ec EDonor) mu) Vef) -0.5)))
                        KbT)))
                     t_0))))
              double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
              	double t_0 = 0.5 * (NdChar + NaChar);
              	double tmp;
              	if (KbT <= -4.2e+83) {
              		tmp = t_0;
              	} else if (KbT <= 3.7e-61) {
              		tmp = NdChar / (2.0 + ((((Vef + EDonor) + (mu - Ec)) + (((Vef + (mu + (EDonor - Ec))) / KbT) * ((((Ec - EDonor) - mu) - Vef) * -0.5))) / KbT));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                  real(8), intent (in) :: ndchar
                  real(8), intent (in) :: ec
                  real(8), intent (in) :: vef
                  real(8), intent (in) :: edonor
                  real(8), intent (in) :: mu
                  real(8), intent (in) :: kbt
                  real(8), intent (in) :: nachar
                  real(8), intent (in) :: ev
                  real(8), intent (in) :: eaccept
                  real(8) :: t_0
                  real(8) :: tmp
                  t_0 = 0.5d0 * (ndchar + nachar)
                  if (kbt <= (-4.2d+83)) then
                      tmp = t_0
                  else if (kbt <= 3.7d-61) then
                      tmp = ndchar / (2.0d0 + ((((vef + edonor) + (mu - ec)) + (((vef + (mu + (edonor - ec))) / kbt) * ((((ec - edonor) - mu) - vef) * (-0.5d0)))) / 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 tmp;
              	if (KbT <= -4.2e+83) {
              		tmp = t_0;
              	} else if (KbT <= 3.7e-61) {
              		tmp = NdChar / (2.0 + ((((Vef + EDonor) + (mu - Ec)) + (((Vef + (mu + (EDonor - Ec))) / KbT) * ((((Ec - EDonor) - mu) - Vef) * -0.5))) / KbT));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
              	t_0 = 0.5 * (NdChar + NaChar)
              	tmp = 0
              	if KbT <= -4.2e+83:
              		tmp = t_0
              	elif KbT <= 3.7e-61:
              		tmp = NdChar / (2.0 + ((((Vef + EDonor) + (mu - Ec)) + (((Vef + (mu + (EDonor - Ec))) / KbT) * ((((Ec - EDonor) - mu) - Vef) * -0.5))) / 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))
              	tmp = 0.0
              	if (KbT <= -4.2e+83)
              		tmp = t_0;
              	elseif (KbT <= 3.7e-61)
              		tmp = Float64(NdChar / Float64(2.0 + Float64(Float64(Float64(Float64(Vef + EDonor) + Float64(mu - Ec)) + Float64(Float64(Float64(Vef + Float64(mu + Float64(EDonor - Ec))) / KbT) * Float64(Float64(Float64(Float64(Ec - EDonor) - mu) - Vef) * -0.5))) / 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);
              	tmp = 0.0;
              	if (KbT <= -4.2e+83)
              		tmp = t_0;
              	elseif (KbT <= 3.7e-61)
              		tmp = NdChar / (2.0 + ((((Vef + EDonor) + (mu - Ec)) + (((Vef + (mu + (EDonor - Ec))) / KbT) * ((((Ec - EDonor) - mu) - Vef) * -0.5))) / 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]}, If[LessEqual[KbT, -4.2e+83], t$95$0, If[LessEqual[KbT, 3.7e-61], N[(NdChar / N[(2.0 + N[(N[(N[(N[(Vef + EDonor), $MachinePrecision] + N[(mu - Ec), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(Vef + N[(mu + N[(EDonor - Ec), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision] * N[(N[(N[(N[(Ec - EDonor), $MachinePrecision] - mu), $MachinePrecision] - Vef), $MachinePrecision] * -0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
              \mathbf{if}\;KbT \leq -4.2 \cdot 10^{+83}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;KbT \leq 3.7 \cdot 10^{-61}:\\
              \;\;\;\;\frac{NdChar}{2 + \frac{\left(\left(Vef + EDonor\right) + \left(mu - Ec\right)\right) + \frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT} \cdot \left(\left(\left(\left(Ec - EDonor\right) - mu\right) - Vef\right) \cdot -0.5\right)}{KbT}}\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if KbT < -4.20000000000000005e83 or 3.7e-61 < 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. Simplified99.9%

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
                  3. +-lowering-+.f6451.1%

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
                6. Simplified51.1%

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

                if -4.20000000000000005e83 < KbT < 3.7e-61

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

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

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

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

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

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
                  5. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(EDonor + \left(Vef + mu\right)\right), Ec\right), KbT\right)\right)\right)\right) \]
                  6. associate-+r+N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\left(EDonor + Vef\right) + mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                  7. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(EDonor + Vef\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                  8. +-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(Vef + EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                  9. +-lowering-+.f6464.5%

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                6. Simplified64.5%

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

                  \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{\left(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}\right)}\right) \]
                8. Step-by-step derivation
                  1. mul-1-negN/A

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

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \left(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}}\right)\right) \]
                  3. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \color{blue}{\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)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(-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}\right), \color{blue}{KbT}\right)\right)\right) \]
                9. Simplified28.2%

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

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\frac{\left(\frac{-1}{2} \cdot \left(\left(Vef + EDonor\right) + \left(mu - Ec\right)\right)\right) \cdot \left(\left(Vef + EDonor\right) + \left(mu - Ec\right)\right)}{KbT}\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right) \]
                  2. associate-/l*N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\left(\frac{-1}{2} \cdot \left(\left(Vef + EDonor\right) + \left(mu - Ec\right)\right)\right) \cdot \frac{\left(Vef + EDonor\right) + \left(mu - Ec\right)}{KbT}\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right) \]
                  3. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(\frac{-1}{2} \cdot \left(\left(Vef + EDonor\right) + \left(mu - Ec\right)\right)\right), \left(\frac{\left(Vef + EDonor\right) + \left(mu - Ec\right)}{KbT}\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right) \]
                  4. *-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\left(\left(\left(Vef + EDonor\right) + \left(mu - Ec\right)\right) \cdot \frac{-1}{2}\right), \left(\frac{\left(Vef + EDonor\right) + \left(mu - Ec\right)}{KbT}\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(Vef + EDonor\right) + \left(mu - Ec\right)\right), \frac{-1}{2}\right), \left(\frac{\left(Vef + EDonor\right) + \left(mu - Ec\right)}{KbT}\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right) \]
                  6. associate-+r-N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(\left(Vef + EDonor\right) + mu\right) - Ec\right), \frac{-1}{2}\right), \left(\frac{\left(Vef + EDonor\right) + \left(mu - Ec\right)}{KbT}\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right) \]
                  7. associate-+l+N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(Vef + \left(EDonor + mu\right)\right) - Ec\right), \frac{-1}{2}\right), \left(\frac{\left(Vef + EDonor\right) + \left(mu - Ec\right)}{KbT}\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right) \]
                  8. +-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(\left(Vef + \left(mu + EDonor\right)\right) - Ec\right), \frac{-1}{2}\right), \left(\frac{\left(Vef + EDonor\right) + \left(mu - Ec\right)}{KbT}\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right) \]
                  9. associate-+r-N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(Vef + \left(\left(mu + EDonor\right) - Ec\right)\right), \frac{-1}{2}\right), \left(\frac{\left(Vef + EDonor\right) + \left(mu - Ec\right)}{KbT}\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right) \]
                  10. associate-+r-N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\left(Vef + \left(mu + \left(EDonor - Ec\right)\right)\right), \frac{-1}{2}\right), \left(\frac{\left(Vef + EDonor\right) + \left(mu - Ec\right)}{KbT}\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right) \]
                  11. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(Vef, \left(mu + \left(EDonor - Ec\right)\right)\right), \frac{-1}{2}\right), \left(\frac{\left(Vef + EDonor\right) + \left(mu - Ec\right)}{KbT}\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right) \]
                  12. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(mu, \left(EDonor - Ec\right)\right)\right), \frac{-1}{2}\right), \left(\frac{\left(Vef + EDonor\right) + \left(mu - Ec\right)}{KbT}\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right) \]
                  13. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(mu, \mathsf{\_.f64}\left(EDonor, Ec\right)\right)\right), \frac{-1}{2}\right), \left(\frac{\left(Vef + EDonor\right) + \left(mu - Ec\right)}{KbT}\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right) \]
                  14. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{+.f64}\left(mu, \mathsf{\_.f64}\left(EDonor, Ec\right)\right)\right), \frac{-1}{2}\right), \mathsf{/.f64}\left(\left(\left(Vef + EDonor\right) + \left(mu - Ec\right)\right), KbT\right)\right), \mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), \mathsf{\_.f64}\left(mu, Ec\right)\right)\right), KbT\right)\right)\right) \]
                11. Applied egg-rr28.2%

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

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

              Alternative 13: 32.5% accurate, 7.6× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -1.75 \cdot 10^{+79}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 2.4 \cdot 10^{-197}:\\ \;\;\;\;\frac{NdChar}{2 + \frac{\left(Vef + mu\right) + \left(EDonor - Ec\right)}{KbT}}\\ \mathbf{elif}\;KbT \leq 8.5 \cdot 10^{-17}:\\ \;\;\;\;\frac{NaChar}{2 - \frac{\frac{EAccept \cdot EAccept}{KbT} \cdot -0.5 - EAccept}{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))))
                 (if (<= KbT -1.75e+79)
                   t_0
                   (if (<= KbT 2.4e-197)
                     (/ NdChar (+ 2.0 (/ (+ (+ Vef mu) (- EDonor Ec)) KbT)))
                     (if (<= KbT 8.5e-17)
                       (/
                        NaChar
                        (- 2.0 (/ (- (* (/ (* EAccept EAccept) KbT) -0.5) EAccept) KbT)))
                       t_0)))))
              double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
              	double t_0 = 0.5 * (NdChar + NaChar);
              	double tmp;
              	if (KbT <= -1.75e+79) {
              		tmp = t_0;
              	} else if (KbT <= 2.4e-197) {
              		tmp = NdChar / (2.0 + (((Vef + mu) + (EDonor - Ec)) / KbT));
              	} else if (KbT <= 8.5e-17) {
              		tmp = NaChar / (2.0 - (((((EAccept * EAccept) / KbT) * -0.5) - EAccept) / KbT));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                  real(8), intent (in) :: ndchar
                  real(8), intent (in) :: ec
                  real(8), intent (in) :: vef
                  real(8), intent (in) :: edonor
                  real(8), intent (in) :: mu
                  real(8), intent (in) :: kbt
                  real(8), intent (in) :: nachar
                  real(8), intent (in) :: ev
                  real(8), intent (in) :: eaccept
                  real(8) :: t_0
                  real(8) :: tmp
                  t_0 = 0.5d0 * (ndchar + nachar)
                  if (kbt <= (-1.75d+79)) then
                      tmp = t_0
                  else if (kbt <= 2.4d-197) then
                      tmp = ndchar / (2.0d0 + (((vef + mu) + (edonor - ec)) / kbt))
                  else if (kbt <= 8.5d-17) then
                      tmp = nachar / (2.0d0 - (((((eaccept * eaccept) / kbt) * (-0.5d0)) - eaccept) / 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 tmp;
              	if (KbT <= -1.75e+79) {
              		tmp = t_0;
              	} else if (KbT <= 2.4e-197) {
              		tmp = NdChar / (2.0 + (((Vef + mu) + (EDonor - Ec)) / KbT));
              	} else if (KbT <= 8.5e-17) {
              		tmp = NaChar / (2.0 - (((((EAccept * EAccept) / KbT) * -0.5) - EAccept) / KbT));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
              	t_0 = 0.5 * (NdChar + NaChar)
              	tmp = 0
              	if KbT <= -1.75e+79:
              		tmp = t_0
              	elif KbT <= 2.4e-197:
              		tmp = NdChar / (2.0 + (((Vef + mu) + (EDonor - Ec)) / KbT))
              	elif KbT <= 8.5e-17:
              		tmp = NaChar / (2.0 - (((((EAccept * EAccept) / KbT) * -0.5) - EAccept) / 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))
              	tmp = 0.0
              	if (KbT <= -1.75e+79)
              		tmp = t_0;
              	elseif (KbT <= 2.4e-197)
              		tmp = Float64(NdChar / Float64(2.0 + Float64(Float64(Float64(Vef + mu) + Float64(EDonor - Ec)) / KbT)));
              	elseif (KbT <= 8.5e-17)
              		tmp = Float64(NaChar / Float64(2.0 - Float64(Float64(Float64(Float64(Float64(EAccept * EAccept) / KbT) * -0.5) - EAccept) / 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);
              	tmp = 0.0;
              	if (KbT <= -1.75e+79)
              		tmp = t_0;
              	elseif (KbT <= 2.4e-197)
              		tmp = NdChar / (2.0 + (((Vef + mu) + (EDonor - Ec)) / KbT));
              	elseif (KbT <= 8.5e-17)
              		tmp = NaChar / (2.0 - (((((EAccept * EAccept) / KbT) * -0.5) - EAccept) / 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]}, If[LessEqual[KbT, -1.75e+79], t$95$0, If[LessEqual[KbT, 2.4e-197], N[(NdChar / N[(2.0 + N[(N[(N[(Vef + mu), $MachinePrecision] + N[(EDonor - Ec), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 8.5e-17], N[(NaChar / N[(2.0 - N[(N[(N[(N[(N[(EAccept * EAccept), $MachinePrecision] / KbT), $MachinePrecision] * -0.5), $MachinePrecision] - EAccept), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
              \mathbf{if}\;KbT \leq -1.75 \cdot 10^{+79}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;KbT \leq 2.4 \cdot 10^{-197}:\\
              \;\;\;\;\frac{NdChar}{2 + \frac{\left(Vef + mu\right) + \left(EDonor - Ec\right)}{KbT}}\\
              
              \mathbf{elif}\;KbT \leq 8.5 \cdot 10^{-17}:\\
              \;\;\;\;\frac{NaChar}{2 - \frac{\frac{EAccept \cdot EAccept}{KbT} \cdot -0.5 - EAccept}{KbT}}\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if KbT < -1.7499999999999999e79 or 8.5e-17 < 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. Simplified99.9%

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
                  3. +-lowering-+.f6454.0%

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
                6. Simplified54.0%

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

                if -1.7499999999999999e79 < KbT < 2.4000000000000001e-197

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

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

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

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

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

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
                  5. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(EDonor + \left(Vef + mu\right)\right), Ec\right), KbT\right)\right)\right)\right) \]
                  6. associate-+r+N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\left(EDonor + Vef\right) + mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                  7. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(EDonor + Vef\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                  8. +-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(Vef + EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                  9. +-lowering-+.f6462.7%

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                6. Simplified62.7%

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

                  \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{\left(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}\right)}\right) \]
                8. Step-by-step derivation
                  1. mul-1-negN/A

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

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \left(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}}\right)\right) \]
                  3. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \color{blue}{\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)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(-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}\right), \color{blue}{KbT}\right)\right)\right) \]
                9. Simplified26.3%

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

                  \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \color{blue}{\left(\frac{Ec - \left(EDonor + \left(Vef + mu\right)\right)}{KbT}\right)}\right)\right) \]
                11. Step-by-step derivation
                  1. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(Ec - \left(EDonor + \left(Vef + mu\right)\right)\right), \color{blue}{KbT}\right)\right)\right) \]
                  2. associate--r+N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(\left(Ec - EDonor\right) - \left(Vef + mu\right)\right), KbT\right)\right)\right) \]
                  3. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(Ec - EDonor\right), \left(Vef + mu\right)\right), KbT\right)\right)\right) \]
                  4. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{\_.f64}\left(Ec, EDonor\right), \left(Vef + mu\right)\right), KbT\right)\right)\right) \]
                  5. +-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{\_.f64}\left(Ec, EDonor\right), \left(mu + Vef\right)\right), KbT\right)\right)\right) \]
                  6. +-lowering-+.f6423.1%

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{\_.f64}\left(Ec, EDonor\right), \mathsf{+.f64}\left(mu, Vef\right)\right), KbT\right)\right)\right) \]
                12. Simplified23.1%

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

                if 2.4000000000000001e-197 < KbT < 8.5e-17

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

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

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

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

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

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
                  5. associate--l+N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
                  6. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
                  7. sub-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                  8. associate-+r+N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                  9. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                  10. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                  11. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                  12. sub-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef - mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                  13. --lowering--.f6463.6%

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \mathsf{\_.f64}\left(Vef, mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                6. Simplified63.6%

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

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EAccept}{KbT}\right)}\right)\right)\right) \]
                8. Step-by-step derivation
                  1. /-lowering-/.f6444.5%

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right)\right)\right)\right) \]
                9. Simplified44.5%

                  \[\leadsto \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
                10. Taylor expanded in KbT around -inf

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \color{blue}{\left(2 + -1 \cdot \frac{-1 \cdot EAccept + \frac{-1}{2} \cdot \frac{{EAccept}^{2}}{KbT}}{KbT}\right)}\right) \]
                11. Step-by-step derivation
                  1. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \left(2 + \left(\mathsf{neg}\left(\frac{-1 \cdot EAccept + \frac{-1}{2} \cdot \frac{{EAccept}^{2}}{KbT}}{KbT}\right)\right)\right)\right) \]
                  2. unsub-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \left(2 - \color{blue}{\frac{-1 \cdot EAccept + \frac{-1}{2} \cdot \frac{{EAccept}^{2}}{KbT}}{KbT}}\right)\right) \]
                  3. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \color{blue}{\left(\frac{-1 \cdot EAccept + \frac{-1}{2} \cdot \frac{{EAccept}^{2}}{KbT}}{KbT}\right)}\right)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(-1 \cdot EAccept + \frac{-1}{2} \cdot \frac{{EAccept}^{2}}{KbT}\right), \color{blue}{KbT}\right)\right)\right) \]
                  5. +-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot \frac{{EAccept}^{2}}{KbT} + -1 \cdot EAccept\right), KbT\right)\right)\right) \]
                  6. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot \frac{{EAccept}^{2}}{KbT} + \left(\mathsf{neg}\left(EAccept\right)\right)\right), KbT\right)\right)\right) \]
                  7. unsub-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(\frac{-1}{2} \cdot \frac{{EAccept}^{2}}{KbT} - EAccept\right), KbT\right)\right)\right) \]
                  8. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\frac{-1}{2} \cdot \frac{{EAccept}^{2}}{KbT}\right), EAccept\right), KbT\right)\right)\right) \]
                  9. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(\frac{{EAccept}^{2}}{KbT}\right)\right), EAccept\right), KbT\right)\right)\right) \]
                  10. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\left({EAccept}^{2}\right), KbT\right)\right), EAccept\right), KbT\right)\right)\right) \]
                  11. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\left(EAccept \cdot EAccept\right), KbT\right)\right), EAccept\right), KbT\right)\right)\right) \]
                  12. *-lowering-*.f6419.0%

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(EAccept, EAccept\right), KbT\right)\right), EAccept\right), KbT\right)\right)\right) \]
                12. Simplified19.0%

                  \[\leadsto \frac{NaChar}{\color{blue}{2 - \frac{-0.5 \cdot \frac{EAccept \cdot EAccept}{KbT} - EAccept}{KbT}}} \]
              3. Recombined 3 regimes into one program.
              4. Final simplification36.7%

                \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -1.75 \cdot 10^{+79}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq 2.4 \cdot 10^{-197}:\\ \;\;\;\;\frac{NdChar}{2 + \frac{\left(Vef + mu\right) + \left(EDonor - Ec\right)}{KbT}}\\ \mathbf{elif}\;KbT \leq 8.5 \cdot 10^{-17}:\\ \;\;\;\;\frac{NaChar}{2 - \frac{\frac{EAccept \cdot EAccept}{KbT} \cdot -0.5 - EAccept}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
              5. Add Preprocessing

              Alternative 14: 33.5% accurate, 8.5× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -8000000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 8.2 \cdot 10^{-19}:\\ \;\;\;\;\frac{NaChar}{2 + EAccept \cdot \left(\frac{1}{KbT} + 0.5 \cdot \frac{EAccept}{KbT \cdot KbT}\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
              (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
               :precision binary64
               (let* ((t_0 (* 0.5 (+ NdChar NaChar))))
                 (if (<= KbT -8000000000.0)
                   t_0
                   (if (<= KbT 8.2e-19)
                     (/
                      NaChar
                      (+ 2.0 (* EAccept (+ (/ 1.0 KbT) (* 0.5 (/ EAccept (* KbT KbT)))))))
                     t_0))))
              double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
              	double t_0 = 0.5 * (NdChar + NaChar);
              	double tmp;
              	if (KbT <= -8000000000.0) {
              		tmp = t_0;
              	} else if (KbT <= 8.2e-19) {
              		tmp = NaChar / (2.0 + (EAccept * ((1.0 / KbT) + (0.5 * (EAccept / (KbT * KbT))))));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                  real(8), intent (in) :: ndchar
                  real(8), intent (in) :: ec
                  real(8), intent (in) :: vef
                  real(8), intent (in) :: edonor
                  real(8), intent (in) :: mu
                  real(8), intent (in) :: kbt
                  real(8), intent (in) :: nachar
                  real(8), intent (in) :: ev
                  real(8), intent (in) :: eaccept
                  real(8) :: t_0
                  real(8) :: tmp
                  t_0 = 0.5d0 * (ndchar + nachar)
                  if (kbt <= (-8000000000.0d0)) then
                      tmp = t_0
                  else if (kbt <= 8.2d-19) then
                      tmp = nachar / (2.0d0 + (eaccept * ((1.0d0 / kbt) + (0.5d0 * (eaccept / (kbt * 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 tmp;
              	if (KbT <= -8000000000.0) {
              		tmp = t_0;
              	} else if (KbT <= 8.2e-19) {
              		tmp = NaChar / (2.0 + (EAccept * ((1.0 / KbT) + (0.5 * (EAccept / (KbT * KbT))))));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
              	t_0 = 0.5 * (NdChar + NaChar)
              	tmp = 0
              	if KbT <= -8000000000.0:
              		tmp = t_0
              	elif KbT <= 8.2e-19:
              		tmp = NaChar / (2.0 + (EAccept * ((1.0 / KbT) + (0.5 * (EAccept / (KbT * 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))
              	tmp = 0.0
              	if (KbT <= -8000000000.0)
              		tmp = t_0;
              	elseif (KbT <= 8.2e-19)
              		tmp = Float64(NaChar / Float64(2.0 + Float64(EAccept * Float64(Float64(1.0 / KbT) + Float64(0.5 * Float64(EAccept / Float64(KbT * 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);
              	tmp = 0.0;
              	if (KbT <= -8000000000.0)
              		tmp = t_0;
              	elseif (KbT <= 8.2e-19)
              		tmp = NaChar / (2.0 + (EAccept * ((1.0 / KbT) + (0.5 * (EAccept / (KbT * 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]}, If[LessEqual[KbT, -8000000000.0], t$95$0, If[LessEqual[KbT, 8.2e-19], N[(NaChar / N[(2.0 + N[(EAccept * N[(N[(1.0 / KbT), $MachinePrecision] + N[(0.5 * N[(EAccept / N[(KbT * KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
              \mathbf{if}\;KbT \leq -8000000000:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;KbT \leq 8.2 \cdot 10^{-19}:\\
              \;\;\;\;\frac{NaChar}{2 + EAccept \cdot \left(\frac{1}{KbT} + 0.5 \cdot \frac{EAccept}{KbT \cdot KbT}\right)}\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if KbT < -8e9 or 8.1999999999999997e-19 < 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. Simplified99.9%

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
                  3. +-lowering-+.f6450.8%

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
                6. Simplified50.8%

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

                if -8e9 < KbT < 8.1999999999999997e-19

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

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

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

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

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

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
                  5. associate--l+N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
                  6. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
                  7. sub-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                  8. associate-+r+N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                  9. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                  10. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                  11. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                  12. sub-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef - mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                  13. --lowering--.f6463.1%

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \mathsf{\_.f64}\left(Vef, mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                6. Simplified63.1%

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

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EAccept}{KbT}\right)}\right)\right)\right) \]
                8. Step-by-step derivation
                  1. /-lowering-/.f6438.2%

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right)\right)\right)\right) \]
                9. Simplified38.2%

                  \[\leadsto \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
                10. Taylor expanded in EAccept around 0

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \color{blue}{\left(2 + EAccept \cdot \left(\frac{1}{2} \cdot \frac{EAccept}{{KbT}^{2}} + \frac{1}{KbT}\right)\right)}\right) \]
                11. Step-by-step derivation
                  1. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \color{blue}{\left(EAccept \cdot \left(\frac{1}{2} \cdot \frac{EAccept}{{KbT}^{2}} + \frac{1}{KbT}\right)\right)}\right)\right) \]
                  2. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(EAccept, \color{blue}{\left(\frac{1}{2} \cdot \frac{EAccept}{{KbT}^{2}} + \frac{1}{KbT}\right)}\right)\right)\right) \]
                  3. +-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(EAccept, \left(\frac{1}{KbT} + \color{blue}{\frac{1}{2} \cdot \frac{EAccept}{{KbT}^{2}}}\right)\right)\right)\right) \]
                  4. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(EAccept, \mathsf{+.f64}\left(\left(\frac{1}{KbT}\right), \color{blue}{\left(\frac{1}{2} \cdot \frac{EAccept}{{KbT}^{2}}\right)}\right)\right)\right)\right) \]
                  5. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(EAccept, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, KbT\right), \left(\color{blue}{\frac{1}{2}} \cdot \frac{EAccept}{{KbT}^{2}}\right)\right)\right)\right)\right) \]
                  6. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(EAccept, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, KbT\right), \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(\frac{EAccept}{{KbT}^{2}}\right)}\right)\right)\right)\right)\right) \]
                  7. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(EAccept, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, KbT\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(EAccept, \color{blue}{\left({KbT}^{2}\right)}\right)\right)\right)\right)\right)\right) \]
                  8. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(EAccept, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, KbT\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(EAccept, \left(KbT \cdot \color{blue}{KbT}\right)\right)\right)\right)\right)\right)\right) \]
                  9. *-lowering-*.f6422.1%

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(EAccept, \mathsf{+.f64}\left(\mathsf{/.f64}\left(1, KbT\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(EAccept, \mathsf{*.f64}\left(KbT, \color{blue}{KbT}\right)\right)\right)\right)\right)\right)\right) \]
                12. Simplified22.1%

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -8000000000:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq 8.2 \cdot 10^{-19}:\\ \;\;\;\;\frac{NaChar}{2 + EAccept \cdot \left(\frac{1}{KbT} + 0.5 \cdot \frac{EAccept}{KbT \cdot KbT}\right)}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
              5. Add Preprocessing

              Alternative 15: 32.0% accurate, 9.9× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -2.25 \cdot 10^{+79}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 2.6 \cdot 10^{-195}:\\ \;\;\;\;\frac{NdChar}{2 + \frac{\left(Vef + mu\right) + \left(EDonor - Ec\right)}{KbT}}\\ \mathbf{elif}\;KbT \leq 6.5 \cdot 10^{-20}:\\ \;\;\;\;\frac{NaChar}{2 + \frac{EAccept}{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))))
                 (if (<= KbT -2.25e+79)
                   t_0
                   (if (<= KbT 2.6e-195)
                     (/ NdChar (+ 2.0 (/ (+ (+ Vef mu) (- EDonor Ec)) KbT)))
                     (if (<= KbT 6.5e-20) (/ NaChar (+ 2.0 (/ EAccept KbT))) t_0)))))
              double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
              	double t_0 = 0.5 * (NdChar + NaChar);
              	double tmp;
              	if (KbT <= -2.25e+79) {
              		tmp = t_0;
              	} else if (KbT <= 2.6e-195) {
              		tmp = NdChar / (2.0 + (((Vef + mu) + (EDonor - Ec)) / KbT));
              	} else if (KbT <= 6.5e-20) {
              		tmp = NaChar / (2.0 + (EAccept / KbT));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                  real(8), intent (in) :: ndchar
                  real(8), intent (in) :: ec
                  real(8), intent (in) :: vef
                  real(8), intent (in) :: edonor
                  real(8), intent (in) :: mu
                  real(8), intent (in) :: kbt
                  real(8), intent (in) :: nachar
                  real(8), intent (in) :: ev
                  real(8), intent (in) :: eaccept
                  real(8) :: t_0
                  real(8) :: tmp
                  t_0 = 0.5d0 * (ndchar + nachar)
                  if (kbt <= (-2.25d+79)) then
                      tmp = t_0
                  else if (kbt <= 2.6d-195) then
                      tmp = ndchar / (2.0d0 + (((vef + mu) + (edonor - ec)) / kbt))
                  else if (kbt <= 6.5d-20) then
                      tmp = nachar / (2.0d0 + (eaccept / 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 tmp;
              	if (KbT <= -2.25e+79) {
              		tmp = t_0;
              	} else if (KbT <= 2.6e-195) {
              		tmp = NdChar / (2.0 + (((Vef + mu) + (EDonor - Ec)) / KbT));
              	} else if (KbT <= 6.5e-20) {
              		tmp = NaChar / (2.0 + (EAccept / KbT));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
              	t_0 = 0.5 * (NdChar + NaChar)
              	tmp = 0
              	if KbT <= -2.25e+79:
              		tmp = t_0
              	elif KbT <= 2.6e-195:
              		tmp = NdChar / (2.0 + (((Vef + mu) + (EDonor - Ec)) / KbT))
              	elif KbT <= 6.5e-20:
              		tmp = NaChar / (2.0 + (EAccept / 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))
              	tmp = 0.0
              	if (KbT <= -2.25e+79)
              		tmp = t_0;
              	elseif (KbT <= 2.6e-195)
              		tmp = Float64(NdChar / Float64(2.0 + Float64(Float64(Float64(Vef + mu) + Float64(EDonor - Ec)) / KbT)));
              	elseif (KbT <= 6.5e-20)
              		tmp = Float64(NaChar / Float64(2.0 + Float64(EAccept / 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);
              	tmp = 0.0;
              	if (KbT <= -2.25e+79)
              		tmp = t_0;
              	elseif (KbT <= 2.6e-195)
              		tmp = NdChar / (2.0 + (((Vef + mu) + (EDonor - Ec)) / KbT));
              	elseif (KbT <= 6.5e-20)
              		tmp = NaChar / (2.0 + (EAccept / 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]}, If[LessEqual[KbT, -2.25e+79], t$95$0, If[LessEqual[KbT, 2.6e-195], N[(NdChar / N[(2.0 + N[(N[(N[(Vef + mu), $MachinePrecision] + N[(EDonor - Ec), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 6.5e-20], N[(NaChar / N[(2.0 + N[(EAccept / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
              \mathbf{if}\;KbT \leq -2.25 \cdot 10^{+79}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;KbT \leq 2.6 \cdot 10^{-195}:\\
              \;\;\;\;\frac{NdChar}{2 + \frac{\left(Vef + mu\right) + \left(EDonor - Ec\right)}{KbT}}\\
              
              \mathbf{elif}\;KbT \leq 6.5 \cdot 10^{-20}:\\
              \;\;\;\;\frac{NaChar}{2 + \frac{EAccept}{KbT}}\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if KbT < -2.24999999999999997e79 or 6.50000000000000032e-20 < 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. Simplified99.9%

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
                  3. +-lowering-+.f6454.0%

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
                6. Simplified54.0%

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

                if -2.24999999999999997e79 < KbT < 2.6000000000000002e-195

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

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

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

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

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

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
                  5. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(EDonor + \left(Vef + mu\right)\right), Ec\right), KbT\right)\right)\right)\right) \]
                  6. associate-+r+N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\left(EDonor + Vef\right) + mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                  7. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(EDonor + Vef\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                  8. +-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(Vef + EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                  9. +-lowering-+.f6463.1%

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                6. Simplified63.1%

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

                  \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{\left(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}\right)}\right) \]
                8. Step-by-step derivation
                  1. mul-1-negN/A

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

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \left(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}}\right)\right) \]
                  3. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \color{blue}{\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)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(-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}\right), \color{blue}{KbT}\right)\right)\right) \]
                9. Simplified27.1%

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

                  \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \color{blue}{\left(\frac{Ec - \left(EDonor + \left(Vef + mu\right)\right)}{KbT}\right)}\right)\right) \]
                11. Step-by-step derivation
                  1. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(Ec - \left(EDonor + \left(Vef + mu\right)\right)\right), \color{blue}{KbT}\right)\right)\right) \]
                  2. associate--r+N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(\left(Ec - EDonor\right) - \left(Vef + mu\right)\right), KbT\right)\right)\right) \]
                  3. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(Ec - EDonor\right), \left(Vef + mu\right)\right), KbT\right)\right)\right) \]
                  4. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{\_.f64}\left(Ec, EDonor\right), \left(Vef + mu\right)\right), KbT\right)\right)\right) \]
                  5. +-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{\_.f64}\left(Ec, EDonor\right), \left(mu + Vef\right)\right), KbT\right)\right)\right) \]
                  6. +-lowering-+.f6423.9%

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{\_.f64}\left(Ec, EDonor\right), \mathsf{+.f64}\left(mu, Vef\right)\right), KbT\right)\right)\right) \]
                12. Simplified23.9%

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

                if 2.6000000000000002e-195 < KbT < 6.50000000000000032e-20

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

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

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

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

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

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
                  5. associate--l+N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
                  6. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
                  7. sub-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                  8. associate-+r+N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                  9. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                  10. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                  11. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                  12. sub-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef - mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                  13. --lowering--.f6462.6%

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \mathsf{\_.f64}\left(Vef, mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                6. Simplified62.6%

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

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EAccept}{KbT}\right)}\right)\right)\right) \]
                8. Step-by-step derivation
                  1. /-lowering-/.f6443.1%

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right)\right)\right)\right) \]
                9. Simplified43.1%

                  \[\leadsto \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
                10. Taylor expanded in EAccept around 0

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \color{blue}{\left(2 + \frac{EAccept}{KbT}\right)}\right) \]
                11. Step-by-step derivation
                  1. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \color{blue}{\left(\frac{EAccept}{KbT}\right)}\right)\right) \]
                  2. /-lowering-/.f6416.6%

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{/.f64}\left(EAccept, \color{blue}{KbT}\right)\right)\right) \]
                12. Simplified16.6%

                  \[\leadsto \frac{NaChar}{\color{blue}{2 + \frac{EAccept}{KbT}}} \]
              3. Recombined 3 regimes into one program.
              4. Final simplification36.6%

                \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -2.25 \cdot 10^{+79}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq 2.6 \cdot 10^{-195}:\\ \;\;\;\;\frac{NdChar}{2 + \frac{\left(Vef + mu\right) + \left(EDonor - Ec\right)}{KbT}}\\ \mathbf{elif}\;KbT \leq 6.5 \cdot 10^{-20}:\\ \;\;\;\;\frac{NaChar}{2 + \frac{EAccept}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
              5. Add Preprocessing

              Alternative 16: 30.9% accurate, 10.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -4.1 \cdot 10^{-88}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 4.4 \cdot 10^{-192}:\\ \;\;\;\;\frac{NdChar}{\frac{0.5 \cdot \left(EDonor \cdot EDonor\right)}{KbT \cdot KbT}}\\ \mathbf{elif}\;KbT \leq 1.5 \cdot 10^{-18}:\\ \;\;\;\;\frac{NaChar}{2 + \frac{EAccept}{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))))
                 (if (<= KbT -4.1e-88)
                   t_0
                   (if (<= KbT 4.4e-192)
                     (/ NdChar (/ (* 0.5 (* EDonor EDonor)) (* KbT KbT)))
                     (if (<= KbT 1.5e-18) (/ NaChar (+ 2.0 (/ EAccept KbT))) t_0)))))
              double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
              	double t_0 = 0.5 * (NdChar + NaChar);
              	double tmp;
              	if (KbT <= -4.1e-88) {
              		tmp = t_0;
              	} else if (KbT <= 4.4e-192) {
              		tmp = NdChar / ((0.5 * (EDonor * EDonor)) / (KbT * KbT));
              	} else if (KbT <= 1.5e-18) {
              		tmp = NaChar / (2.0 + (EAccept / KbT));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                  real(8), intent (in) :: ndchar
                  real(8), intent (in) :: ec
                  real(8), intent (in) :: vef
                  real(8), intent (in) :: edonor
                  real(8), intent (in) :: mu
                  real(8), intent (in) :: kbt
                  real(8), intent (in) :: nachar
                  real(8), intent (in) :: ev
                  real(8), intent (in) :: eaccept
                  real(8) :: t_0
                  real(8) :: tmp
                  t_0 = 0.5d0 * (ndchar + nachar)
                  if (kbt <= (-4.1d-88)) then
                      tmp = t_0
                  else if (kbt <= 4.4d-192) then
                      tmp = ndchar / ((0.5d0 * (edonor * edonor)) / (kbt * kbt))
                  else if (kbt <= 1.5d-18) then
                      tmp = nachar / (2.0d0 + (eaccept / 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 tmp;
              	if (KbT <= -4.1e-88) {
              		tmp = t_0;
              	} else if (KbT <= 4.4e-192) {
              		tmp = NdChar / ((0.5 * (EDonor * EDonor)) / (KbT * KbT));
              	} else if (KbT <= 1.5e-18) {
              		tmp = NaChar / (2.0 + (EAccept / KbT));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
              	t_0 = 0.5 * (NdChar + NaChar)
              	tmp = 0
              	if KbT <= -4.1e-88:
              		tmp = t_0
              	elif KbT <= 4.4e-192:
              		tmp = NdChar / ((0.5 * (EDonor * EDonor)) / (KbT * KbT))
              	elif KbT <= 1.5e-18:
              		tmp = NaChar / (2.0 + (EAccept / 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))
              	tmp = 0.0
              	if (KbT <= -4.1e-88)
              		tmp = t_0;
              	elseif (KbT <= 4.4e-192)
              		tmp = Float64(NdChar / Float64(Float64(0.5 * Float64(EDonor * EDonor)) / Float64(KbT * KbT)));
              	elseif (KbT <= 1.5e-18)
              		tmp = Float64(NaChar / Float64(2.0 + Float64(EAccept / 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);
              	tmp = 0.0;
              	if (KbT <= -4.1e-88)
              		tmp = t_0;
              	elseif (KbT <= 4.4e-192)
              		tmp = NdChar / ((0.5 * (EDonor * EDonor)) / (KbT * KbT));
              	elseif (KbT <= 1.5e-18)
              		tmp = NaChar / (2.0 + (EAccept / 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]}, If[LessEqual[KbT, -4.1e-88], t$95$0, If[LessEqual[KbT, 4.4e-192], N[(NdChar / N[(N[(0.5 * N[(EDonor * EDonor), $MachinePrecision]), $MachinePrecision] / N[(KbT * KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 1.5e-18], N[(NaChar / N[(2.0 + N[(EAccept / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
              \mathbf{if}\;KbT \leq -4.1 \cdot 10^{-88}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;KbT \leq 4.4 \cdot 10^{-192}:\\
              \;\;\;\;\frac{NdChar}{\frac{0.5 \cdot \left(EDonor \cdot EDonor\right)}{KbT \cdot KbT}}\\
              
              \mathbf{elif}\;KbT \leq 1.5 \cdot 10^{-18}:\\
              \;\;\;\;\frac{NaChar}{2 + \frac{EAccept}{KbT}}\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 3 regimes
              2. if KbT < -4.1000000000000001e-88 or 1.49999999999999991e-18 < 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. Simplified99.9%

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
                  3. +-lowering-+.f6445.4%

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
                6. Simplified45.4%

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

                if -4.1000000000000001e-88 < KbT < 4.40000000000000011e-192

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

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

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

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

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

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
                  5. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(EDonor + \left(Vef + mu\right)\right), Ec\right), KbT\right)\right)\right)\right) \]
                  6. associate-+r+N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\left(EDonor + Vef\right) + mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                  7. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(EDonor + Vef\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                  8. +-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(Vef + EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                  9. +-lowering-+.f6465.4%

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                6. Simplified65.4%

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

                  \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{\left(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}\right)}\right) \]
                8. Step-by-step derivation
                  1. mul-1-negN/A

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

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \left(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}}\right)\right) \]
                  3. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \color{blue}{\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)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(-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}\right), \color{blue}{KbT}\right)\right)\right) \]
                9. Simplified29.5%

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

                  \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{\left(\frac{1}{2} \cdot \frac{{EDonor}^{2}}{{KbT}^{2}}\right)}\right) \]
                11. Step-by-step derivation
                  1. associate-*r/N/A

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

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

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left({EDonor}^{2}\right)\right), \left({\color{blue}{KbT}}^{2}\right)\right)\right) \]
                  4. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(EDonor \cdot EDonor\right)\right), \left({KbT}^{2}\right)\right)\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(EDonor, EDonor\right)\right), \left({KbT}^{2}\right)\right)\right) \]
                  6. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(EDonor, EDonor\right)\right), \left(KbT \cdot \color{blue}{KbT}\right)\right)\right) \]
                  7. *-lowering-*.f6420.1%

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(EDonor, EDonor\right)\right), \mathsf{*.f64}\left(KbT, \color{blue}{KbT}\right)\right)\right) \]
                12. Simplified20.1%

                  \[\leadsto \frac{NdChar}{\color{blue}{\frac{0.5 \cdot \left(EDonor \cdot EDonor\right)}{KbT \cdot KbT}}} \]

                if 4.40000000000000011e-192 < KbT < 1.49999999999999991e-18

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

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

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

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

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

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
                  5. associate--l+N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
                  6. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
                  7. sub-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                  8. associate-+r+N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                  9. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                  10. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                  11. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                  12. sub-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef - mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                  13. --lowering--.f6462.6%

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \mathsf{\_.f64}\left(Vef, mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                6. Simplified62.6%

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

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(\frac{EAccept}{KbT}\right)}\right)\right)\right) \]
                8. Step-by-step derivation
                  1. /-lowering-/.f6443.1%

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EAccept, KbT\right)\right)\right)\right) \]
                9. Simplified43.1%

                  \[\leadsto \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
                10. Taylor expanded in EAccept around 0

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \color{blue}{\left(2 + \frac{EAccept}{KbT}\right)}\right) \]
                11. Step-by-step derivation
                  1. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \color{blue}{\left(\frac{EAccept}{KbT}\right)}\right)\right) \]
                  2. /-lowering-/.f6416.6%

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{/.f64}\left(EAccept, \color{blue}{KbT}\right)\right)\right) \]
                12. Simplified16.6%

                  \[\leadsto \frac{NaChar}{\color{blue}{2 + \frac{EAccept}{KbT}}} \]
              3. Recombined 3 regimes into one program.
              4. Final simplification34.3%

                \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -4.1 \cdot 10^{-88}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq 4.4 \cdot 10^{-192}:\\ \;\;\;\;\frac{NdChar}{\frac{0.5 \cdot \left(EDonor \cdot EDonor\right)}{KbT \cdot KbT}}\\ \mathbf{elif}\;KbT \leq 1.5 \cdot 10^{-18}:\\ \;\;\;\;\frac{NaChar}{2 + \frac{EAccept}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
              5. Add Preprocessing

              Alternative 17: 31.6% accurate, 10.9× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -8.2 \cdot 10^{-17}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 7.5 \cdot 10^{-124}:\\ \;\;\;\;\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))))
                 (if (<= KbT -8.2e-17)
                   t_0
                   (if (<= KbT 7.5e-124)
                     (/ (* 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 tmp;
              	if (KbT <= -8.2e-17) {
              		tmp = t_0;
              	} else if (KbT <= 7.5e-124) {
              		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) :: tmp
                  t_0 = 0.5d0 * (ndchar + nachar)
                  if (kbt <= (-8.2d-17)) then
                      tmp = t_0
                  else if (kbt <= 7.5d-124) 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 tmp;
              	if (KbT <= -8.2e-17) {
              		tmp = t_0;
              	} else if (KbT <= 7.5e-124) {
              		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)
              	tmp = 0
              	if KbT <= -8.2e-17:
              		tmp = t_0
              	elif KbT <= 7.5e-124:
              		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))
              	tmp = 0.0
              	if (KbT <= -8.2e-17)
              		tmp = t_0;
              	elseif (KbT <= 7.5e-124)
              		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);
              	tmp = 0.0;
              	if (KbT <= -8.2e-17)
              		tmp = t_0;
              	elseif (KbT <= 7.5e-124)
              		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]}, If[LessEqual[KbT, -8.2e-17], t$95$0, If[LessEqual[KbT, 7.5e-124], 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)\\
              \mathbf{if}\;KbT \leq -8.2 \cdot 10^{-17}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;KbT \leq 7.5 \cdot 10^{-124}:\\
              \;\;\;\;\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 KbT < -8.2000000000000001e-17 or 7.4999999999999996e-124 < 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. Simplified99.9%

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
                  3. +-lowering-+.f6444.9%

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
                6. Simplified44.9%

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

                if -8.2000000000000001e-17 < KbT < 7.4999999999999996e-124

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

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

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

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

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

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
                  5. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(EDonor + \left(Vef + mu\right)\right), Ec\right), KbT\right)\right)\right)\right) \]
                  6. associate-+r+N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\left(EDonor + Vef\right) + mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                  7. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(EDonor + Vef\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                  8. +-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(Vef + EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                  9. +-lowering-+.f6465.6%

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                6. Simplified65.6%

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

                  \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{\left(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}\right)}\right) \]
                8. Step-by-step derivation
                  1. mul-1-negN/A

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

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \left(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}}\right)\right) \]
                  3. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \color{blue}{\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)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(-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}\right), \color{blue}{KbT}\right)\right)\right) \]
                9. Simplified27.3%

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

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

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

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

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

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \left(NdChar \cdot {KbT}^{2}\right)\right), \left({Vef}^{2}\right)\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(NdChar, \left({KbT}^{2}\right)\right)\right), \left({Vef}^{2}\right)\right) \]
                  6. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(NdChar, \left(KbT \cdot KbT\right)\right)\right), \left({Vef}^{2}\right)\right) \]
                  7. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(NdChar, \mathsf{*.f64}\left(KbT, KbT\right)\right)\right), \left({Vef}^{2}\right)\right) \]
                  8. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(NdChar, \mathsf{*.f64}\left(KbT, KbT\right)\right)\right), \left(Vef \cdot \color{blue}{Vef}\right)\right) \]
                  9. *-lowering-*.f6422.0%

                    \[\leadsto \mathsf{/.f64}\left(\mathsf{*.f64}\left(2, \mathsf{*.f64}\left(NdChar, \mathsf{*.f64}\left(KbT, KbT\right)\right)\right), \mathsf{*.f64}\left(Vef, \color{blue}{Vef}\right)\right) \]
                12. Simplified22.0%

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -8.2 \cdot 10^{-17}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq 7.5 \cdot 10^{-124}:\\ \;\;\;\;\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 18: 31.1% accurate, 10.9× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -1.3 \cdot 10^{-89}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 5 \cdot 10^{-128}:\\ \;\;\;\;\frac{NdChar}{\frac{0.5 \cdot \left(Ec \cdot Ec\right)}{KbT \cdot 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))))
                 (if (<= KbT -1.3e-89)
                   t_0
                   (if (<= KbT 5e-128) (/ NdChar (/ (* 0.5 (* Ec Ec)) (* KbT KbT))) t_0))))
              double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
              	double t_0 = 0.5 * (NdChar + NaChar);
              	double tmp;
              	if (KbT <= -1.3e-89) {
              		tmp = t_0;
              	} else if (KbT <= 5e-128) {
              		tmp = NdChar / ((0.5 * (Ec * Ec)) / (KbT * KbT));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                  real(8), intent (in) :: ndchar
                  real(8), intent (in) :: ec
                  real(8), intent (in) :: vef
                  real(8), intent (in) :: edonor
                  real(8), intent (in) :: mu
                  real(8), intent (in) :: kbt
                  real(8), intent (in) :: nachar
                  real(8), intent (in) :: ev
                  real(8), intent (in) :: eaccept
                  real(8) :: t_0
                  real(8) :: tmp
                  t_0 = 0.5d0 * (ndchar + nachar)
                  if (kbt <= (-1.3d-89)) then
                      tmp = t_0
                  else if (kbt <= 5d-128) then
                      tmp = ndchar / ((0.5d0 * (ec * ec)) / (kbt * 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 tmp;
              	if (KbT <= -1.3e-89) {
              		tmp = t_0;
              	} else if (KbT <= 5e-128) {
              		tmp = NdChar / ((0.5 * (Ec * Ec)) / (KbT * KbT));
              	} else {
              		tmp = t_0;
              	}
              	return tmp;
              }
              
              def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
              	t_0 = 0.5 * (NdChar + NaChar)
              	tmp = 0
              	if KbT <= -1.3e-89:
              		tmp = t_0
              	elif KbT <= 5e-128:
              		tmp = NdChar / ((0.5 * (Ec * Ec)) / (KbT * 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))
              	tmp = 0.0
              	if (KbT <= -1.3e-89)
              		tmp = t_0;
              	elseif (KbT <= 5e-128)
              		tmp = Float64(NdChar / Float64(Float64(0.5 * Float64(Ec * Ec)) / Float64(KbT * 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);
              	tmp = 0.0;
              	if (KbT <= -1.3e-89)
              		tmp = t_0;
              	elseif (KbT <= 5e-128)
              		tmp = NdChar / ((0.5 * (Ec * Ec)) / (KbT * 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]}, If[LessEqual[KbT, -1.3e-89], t$95$0, If[LessEqual[KbT, 5e-128], N[(NdChar / N[(N[(0.5 * N[(Ec * Ec), $MachinePrecision]), $MachinePrecision] / N[(KbT * KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
              \mathbf{if}\;KbT \leq -1.3 \cdot 10^{-89}:\\
              \;\;\;\;t\_0\\
              
              \mathbf{elif}\;KbT \leq 5 \cdot 10^{-128}:\\
              \;\;\;\;\frac{NdChar}{\frac{0.5 \cdot \left(Ec \cdot Ec\right)}{KbT \cdot KbT}}\\
              
              \mathbf{else}:\\
              \;\;\;\;t\_0\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if KbT < -1.2999999999999999e-89 or 5.0000000000000001e-128 < 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. Simplified99.9%

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
                  3. +-lowering-+.f6441.1%

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
                6. Simplified41.1%

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

                if -1.2999999999999999e-89 < KbT < 5.0000000000000001e-128

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

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

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

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

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

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EDonor + \left(Vef + mu\right)\right) - Ec}{KbT}\right)\right)\right)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right), KbT\right)\right)\right)\right) \]
                  5. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(EDonor + \left(Vef + mu\right)\right), Ec\right), KbT\right)\right)\right)\right) \]
                  6. associate-+r+N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\left(EDonor + Vef\right) + mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                  7. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(EDonor + Vef\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                  8. +-commutativeN/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\left(Vef + EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                  9. +-lowering-+.f6465.8%

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(Vef, EDonor\right), mu\right), Ec\right), KbT\right)\right)\right)\right) \]
                6. Simplified65.8%

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

                  \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{\left(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}\right)}\right) \]
                8. Step-by-step derivation
                  1. mul-1-negN/A

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

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \left(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}}\right)\right) \]
                  3. --lowering--.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \color{blue}{\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)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(-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}\right), \color{blue}{KbT}\right)\right)\right) \]
                9. Simplified28.3%

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

                  \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{\left(\frac{1}{2} \cdot \frac{{Ec}^{2}}{{KbT}^{2}}\right)}\right) \]
                11. Step-by-step derivation
                  1. associate-*r/N/A

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

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

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left({Ec}^{2}\right)\right), \left({\color{blue}{KbT}}^{2}\right)\right)\right) \]
                  4. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \left(Ec \cdot Ec\right)\right), \left({KbT}^{2}\right)\right)\right) \]
                  5. *-lowering-*.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(Ec, Ec\right)\right), \left({KbT}^{2}\right)\right)\right) \]
                  6. unpow2N/A

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(Ec, Ec\right)\right), \left(KbT \cdot \color{blue}{KbT}\right)\right)\right) \]
                  7. *-lowering-*.f6423.1%

                    \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(Ec, Ec\right)\right), \mathsf{*.f64}\left(KbT, \color{blue}{KbT}\right)\right)\right) \]
                12. Simplified23.1%

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -1.3 \cdot 10^{-89}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq 5 \cdot 10^{-128}:\\ \;\;\;\;\frac{NdChar}{\frac{0.5 \cdot \left(Ec \cdot Ec\right)}{KbT \cdot KbT}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
              5. Add Preprocessing

              Alternative 19: 22.3% accurate, 17.6× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;NdChar \leq -1.12 \cdot 10^{-145}:\\ \;\;\;\;NdChar \cdot 0.5\\ \mathbf{elif}\;NdChar \leq 4.1 \cdot 10^{+113}:\\ \;\;\;\;\frac{NaChar}{2}\\ \mathbf{else}:\\ \;\;\;\;NdChar \cdot 0.5\\ \end{array} \end{array} \]
              (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
               :precision binary64
               (if (<= NdChar -1.12e-145)
                 (* NdChar 0.5)
                 (if (<= NdChar 4.1e+113) (/ NaChar 2.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 tmp;
              	if (NdChar <= -1.12e-145) {
              		tmp = NdChar * 0.5;
              	} else if (NdChar <= 4.1e+113) {
              		tmp = NaChar / 2.0;
              	} else {
              		tmp = NdChar * 0.5;
              	}
              	return tmp;
              }
              
              real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
                  real(8), intent (in) :: ndchar
                  real(8), intent (in) :: ec
                  real(8), intent (in) :: vef
                  real(8), intent (in) :: edonor
                  real(8), intent (in) :: mu
                  real(8), intent (in) :: kbt
                  real(8), intent (in) :: nachar
                  real(8), intent (in) :: ev
                  real(8), intent (in) :: eaccept
                  real(8) :: tmp
                  if (ndchar <= (-1.12d-145)) then
                      tmp = ndchar * 0.5d0
                  else if (ndchar <= 4.1d+113) then
                      tmp = nachar / 2.0d0
                  else
                      tmp = ndchar * 0.5d0
                  end if
                  code = tmp
              end function
              
              public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
              	double tmp;
              	if (NdChar <= -1.12e-145) {
              		tmp = NdChar * 0.5;
              	} else if (NdChar <= 4.1e+113) {
              		tmp = NaChar / 2.0;
              	} else {
              		tmp = NdChar * 0.5;
              	}
              	return tmp;
              }
              
              def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
              	tmp = 0
              	if NdChar <= -1.12e-145:
              		tmp = NdChar * 0.5
              	elif NdChar <= 4.1e+113:
              		tmp = NaChar / 2.0
              	else:
              		tmp = NdChar * 0.5
              	return tmp
              
              function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
              	tmp = 0.0
              	if (NdChar <= -1.12e-145)
              		tmp = Float64(NdChar * 0.5);
              	elseif (NdChar <= 4.1e+113)
              		tmp = Float64(NaChar / 2.0);
              	else
              		tmp = Float64(NdChar * 0.5);
              	end
              	return tmp
              end
              
              function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
              	tmp = 0.0;
              	if (NdChar <= -1.12e-145)
              		tmp = NdChar * 0.5;
              	elseif (NdChar <= 4.1e+113)
              		tmp = NaChar / 2.0;
              	else
              		tmp = NdChar * 0.5;
              	end
              	tmp_2 = tmp;
              end
              
              code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[NdChar, -1.12e-145], N[(NdChar * 0.5), $MachinePrecision], If[LessEqual[NdChar, 4.1e+113], N[(NaChar / 2.0), $MachinePrecision], N[(NdChar * 0.5), $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;NdChar \leq -1.12 \cdot 10^{-145}:\\
              \;\;\;\;NdChar \cdot 0.5\\
              
              \mathbf{elif}\;NdChar \leq 4.1 \cdot 10^{+113}:\\
              \;\;\;\;\frac{NaChar}{2}\\
              
              \mathbf{else}:\\
              \;\;\;\;NdChar \cdot 0.5\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if NdChar < -1.12000000000000001e-145 or 4.09999999999999993e113 < 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. Simplified100.0%

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
                  3. +-lowering-+.f6429.6%

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
                6. Simplified29.6%

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

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

                    \[\leadsto NdChar \cdot \color{blue}{\frac{1}{2}} \]
                  2. *-lowering-*.f6425.8%

                    \[\leadsto \mathsf{*.f64}\left(NdChar, \color{blue}{\frac{1}{2}}\right) \]
                9. Simplified25.8%

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

                if -1.12000000000000001e-145 < NdChar < 4.09999999999999993e113

                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. Simplified99.9%

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

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

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

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

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}\right)\right)\right)\right) \]
                  4. /-lowering-/.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
                  5. associate--l+N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
                  6. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
                  7. sub-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                  8. associate-+r+N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                  9. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                  10. +-lowering-+.f64N/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                  11. mul-1-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
                  12. sub-negN/A

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \left(Vef - mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                  13. --lowering--.f6471.9%

                    \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, \mathsf{\_.f64}\left(Vef, mu\right)\right)\right), KbT\right)\right)\right)\right) \]
                6. Simplified71.9%

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

                  \[\leadsto \mathsf{/.f64}\left(NaChar, \color{blue}{2}\right) \]
                8. Step-by-step derivation
                  1. Simplified30.6%

                    \[\leadsto \frac{NaChar}{\color{blue}{2}} \]
                9. Recombined 2 regimes into one program.
                10. Add Preprocessing

                Alternative 20: 27.8% accurate, 45.8× 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. Simplified100.0%

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
                  3. +-lowering-+.f6431.3%

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
                6. Simplified31.3%

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

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

                Alternative 21: 18.1% accurate, 76.3× speedup?

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

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

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

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

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
                  3. +-lowering-+.f6431.3%

                    \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
                6. Simplified31.3%

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

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

                    \[\leadsto NdChar \cdot \color{blue}{\frac{1}{2}} \]
                  2. *-lowering-*.f6419.4%

                    \[\leadsto \mathsf{*.f64}\left(NdChar, \color{blue}{\frac{1}{2}}\right) \]
                9. Simplified19.4%

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

                Reproduce

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