Bulmash initializePoisson

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

\\
\frac{-1}{-1 - e^{\frac{Vef + \left(\left(mu + EDonor\right) - Ec\right)}{KbT}}} \cdot NdChar + \frac{NaChar}{e^{\frac{Vef - \left(\left(mu - Ev\right) - EAccept\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(\left(\frac{1}{\frac{1 + e^{\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}}}{NdChar}}\right), \mathsf{/.f64}\left(\color{blue}{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. associate-/r/N/A

      \[\leadsto \mathsf{+.f64}\left(\left(\frac{1}{1 + e^{\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}}} \cdot NdChar\right), \mathsf{/.f64}\left(\color{blue}{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. *-lowering-*.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\left(\frac{1}{1 + e^{\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}}}\right), NdChar\right), \mathsf{/.f64}\left(\color{blue}{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. /-lowering-/.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \left(1 + e^{\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}}\right)\right), NdChar\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. +-lowering-+.f64N/A

      \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \left(e^{\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}}\right)\right)\right), NdChar\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(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\left(\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}\right)\right)\right)\right), NdChar\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(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(Vef + \left(mu + \left(EDonor - Ec\right)\right)\right), KbT\right)\right)\right)\right), NdChar\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(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \left(mu + \left(EDonor - Ec\right)\right)\right), KbT\right)\right)\right)\right), NdChar\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(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \left(\left(mu + EDonor\right) - Ec\right)\right), KbT\right)\right)\right)\right), NdChar\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(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(\left(mu + EDonor\right), Ec\right)\right), KbT\right)\right)\right)\right), NdChar\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(\mathsf{/.f64}\left(1, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(mu, EDonor\right), Ec\right)\right), KbT\right)\right)\right)\right), NdChar\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 \color{blue}{\frac{1}{1 + e^{\frac{Vef + \left(\left(mu + EDonor\right) - Ec\right)}{KbT}}} \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}}} \]
  6. Final simplification100.0%

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

Alternative 2: 69.3% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if EAccept < -1.3e-263 or 1.45000000000000001e129 < EAccept

    1. Initial program 100.0%

      \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
    2. 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 EAccept 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{EAccept}{KbT}\right)}\right)\right)\right)\right) \]
    5. Step-by-step derivation
      1. /-lowering-/.f6478.5%

        \[\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(EAccept, KbT\right)\right)\right)\right)\right) \]
    6. Simplified78.5%

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

    if -1.3e-263 < EAccept < 1.45000000000000001e129

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      11. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

Alternative 4: 40.9% accurate, 1.7× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := e^{\frac{Vef}{KbT}} + 1\\ t_1 := \frac{NaChar}{e^{\frac{mu}{0 - KbT}} + 1}\\ \mathbf{if}\;mu \leq -1.15 \cdot 10^{+92}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;mu \leq -1.45 \cdot 10^{-147}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\ \mathbf{elif}\;mu \leq 4.7 \cdot 10^{-279}:\\ \;\;\;\;\frac{NdChar}{t\_0}\\ \mathbf{elif}\;mu \leq 2.6 \cdot 10^{-115}:\\ \;\;\;\;\frac{NaChar}{t\_0}\\ \mathbf{elif}\;mu \leq 2 \cdot 10^{-14}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{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 (+ (exp (/ Vef KbT)) 1.0))
        (t_1 (/ NaChar (+ (exp (/ mu (- 0.0 KbT))) 1.0))))
   (if (<= mu -1.15e+92)
     t_1
     (if (<= mu -1.45e-147)
       (/ NaChar (+ (exp (/ Ev KbT)) 1.0))
       (if (<= mu 4.7e-279)
         (/ NdChar t_0)
         (if (<= mu 2.6e-115)
           (/ NaChar t_0)
           (if (<= mu 2e-14) (/ NdChar (+ (exp (/ EDonor 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 = exp((Vef / KbT)) + 1.0;
	double t_1 = NaChar / (exp((mu / (0.0 - KbT))) + 1.0);
	double tmp;
	if (mu <= -1.15e+92) {
		tmp = t_1;
	} else if (mu <= -1.45e-147) {
		tmp = NaChar / (exp((Ev / KbT)) + 1.0);
	} else if (mu <= 4.7e-279) {
		tmp = NdChar / t_0;
	} else if (mu <= 2.6e-115) {
		tmp = NaChar / t_0;
	} else if (mu <= 2e-14) {
		tmp = NdChar / (exp((EDonor / 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 = exp((vef / kbt)) + 1.0d0
    t_1 = nachar / (exp((mu / (0.0d0 - kbt))) + 1.0d0)
    if (mu <= (-1.15d+92)) then
        tmp = t_1
    else if (mu <= (-1.45d-147)) then
        tmp = nachar / (exp((ev / kbt)) + 1.0d0)
    else if (mu <= 4.7d-279) then
        tmp = ndchar / t_0
    else if (mu <= 2.6d-115) then
        tmp = nachar / t_0
    else if (mu <= 2d-14) then
        tmp = ndchar / (exp((edonor / 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 = Math.exp((Vef / KbT)) + 1.0;
	double t_1 = NaChar / (Math.exp((mu / (0.0 - KbT))) + 1.0);
	double tmp;
	if (mu <= -1.15e+92) {
		tmp = t_1;
	} else if (mu <= -1.45e-147) {
		tmp = NaChar / (Math.exp((Ev / KbT)) + 1.0);
	} else if (mu <= 4.7e-279) {
		tmp = NdChar / t_0;
	} else if (mu <= 2.6e-115) {
		tmp = NaChar / t_0;
	} else if (mu <= 2e-14) {
		tmp = NdChar / (Math.exp((EDonor / KbT)) + 1.0);
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
	t_0 = math.exp((Vef / KbT)) + 1.0
	t_1 = NaChar / (math.exp((mu / (0.0 - KbT))) + 1.0)
	tmp = 0
	if mu <= -1.15e+92:
		tmp = t_1
	elif mu <= -1.45e-147:
		tmp = NaChar / (math.exp((Ev / KbT)) + 1.0)
	elif mu <= 4.7e-279:
		tmp = NdChar / t_0
	elif mu <= 2.6e-115:
		tmp = NaChar / t_0
	elif mu <= 2e-14:
		tmp = NdChar / (math.exp((EDonor / KbT)) + 1.0)
	else:
		tmp = t_1
	return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	t_0 = Float64(exp(Float64(Vef / KbT)) + 1.0)
	t_1 = Float64(NaChar / Float64(exp(Float64(mu / Float64(0.0 - KbT))) + 1.0))
	tmp = 0.0
	if (mu <= -1.15e+92)
		tmp = t_1;
	elseif (mu <= -1.45e-147)
		tmp = Float64(NaChar / Float64(exp(Float64(Ev / KbT)) + 1.0));
	elseif (mu <= 4.7e-279)
		tmp = Float64(NdChar / t_0);
	elseif (mu <= 2.6e-115)
		tmp = Float64(NaChar / t_0);
	elseif (mu <= 2e-14)
		tmp = Float64(NdChar / Float64(exp(Float64(EDonor / 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 = exp((Vef / KbT)) + 1.0;
	t_1 = NaChar / (exp((mu / (0.0 - KbT))) + 1.0);
	tmp = 0.0;
	if (mu <= -1.15e+92)
		tmp = t_1;
	elseif (mu <= -1.45e-147)
		tmp = NaChar / (exp((Ev / KbT)) + 1.0);
	elseif (mu <= 4.7e-279)
		tmp = NdChar / t_0;
	elseif (mu <= 2.6e-115)
		tmp = NaChar / t_0;
	elseif (mu <= 2e-14)
		tmp = NdChar / (exp((EDonor / 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[(N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]}, Block[{t$95$1 = N[(NaChar / N[(N[Exp[N[(mu / N[(0.0 - KbT), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[mu, -1.15e+92], t$95$1, If[LessEqual[mu, -1.45e-147], N[(NaChar / N[(N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[mu, 4.7e-279], N[(NdChar / t$95$0), $MachinePrecision], If[LessEqual[mu, 2.6e-115], N[(NaChar / t$95$0), $MachinePrecision], If[LessEqual[mu, 2e-14], N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := e^{\frac{Vef}{KbT}} + 1\\
t_1 := \frac{NaChar}{e^{\frac{mu}{0 - KbT}} + 1}\\
\mathbf{if}\;mu \leq -1.15 \cdot 10^{+92}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;mu \leq -1.45 \cdot 10^{-147}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\

\mathbf{elif}\;mu \leq 4.7 \cdot 10^{-279}:\\
\;\;\;\;\frac{NdChar}{t\_0}\\

\mathbf{elif}\;mu \leq 2.6 \cdot 10^{-115}:\\
\;\;\;\;\frac{NaChar}{t\_0}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if mu < -1.14999999999999999e92 or 2e-14 < mu

    1. Initial program 100.0%

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      11. +-lowering-+.f64N/A

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\color{blue}{\left(-1 \cdot \frac{mu}{KbT}\right)}\right)\right)\right) \]
    8. Step-by-step derivation
      1. associate-*r/N/A

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\mathsf{neg}\left(mu\right)\right), KbT\right)\right)\right)\right) \]
      4. neg-lowering-neg.f6453.0%

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

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

    if -1.14999999999999999e92 < mu < -1.4500000000000001e-147

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      11. +-lowering-+.f64N/A

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

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) + \left(Vef - mu\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-/.f6456.2%

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

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

    if -1.4500000000000001e-147 < mu < 4.69999999999999985e-279

    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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

    if 4.69999999999999985e-279 < mu < 2.60000000000000004e-115

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      11. +-lowering-+.f64N/A

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

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

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

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

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

      \[\leadsto \mathsf{/.f64}\left(NaChar, \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.2%

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

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

    if 2.60000000000000004e-115 < mu < 2e-14

    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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;mu \leq -1.15 \cdot 10^{+92}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{mu}{0 - KbT}} + 1}\\ \mathbf{elif}\;mu \leq -1.45 \cdot 10^{-147}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\ \mathbf{elif}\;mu \leq 4.7 \cdot 10^{-279}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{elif}\;mu \leq 2.6 \cdot 10^{-115}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{elif}\;mu \leq 2 \cdot 10^{-14}:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{mu}{0 - KbT}} + 1}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 40.3% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_0 := \left(EDonor + \left(Vef + mu\right)\right) - Ec\\
t_1 := t\_0 \cdot t\_0\\
t_2 := 0.5 \cdot \left(NdChar + NaChar\right)\\
\mathbf{if}\;KbT \leq -2.8 \cdot 10^{+161}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;KbT \leq -5 \cdot 10^{-18}:\\
\;\;\;\;\frac{NdChar}{2 + \frac{t\_0 + \frac{0.16666666666666666 \cdot \frac{t\_0 \cdot t\_1}{KbT} + 0.5 \cdot t\_1}{KbT}}{KbT}}\\

\mathbf{elif}\;KbT \leq -3.6 \cdot 10^{-243}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if KbT < -2.80000000000000021e161 or 2.50000000000000009e200 < KbT

    1. Initial program 100.0%

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

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

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

    if -2.80000000000000021e161 < KbT < -5.00000000000000036e-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 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. associate--l+N/A

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{EDonor + \left(Vef + \left(mu - Ec\right)\right)}{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) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{2}}{KbT}}{KbT}\right)}\right) \]
    8. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(-1 \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{2}}{KbT}\right), KbT\right)\right)\right)\right) \]
    9. Simplified43.6%

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

    if -5.00000000000000036e-18 < KbT < -3.6000000000000001e-243

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      11. +-lowering-+.f64N/A

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

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) + \left(Vef - mu\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-/.f6448.9%

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

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

    if -3.6000000000000001e-243 < KbT < 2.50000000000000009e200

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      11. +-lowering-+.f64N/A

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

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

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

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

      \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) + \left(Vef - mu\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-/.f6435.0%

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

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

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

Alternative 6: 68.6% accurate, 1.8× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if NdChar < -2.1499999999999998e62

    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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

    if -2.1499999999999998e62 < NdChar < 1.5500000000000001e108

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      11. +-lowering-+.f64N/A

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

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

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

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

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

    if 1.5500000000000001e108 < NdChar

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 68.6% accurate, 1.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if NdChar < -4.5999999999999998e57 or 1.6999999999999998e107 < NdChar

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

    if -4.5999999999999998e57 < NdChar < 1.6999999999999998e107

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
      11. +-lowering-+.f64N/A

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

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

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

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

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

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

Alternative 8: 63.9% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;KbT \leq -6.3 \cdot 10^{+221}:\\
\;\;\;\;\frac{NdChar}{2} + \frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1} + \frac{NaChar}{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if KbT < -6.2999999999999997e221

    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. Simplified93.5%

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

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

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

      if -6.2999999999999997e221 < KbT < 3.50000000000000006e200

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
        11. +-lowering-+.f64N/A

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

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

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

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

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

      if 3.50000000000000006e200 < 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 \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, \color{blue}{2}\right)\right) \]
      5. Step-by-step derivation
        1. Simplified81.8%

          \[\leadsto \frac{NdChar}{1 + e^{\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}}} + \frac{NaChar}{\color{blue}{2}} \]
        2. 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, 2\right)\right) \]
        3. Step-by-step derivation
          1. /-lowering-/.f6478.7%

            \[\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, 2\right)\right) \]
        4. Simplified78.7%

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

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

      Alternative 9: 42.6% accurate, 1.9× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{if}\;Vef \leq -1.72 \cdot 10^{+193}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;Vef \leq -1500000000:\\ \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\ \mathbf{elif}\;Vef \leq 10^{+154}:\\ \;\;\;\;\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 (/ NaChar (+ (exp (/ Vef KbT)) 1.0))))
         (if (<= Vef -1.72e+193)
           t_0
           (if (<= Vef -1500000000.0)
             (/ NdChar (+ (exp (/ EDonor KbT)) 1.0))
             (if (<= Vef 1e+154) (/ 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 = NaChar / (exp((Vef / KbT)) + 1.0);
      	double tmp;
      	if (Vef <= -1.72e+193) {
      		tmp = t_0;
      	} else if (Vef <= -1500000000.0) {
      		tmp = NdChar / (exp((EDonor / KbT)) + 1.0);
      	} else if (Vef <= 1e+154) {
      		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 = nachar / (exp((vef / kbt)) + 1.0d0)
          if (vef <= (-1.72d+193)) then
              tmp = t_0
          else if (vef <= (-1500000000.0d0)) then
              tmp = ndchar / (exp((edonor / kbt)) + 1.0d0)
          else if (vef <= 1d+154) 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 = NaChar / (Math.exp((Vef / KbT)) + 1.0);
      	double tmp;
      	if (Vef <= -1.72e+193) {
      		tmp = t_0;
      	} else if (Vef <= -1500000000.0) {
      		tmp = NdChar / (Math.exp((EDonor / KbT)) + 1.0);
      	} else if (Vef <= 1e+154) {
      		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 = NaChar / (math.exp((Vef / KbT)) + 1.0)
      	tmp = 0
      	if Vef <= -1.72e+193:
      		tmp = t_0
      	elif Vef <= -1500000000.0:
      		tmp = NdChar / (math.exp((EDonor / KbT)) + 1.0)
      	elif Vef <= 1e+154:
      		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(NaChar / Float64(exp(Float64(Vef / KbT)) + 1.0))
      	tmp = 0.0
      	if (Vef <= -1.72e+193)
      		tmp = t_0;
      	elseif (Vef <= -1500000000.0)
      		tmp = Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) + 1.0));
      	elseif (Vef <= 1e+154)
      		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 = NaChar / (exp((Vef / KbT)) + 1.0);
      	tmp = 0.0;
      	if (Vef <= -1.72e+193)
      		tmp = t_0;
      	elseif (Vef <= -1500000000.0)
      		tmp = NdChar / (exp((EDonor / KbT)) + 1.0);
      	elseif (Vef <= 1e+154)
      		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[(NaChar / N[(N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Vef, -1.72e+193], t$95$0, If[LessEqual[Vef, -1500000000.0], N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[Vef, 1e+154], 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{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\
      \mathbf{if}\;Vef \leq -1.72 \cdot 10^{+193}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;Vef \leq -1500000000:\\
      \;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1}\\
      
      \mathbf{elif}\;Vef \leq 10^{+154}:\\
      \;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if Vef < -1.7199999999999999e193 or 1.00000000000000004e154 < Vef

        1. Initial program 100.0%

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          11. +-lowering-+.f64N/A

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \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-/.f6472.6%

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

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

        if -1.7199999999999999e193 < Vef < -1.5e9

        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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -1.5e9 < Vef < 1.00000000000000004e154

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          11. +-lowering-+.f64N/A

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

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

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

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

          \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) + \left(Vef - mu\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-/.f6444.0%

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

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

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

      Alternative 10: 39.0% accurate, 1.9× speedup?

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

        1. Initial program 100.0%

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

        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. associate--l+N/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{EDonor + \left(Vef + \left(mu - Ec\right)\right)}{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) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{2}}{KbT}}{KbT}\right)}\right) \]
        8. Step-by-step derivation
          1. +-lowering-+.f64N/A

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(-1 \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{2}}{KbT}\right), KbT\right)\right)\right)\right) \]
        9. Simplified43.6%

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

        if -6.1999999999999998e-15 < KbT < 1.12e-10

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          11. +-lowering-+.f64N/A

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

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

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

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

          \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) + \left(Vef - mu\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.2%

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

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

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

      Alternative 11: 44.3% accurate, 2.0× speedup?

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

        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. associate--l+N/A

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

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

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

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

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

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

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

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

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

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

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

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

        if -1.25e9 < Vef < 1.08e154

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          11. +-lowering-+.f64N/A

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

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

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

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

          \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) + \left(Vef - mu\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-/.f6444.0%

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

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          11. +-lowering-+.f64N/A

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \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-/.f6466.1%

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

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

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

      Alternative 12: 43.7% accurate, 2.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{if}\;Vef \leq -2.55 \cdot 10^{+43}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;Vef \leq 9 \cdot 10^{+153}:\\ \;\;\;\;\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 (/ NaChar (+ (exp (/ Vef KbT)) 1.0))))
         (if (<= Vef -2.55e+43)
           t_0
           (if (<= Vef 9e+153) (/ 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 = NaChar / (exp((Vef / KbT)) + 1.0);
      	double tmp;
      	if (Vef <= -2.55e+43) {
      		tmp = t_0;
      	} else if (Vef <= 9e+153) {
      		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 = nachar / (exp((vef / kbt)) + 1.0d0)
          if (vef <= (-2.55d+43)) then
              tmp = t_0
          else if (vef <= 9d+153) 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 = NaChar / (Math.exp((Vef / KbT)) + 1.0);
      	double tmp;
      	if (Vef <= -2.55e+43) {
      		tmp = t_0;
      	} else if (Vef <= 9e+153) {
      		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 = NaChar / (math.exp((Vef / KbT)) + 1.0)
      	tmp = 0
      	if Vef <= -2.55e+43:
      		tmp = t_0
      	elif Vef <= 9e+153:
      		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(NaChar / Float64(exp(Float64(Vef / KbT)) + 1.0))
      	tmp = 0.0
      	if (Vef <= -2.55e+43)
      		tmp = t_0;
      	elseif (Vef <= 9e+153)
      		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 = NaChar / (exp((Vef / KbT)) + 1.0);
      	tmp = 0.0;
      	if (Vef <= -2.55e+43)
      		tmp = t_0;
      	elseif (Vef <= 9e+153)
      		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[(NaChar / N[(N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Vef, -2.55e+43], t$95$0, If[LessEqual[Vef, 9e+153], 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{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\
      \mathbf{if}\;Vef \leq -2.55 \cdot 10^{+43}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;Vef \leq 9 \cdot 10^{+153}:\\
      \;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if Vef < -2.54999999999999997e43 or 9.0000000000000002e153 < Vef

        1. Initial program 100.0%

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          11. +-lowering-+.f64N/A

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \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-/.f6457.7%

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

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

        if -2.54999999999999997e43 < Vef < 9.0000000000000002e153

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          11. +-lowering-+.f64N/A

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

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

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

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

          \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) + \left(Vef - mu\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-/.f6442.8%

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;Vef \leq -2.55 \cdot 10^{+43}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{elif}\;Vef \leq 9 \cdot 10^{+153}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \end{array} \]
      5. Add Preprocessing

      Alternative 13: 35.1% accurate, 3.2× speedup?

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

        1. Initial program 100.0%

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

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

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

        if -5.20000000000000022e157 < KbT < 9.5999999999999998e131

        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. associate--l+N/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{EDonor + \left(Vef + \left(mu - Ec\right)\right)}{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) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{2}}{KbT}}{KbT}\right)}\right) \]
        8. Step-by-step derivation
          1. +-lowering-+.f64N/A

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(-1 \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{2}}{KbT}\right), KbT\right)\right)\right)\right) \]
        9. Simplified29.7%

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

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

      Alternative 14: 35.5% accurate, 5.3× speedup?

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

        1. Initial program 100.0%

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

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

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

        if -2.6000000000000002e167 < KbT < 7.5000000000000003e130

        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. associate--l+N/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{EDonor + \left(Vef + \left(mu - Ec\right)\right)}{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. +-lowering-+.f64N/A

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

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

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

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

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

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

      Alternative 15: 35.6% accurate, 5.3× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := EAccept + \left(\left(Vef + Ev\right) - mu\right)\\ t_1 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -3 \cdot 10^{+150}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;KbT \leq 3.2 \cdot 10^{+187}:\\ \;\;\;\;\frac{NaChar}{2 + \frac{t\_0 + \frac{-0.5 \cdot \left(t\_0 \cdot \left(\left(mu - \left(Vef + Ev\right)\right) - EAccept\right)\right)}{KbT}}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
       :precision binary64
       (let* ((t_0 (+ EAccept (- (+ Vef Ev) mu))) (t_1 (* 0.5 (+ NdChar NaChar))))
         (if (<= KbT -3e+150)
           t_1
           (if (<= KbT 3.2e+187)
             (/
              NaChar
              (+
               2.0
               (/
                (+ t_0 (/ (* -0.5 (* t_0 (- (- mu (+ Vef Ev)) EAccept))) KbT))
                KbT)))
             t_1))))
      double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
      	double t_0 = EAccept + ((Vef + Ev) - mu);
      	double t_1 = 0.5 * (NdChar + NaChar);
      	double tmp;
      	if (KbT <= -3e+150) {
      		tmp = t_1;
      	} else if (KbT <= 3.2e+187) {
      		tmp = NaChar / (2.0 + ((t_0 + ((-0.5 * (t_0 * ((mu - (Vef + Ev)) - EAccept))) / KbT)) / KbT));
      	} 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 = eaccept + ((vef + ev) - mu)
          t_1 = 0.5d0 * (ndchar + nachar)
          if (kbt <= (-3d+150)) then
              tmp = t_1
          else if (kbt <= 3.2d+187) then
              tmp = nachar / (2.0d0 + ((t_0 + (((-0.5d0) * (t_0 * ((mu - (vef + ev)) - eaccept))) / kbt)) / kbt))
          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 = EAccept + ((Vef + Ev) - mu);
      	double t_1 = 0.5 * (NdChar + NaChar);
      	double tmp;
      	if (KbT <= -3e+150) {
      		tmp = t_1;
      	} else if (KbT <= 3.2e+187) {
      		tmp = NaChar / (2.0 + ((t_0 + ((-0.5 * (t_0 * ((mu - (Vef + Ev)) - EAccept))) / KbT)) / KbT));
      	} else {
      		tmp = t_1;
      	}
      	return tmp;
      }
      
      def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
      	t_0 = EAccept + ((Vef + Ev) - mu)
      	t_1 = 0.5 * (NdChar + NaChar)
      	tmp = 0
      	if KbT <= -3e+150:
      		tmp = t_1
      	elif KbT <= 3.2e+187:
      		tmp = NaChar / (2.0 + ((t_0 + ((-0.5 * (t_0 * ((mu - (Vef + Ev)) - EAccept))) / KbT)) / KbT))
      	else:
      		tmp = t_1
      	return tmp
      
      function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
      	t_0 = Float64(EAccept + Float64(Float64(Vef + Ev) - mu))
      	t_1 = Float64(0.5 * Float64(NdChar + NaChar))
      	tmp = 0.0
      	if (KbT <= -3e+150)
      		tmp = t_1;
      	elseif (KbT <= 3.2e+187)
      		tmp = Float64(NaChar / Float64(2.0 + Float64(Float64(t_0 + Float64(Float64(-0.5 * Float64(t_0 * Float64(Float64(mu - Float64(Vef + Ev)) - EAccept))) / KbT)) / KbT)));
      	else
      		tmp = t_1;
      	end
      	return tmp
      end
      
      function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
      	t_0 = EAccept + ((Vef + Ev) - mu);
      	t_1 = 0.5 * (NdChar + NaChar);
      	tmp = 0.0;
      	if (KbT <= -3e+150)
      		tmp = t_1;
      	elseif (KbT <= 3.2e+187)
      		tmp = NaChar / (2.0 + ((t_0 + ((-0.5 * (t_0 * ((mu - (Vef + Ev)) - EAccept))) / KbT)) / KbT));
      	else
      		tmp = t_1;
      	end
      	tmp_2 = tmp;
      end
      
      code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(EAccept + N[(N[(Vef + Ev), $MachinePrecision] - mu), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -3e+150], t$95$1, If[LessEqual[KbT, 3.2e+187], N[(NaChar / N[(2.0 + N[(N[(t$95$0 + N[(N[(-0.5 * N[(t$95$0 * N[(N[(mu - N[(Vef + Ev), $MachinePrecision]), $MachinePrecision] - EAccept), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := EAccept + \left(\left(Vef + Ev\right) - mu\right)\\
      t_1 := 0.5 \cdot \left(NdChar + NaChar\right)\\
      \mathbf{if}\;KbT \leq -3 \cdot 10^{+150}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;KbT \leq 3.2 \cdot 10^{+187}:\\
      \;\;\;\;\frac{NaChar}{2 + \frac{t\_0 + \frac{-0.5 \cdot \left(t\_0 \cdot \left(\left(mu - \left(Vef + Ev\right)\right) - EAccept\right)\right)}{KbT}}{KbT}}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if KbT < -3.00000000000000012e150 or 3.19999999999999993e187 < KbT

        1. Initial program 100.0%

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

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

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

        if -3.00000000000000012e150 < KbT < 3.19999999999999993e187

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          11. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(-1 \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right) + \frac{-1}{2} \cdot \frac{{\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}^{2}}{KbT}\right), KbT\right)\right)\right)\right) \]
        9. Simplified28.9%

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

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

      Alternative 16: 33.6% accurate, 6.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -1.9 \cdot 10^{+148}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 3.2 \cdot 10^{+187}:\\ \;\;\;\;\frac{NaChar}{2 + \frac{\left(EAccept + \left(\left(Vef + Ev\right) - mu\right)\right) + \frac{0.16666666666666666 \cdot \frac{Vef \cdot \left(Vef \cdot Vef\right)}{KbT}}{KbT}}{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.9e+148)
           t_0
           (if (<= KbT 3.2e+187)
             (/
              NaChar
              (+
               2.0
               (/
                (+
                 (+ EAccept (- (+ Vef Ev) mu))
                 (/ (* 0.16666666666666666 (/ (* Vef (* Vef Vef)) KbT)) 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.9e+148) {
      		tmp = t_0;
      	} else if (KbT <= 3.2e+187) {
      		tmp = NaChar / (2.0 + (((EAccept + ((Vef + Ev) - mu)) + ((0.16666666666666666 * ((Vef * (Vef * Vef)) / KbT)) / 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.9d+148)) then
              tmp = t_0
          else if (kbt <= 3.2d+187) then
              tmp = nachar / (2.0d0 + (((eaccept + ((vef + ev) - mu)) + ((0.16666666666666666d0 * ((vef * (vef * vef)) / kbt)) / 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.9e+148) {
      		tmp = t_0;
      	} else if (KbT <= 3.2e+187) {
      		tmp = NaChar / (2.0 + (((EAccept + ((Vef + Ev) - mu)) + ((0.16666666666666666 * ((Vef * (Vef * Vef)) / KbT)) / 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.9e+148:
      		tmp = t_0
      	elif KbT <= 3.2e+187:
      		tmp = NaChar / (2.0 + (((EAccept + ((Vef + Ev) - mu)) + ((0.16666666666666666 * ((Vef * (Vef * Vef)) / KbT)) / 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.9e+148)
      		tmp = t_0;
      	elseif (KbT <= 3.2e+187)
      		tmp = Float64(NaChar / Float64(2.0 + Float64(Float64(Float64(EAccept + Float64(Float64(Vef + Ev) - mu)) + Float64(Float64(0.16666666666666666 * Float64(Float64(Vef * Float64(Vef * Vef)) / KbT)) / 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.9e+148)
      		tmp = t_0;
      	elseif (KbT <= 3.2e+187)
      		tmp = NaChar / (2.0 + (((EAccept + ((Vef + Ev) - mu)) + ((0.16666666666666666 * ((Vef * (Vef * Vef)) / KbT)) / 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.9e+148], t$95$0, If[LessEqual[KbT, 3.2e+187], N[(NaChar / N[(2.0 + N[(N[(N[(EAccept + N[(N[(Vef + Ev), $MachinePrecision] - mu), $MachinePrecision]), $MachinePrecision] + N[(N[(0.16666666666666666 * N[(N[(Vef * N[(Vef * Vef), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision] / KbT), $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 -1.9 \cdot 10^{+148}:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;KbT \leq 3.2 \cdot 10^{+187}:\\
      \;\;\;\;\frac{NaChar}{2 + \frac{\left(EAccept + \left(\left(Vef + Ev\right) - mu\right)\right) + \frac{0.16666666666666666 \cdot \frac{Vef \cdot \left(Vef \cdot Vef\right)}{KbT}}{KbT}}{KbT}}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if KbT < -1.8999999999999999e148 or 3.19999999999999993e187 < KbT

        1. Initial program 100.0%

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

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

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

        if -1.8999999999999999e148 < KbT < 3.19999999999999993e187

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          11. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(-1 \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}^{2}}{KbT}\right), KbT\right)\right)\right)\right) \]
        9. Simplified28.0%

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(Ev, Vef\right), mu\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{6}, \left(\frac{{Vef}^{3}}{KbT}\right)\right), KbT\right)\right), KbT\right)\right)\right)\right) \]
          2. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(Ev, Vef\right), mu\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\left({Vef}^{3}\right), KbT\right)\right), KbT\right)\right), KbT\right)\right)\right)\right) \]
          3. cube-multN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(Ev, Vef\right), mu\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\left(Vef \cdot \left(Vef \cdot Vef\right)\right), KbT\right)\right), KbT\right)\right), KbT\right)\right)\right)\right) \]
          4. unpow2N/A

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(Ev, Vef\right), mu\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(Vef, \left({Vef}^{2}\right)\right), KbT\right)\right), KbT\right)\right), KbT\right)\right)\right)\right) \]
          6. unpow2N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(Ev, Vef\right), mu\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(Vef, \left(Vef \cdot Vef\right)\right), KbT\right)\right), KbT\right)\right), KbT\right)\right)\right)\right) \]
          7. *-lowering-*.f6428.4%

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{neg.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(Ev, Vef\right), mu\right)\right)\right), \mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(Vef, \mathsf{*.f64}\left(Vef, Vef\right)\right), KbT\right)\right), KbT\right)\right), KbT\right)\right)\right)\right) \]
        12. Simplified28.4%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -1.9 \cdot 10^{+148}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq 3.2 \cdot 10^{+187}:\\ \;\;\;\;\frac{NaChar}{2 + \frac{\left(EAccept + \left(\left(Vef + Ev\right) - mu\right)\right) + \frac{0.16666666666666666 \cdot \frac{Vef \cdot \left(Vef \cdot Vef\right)}{KbT}}{KbT}}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 17: 31.4% accurate, 9.1× speedup?

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

        1. Initial program 100.0%

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          11. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(-1 \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}^{2}}{KbT}\right), KbT\right)\right)\right)\right) \]
        9. Simplified42.8%

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\left({Vef}^{3}\right), \color{blue}{\left({KbT}^{3}\right)}\right)\right)\right) \]
          3. cube-multN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\left(Vef \cdot \left(Vef \cdot Vef\right)\right), \left({\color{blue}{KbT}}^{3}\right)\right)\right)\right) \]
          4. unpow2N/A

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(Vef, \left(Vef \cdot Vef\right)\right), \left({KbT}^{3}\right)\right)\right)\right) \]
          7. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(Vef, \mathsf{*.f64}\left(Vef, Vef\right)\right), \left({KbT}^{3}\right)\right)\right)\right) \]
          8. cube-multN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(Vef, \mathsf{*.f64}\left(Vef, Vef\right)\right), \left(KbT \cdot \color{blue}{\left(KbT \cdot KbT\right)}\right)\right)\right)\right) \]
          9. unpow2N/A

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(Vef, \mathsf{*.f64}\left(Vef, Vef\right)\right), \mathsf{*.f64}\left(KbT, \left(KbT \cdot \color{blue}{KbT}\right)\right)\right)\right)\right) \]
          12. *-lowering-*.f6426.4%

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\mathsf{*.f64}\left(Vef, \mathsf{*.f64}\left(Vef, Vef\right)\right), \mathsf{*.f64}\left(KbT, \mathsf{*.f64}\left(KbT, \color{blue}{KbT}\right)\right)\right)\right)\right) \]
        12. Simplified26.4%

          \[\leadsto \frac{NaChar}{\color{blue}{0.16666666666666666 \cdot \frac{Vef \cdot \left(Vef \cdot Vef\right)}{KbT \cdot \left(KbT \cdot KbT\right)}}} \]
        13. Step-by-step derivation
          1. associate-/r*N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{*.f64}\left(\frac{1}{6}, \left(\frac{\frac{Vef \cdot \left(Vef \cdot Vef\right)}{KbT}}{\color{blue}{KbT \cdot KbT}}\right)\right)\right) \]
          2. associate-/r*N/A

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(\frac{Vef \cdot \left(Vef \cdot Vef\right)}{KbT}\right), KbT\right), KbT\right)\right)\right) \]
          5. /-lowering-/.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\left(Vef \cdot \left(Vef \cdot Vef\right)\right), KbT\right), KbT\right), KbT\right)\right)\right) \]
          6. *-lowering-*.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(Vef, \left(Vef \cdot Vef\right)\right), KbT\right), KbT\right), KbT\right)\right)\right) \]
          7. *-lowering-*.f6443.9%

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{*.f64}\left(\frac{1}{6}, \mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(Vef, \mathsf{*.f64}\left(Vef, Vef\right)\right), KbT\right), KbT\right), KbT\right)\right)\right) \]
        14. Applied egg-rr43.9%

          \[\leadsto \frac{NaChar}{0.16666666666666666 \cdot \color{blue}{\frac{\frac{\frac{Vef \cdot \left(Vef \cdot Vef\right)}{KbT}}{KbT}}{KbT}}} \]

        if -1.05000000000000008e122 < Vef < 3.0500000000000002e143

        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-+.f6435.6%

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;Vef \leq -1.05 \cdot 10^{+122}:\\ \;\;\;\;\frac{NaChar}{0.16666666666666666 \cdot \frac{\frac{\frac{Vef \cdot \left(Vef \cdot Vef\right)}{KbT}}{KbT}}{KbT}}\\ \mathbf{elif}\;Vef \leq 3.05 \cdot 10^{+143}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{0.16666666666666666 \cdot \frac{\frac{\frac{Vef \cdot \left(Vef \cdot Vef\right)}{KbT}}{KbT}}{KbT}}\\ \end{array} \]
      5. Add Preprocessing

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

        1. Initial program 100.0%

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

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

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

        if -3.4000000000000001e70 < KbT < 6.39999999999999975e-79

        1. Initial program 100.0%

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          11. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{neg.f64}\left(\mathsf{/.f64}\left(\left(-1 \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right) + -1 \cdot \frac{\frac{1}{6} \cdot \frac{{\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}^{3}}{KbT} + \frac{1}{2} \cdot {\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}^{2}}{KbT}\right), KbT\right)\right)\right)\right) \]
        9. Simplified29.1%

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(EAccept, \left(Ev + Vef\right)\right), mu\right), KbT\right)\right)\right) \]
          4. +-lowering-+.f6425.4%

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{+.f64}\left(EAccept, \mathsf{+.f64}\left(Ev, Vef\right)\right), mu\right), KbT\right)\right)\right) \]
        12. Simplified25.4%

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

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

      Alternative 19: 28.6% accurate, 13.4× speedup?

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

        1. Initial program 100.0%

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

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

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

        if -5.2e39 < KbT < 7.1999999999999997e-205

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          11. +-lowering-+.f64N/A

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \color{blue}{\left(2 + \frac{Ev}{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{Ev}{KbT}\right)}\right)\right) \]
          2. /-lowering-/.f6418.6%

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -5.2 \cdot 10^{+39}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq 7.2 \cdot 10^{-205}:\\ \;\;\;\;\frac{NaChar}{2 + \frac{Ev}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 20: 22.9% accurate, 17.6× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;NaChar \leq -0.0023:\\ \;\;\;\;\frac{NaChar}{2}\\ \mathbf{elif}\;NaChar \leq 5.8 \cdot 10^{-10}:\\ \;\;\;\;NdChar \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{2}\\ \end{array} \end{array} \]
      (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
       :precision binary64
       (if (<= NaChar -0.0023)
         (/ NaChar 2.0)
         (if (<= NaChar 5.8e-10) (* NdChar 0.5) (/ NaChar 2.0))))
      double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
      	double tmp;
      	if (NaChar <= -0.0023) {
      		tmp = NaChar / 2.0;
      	} else if (NaChar <= 5.8e-10) {
      		tmp = NdChar * 0.5;
      	} else {
      		tmp = NaChar / 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) :: tmp
          if (nachar <= (-0.0023d0)) then
              tmp = nachar / 2.0d0
          else if (nachar <= 5.8d-10) then
              tmp = ndchar * 0.5d0
          else
              tmp = nachar / 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 tmp;
      	if (NaChar <= -0.0023) {
      		tmp = NaChar / 2.0;
      	} else if (NaChar <= 5.8e-10) {
      		tmp = NdChar * 0.5;
      	} else {
      		tmp = NaChar / 2.0;
      	}
      	return tmp;
      }
      
      def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
      	tmp = 0
      	if NaChar <= -0.0023:
      		tmp = NaChar / 2.0
      	elif NaChar <= 5.8e-10:
      		tmp = NdChar * 0.5
      	else:
      		tmp = NaChar / 2.0
      	return tmp
      
      function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
      	tmp = 0.0
      	if (NaChar <= -0.0023)
      		tmp = Float64(NaChar / 2.0);
      	elseif (NaChar <= 5.8e-10)
      		tmp = Float64(NdChar * 0.5);
      	else
      		tmp = Float64(NaChar / 2.0);
      	end
      	return tmp
      end
      
      function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
      	tmp = 0.0;
      	if (NaChar <= -0.0023)
      		tmp = NaChar / 2.0;
      	elseif (NaChar <= 5.8e-10)
      		tmp = NdChar * 0.5;
      	else
      		tmp = NaChar / 2.0;
      	end
      	tmp_2 = tmp;
      end
      
      code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[NaChar, -0.0023], N[(NaChar / 2.0), $MachinePrecision], If[LessEqual[NaChar, 5.8e-10], N[(NdChar * 0.5), $MachinePrecision], N[(NaChar / 2.0), $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;NaChar \leq -0.0023:\\
      \;\;\;\;\frac{NaChar}{2}\\
      
      \mathbf{elif}\;NaChar \leq 5.8 \cdot 10^{-10}:\\
      \;\;\;\;NdChar \cdot 0.5\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{NaChar}{2}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if NaChar < -0.0023 or 5.79999999999999962e-10 < 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. sub-negN/A

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\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(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          11. +-lowering-+.f64N/A

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \color{blue}{2}\right) \]
        8. Step-by-step derivation
          1. Simplified26.5%

            \[\leadsto \frac{NaChar}{\color{blue}{2}} \]

          if -0.0023 < NaChar < 5.79999999999999962e-10

          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-+.f6430.0%

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

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

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

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

        Alternative 21: 27.6% 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-+.f6429.5%

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

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

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

        Alternative 22: 18.2% 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-+.f6429.5%

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

          \[\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-*.f6418.6%

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

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

        Reproduce

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