Bulmash initializePoisson

Percentage Accurate: 100.0% → 100.0%
Time: 21.6s
Alternatives: 19
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 19 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

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

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

      \[\leadsto \mathsf{+.f64}\left(\left(\frac{1}{\frac{1 + e^{\frac{Vef + \left(\left(EDonor + mu\right) - Ec\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(Ev, \mathsf{\_.f64}\left(mu, EAccept\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(\left(EDonor + mu\right) - Ec\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(Ev, \mathsf{\_.f64}\left(mu, EAccept\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(\left(EDonor + mu\right) - Ec\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(Ev, \mathsf{\_.f64}\left(mu, EAccept\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(\left(EDonor + mu\right) - Ec\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(Ev, \mathsf{\_.f64}\left(mu, EAccept\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(\left(EDonor + mu\right) - Ec\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(Ev, \mathsf{\_.f64}\left(mu, EAccept\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(\left(EDonor + mu\right) - Ec\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(Ev, \mathsf{\_.f64}\left(mu, EAccept\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(\left(EDonor + mu\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(Ev, \mathsf{\_.f64}\left(mu, EAccept\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(\left(EDonor + mu\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(Ev, \mathsf{\_.f64}\left(mu, EAccept\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
    9. --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(EDonor + mu\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(Ev, \mathsf{\_.f64}\left(mu, EAccept\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
    10. +-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(EDonor, mu\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(Ev, \mathsf{\_.f64}\left(mu, EAccept\right)\right)\right), KbT\right)\right)\right)\right)\right) \]
  6. Applied egg-rr100.0%

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

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

Alternative 2: 77.4% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;Vef \leq 10.5:\\
\;\;\;\;t\_0 + \frac{NaChar}{e^{\frac{EAccept}{KbT}} + 1}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Vef < -4.19999999999999972e89 or 10.5 < 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. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

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

        \[\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(\mathsf{+.f64}\left(EDonor, mu\right), Ec\right)\right), KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right)\right)\right)\right)\right) \]
    7. Simplified84.6%

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

    if -4.19999999999999972e89 < Vef < 10.5

    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. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

      \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{Vef + \left(\left(EDonor + mu\right) - Ec\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev - \left(mu - EAccept\right)\right)}{KbT}}}} \]
    4. Add Preprocessing
    5. 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(\mathsf{+.f64}\left(EDonor, mu\right), Ec\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) \]
    6. Step-by-step derivation
      1. /-lowering-/.f6474.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(EDonor, mu\right), Ec\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) \]
    7. Simplified74.4%

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

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

Alternative 3: 71.9% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if NaChar < -2.7999999999999998e95 or 2.8999999999999999e-58 < 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. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\left(EAccept + Ev\right) + Vef\right), mu\right), KbT\right)\right)\right)\right) \]
      7. +-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(\left(EAccept + Ev\right), Vef\right), mu\right), KbT\right)\right)\right)\right) \]
      8. +-lowering-+.f6478.3%

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

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

    if -2.7999999999999998e95 < NaChar < 2.8999999999999999e-58

    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. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

      \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{Vef + \left(\left(EDonor + mu\right) - Ec\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev - \left(mu - EAccept\right)\right)}{KbT}}}} \]
    4. Add Preprocessing
    5. 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(\mathsf{+.f64}\left(EDonor, mu\right), Ec\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) \]
    6. Step-by-step derivation
      1. /-lowering-/.f6477.4%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(EDonor, mu\right), Ec\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) \]
    7. Simplified77.4%

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

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

Alternative 4: 100.0% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 5: 66.0% accurate, 1.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if NdChar < -1.9000000000000001e-157 or 6.3000000000000003e181 < NdChar

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.9000000000000001e-157 < NdChar < 6.3000000000000003e181

    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. Step-by-step derivation
      1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

Alternative 6: 63.6% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;KbT \leq -4.8 \cdot 10^{+244}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} + 1} + \frac{NaChar}{2}\\

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

\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(NdChar + NaChar\right) - -0.25 \cdot \left(Ec \cdot \frac{NdChar}{KbT}\right)\\


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

    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. Step-by-step derivation
      1. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\left(\frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)\right)}{KbT}}}\right), \color{blue}{\left(\frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(\mathsf{neg}\left(mu\right)\right)}{KbT}}}\right)}\right) \]
    3. Simplified99.9%

      \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{Vef + \left(\left(EDonor + mu\right) - Ec\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev - \left(mu - EAccept\right)\right)}{KbT}}}} \]
    4. Add Preprocessing
    5. 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(\mathsf{+.f64}\left(EDonor, mu\right), Ec\right)\right), KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \color{blue}{2}\right)\right) \]
    6. Step-by-step derivation
      1. Simplified86.2%

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

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

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

      if -4.79999999999999975e244 < KbT < 3.59999999999999991e218

      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. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\left(EAccept + Ev\right) + Vef\right), mu\right), KbT\right)\right)\right)\right) \]
        7. +-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(\left(EAccept + Ev\right), Vef\right), mu\right), KbT\right)\right)\right)\right) \]
        8. +-lowering-+.f6467.3%

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

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

      if 3.59999999999999991e218 < 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. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{+.f64}\left(\left(\mathsf{neg}\left(\left(\frac{1}{4} \cdot \frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \frac{1}{4} \cdot \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT}\right)\right)\right), \color{blue}{\left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right)}\right) \]
      7. Simplified58.7%

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

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

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \left(\mathsf{neg}\left(\frac{Ec \cdot NdChar}{KbT}\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right)\right) \]
        2. neg-sub0N/A

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

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

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

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(Ec, \left(\frac{NdChar}{KbT}\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right)\right) \]
        6. /-lowering-/.f6479.7%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(Ec, \mathsf{/.f64}\left(NdChar, KbT\right)\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right)\right) \]
      10. Simplified79.7%

        \[\leadsto -0.25 \cdot \color{blue}{\left(0 - Ec \cdot \frac{NdChar}{KbT}\right)} + 0.5 \cdot \left(NaChar + NdChar\right) \]
    7. Recombined 3 regimes into one program.
    8. Final simplification69.2%

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

    Alternative 7: 42.5% accurate, 2.0× speedup?

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

      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. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -3.19999999999999982e-156 < NdChar < 2.8500000000000001e189

      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. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{\frac{Vef}{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{Vef}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f6449.7%

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

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

      if 2.8500000000000001e189 < NdChar

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right) \]
      10. Simplified65.5%

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

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

    Alternative 8: 41.3% accurate, 2.0× speedup?

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -3.80000000000000008e-156 < NdChar < 2.8500000000000001e189

      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. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{\frac{Vef}{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{Vef}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f6449.7%

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

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

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

    Alternative 9: 42.9% accurate, 2.0× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -7.2 \cdot 10^{+92}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 1.02 \cdot 10^{+148}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;t\_0 + \left(Vef \cdot -0.25\right) \cdot \left(\frac{NdChar}{KbT} + \frac{NaChar}{KbT}\right)\\ \end{array} \end{array} \]
    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
     :precision binary64
     (let* ((t_0 (* 0.5 (+ NdChar NaChar))))
       (if (<= KbT -7.2e+92)
         t_0
         (if (<= KbT 1.02e+148)
           (/ NaChar (+ (exp (/ Vef KbT)) 1.0))
           (+ t_0 (* (* Vef -0.25) (+ (/ NdChar KbT) (/ NaChar KbT))))))))
    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 <= -7.2e+92) {
    		tmp = t_0;
    	} else if (KbT <= 1.02e+148) {
    		tmp = NaChar / (exp((Vef / KbT)) + 1.0);
    	} else {
    		tmp = t_0 + ((Vef * -0.25) * ((NdChar / KbT) + (NaChar / KbT)));
    	}
    	return tmp;
    }
    
    real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
        real(8), intent (in) :: ndchar
        real(8), intent (in) :: ec
        real(8), intent (in) :: vef
        real(8), intent (in) :: edonor
        real(8), intent (in) :: mu
        real(8), intent (in) :: kbt
        real(8), intent (in) :: nachar
        real(8), intent (in) :: ev
        real(8), intent (in) :: eaccept
        real(8) :: t_0
        real(8) :: tmp
        t_0 = 0.5d0 * (ndchar + nachar)
        if (kbt <= (-7.2d+92)) then
            tmp = t_0
        else if (kbt <= 1.02d+148) then
            tmp = nachar / (exp((vef / kbt)) + 1.0d0)
        else
            tmp = t_0 + ((vef * (-0.25d0)) * ((ndchar / kbt) + (nachar / kbt)))
        end if
        code = tmp
    end function
    
    public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
    	double t_0 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -7.2e+92) {
    		tmp = t_0;
    	} else if (KbT <= 1.02e+148) {
    		tmp = NaChar / (Math.exp((Vef / KbT)) + 1.0);
    	} else {
    		tmp = t_0 + ((Vef * -0.25) * ((NdChar / KbT) + (NaChar / KbT)));
    	}
    	return tmp;
    }
    
    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
    	t_0 = 0.5 * (NdChar + NaChar)
    	tmp = 0
    	if KbT <= -7.2e+92:
    		tmp = t_0
    	elif KbT <= 1.02e+148:
    		tmp = NaChar / (math.exp((Vef / KbT)) + 1.0)
    	else:
    		tmp = t_0 + ((Vef * -0.25) * ((NdChar / KbT) + (NaChar / KbT)))
    	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 <= -7.2e+92)
    		tmp = t_0;
    	elseif (KbT <= 1.02e+148)
    		tmp = Float64(NaChar / Float64(exp(Float64(Vef / KbT)) + 1.0));
    	else
    		tmp = Float64(t_0 + Float64(Float64(Vef * -0.25) * Float64(Float64(NdChar / KbT) + Float64(NaChar / KbT))));
    	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 <= -7.2e+92)
    		tmp = t_0;
    	elseif (KbT <= 1.02e+148)
    		tmp = NaChar / (exp((Vef / KbT)) + 1.0);
    	else
    		tmp = t_0 + ((Vef * -0.25) * ((NdChar / KbT) + (NaChar / KbT)));
    	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, -7.2e+92], t$95$0, If[LessEqual[KbT, 1.02e+148], N[(NaChar / N[(N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(N[(Vef * -0.25), $MachinePrecision] * N[(N[(NdChar / KbT), $MachinePrecision] + N[(NaChar / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
    \mathbf{if}\;KbT \leq -7.2 \cdot 10^{+92}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;KbT \leq 1.02 \cdot 10^{+148}:\\
    \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0 + \left(Vef \cdot -0.25\right) \cdot \left(\frac{NdChar}{KbT} + \frac{NaChar}{KbT}\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if KbT < -7.2e92

      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. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\left(\frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)\right)}{KbT}}}\right), \color{blue}{\left(\frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(\mathsf{neg}\left(mu\right)\right)}{KbT}}}\right)}\right) \]
      3. Simplified99.9%

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

        \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
      6. 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-+.f6456.4%

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

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

      if -7.2e92 < KbT < 1.02e148

      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. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

          \[\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(\mathsf{+.f64}\left(EDonor, mu\right), Ec\right)\right), KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right)\right)\right)\right)\right) \]
      7. Simplified64.8%

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \color{blue}{\left(e^{\frac{Vef}{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{Vef}{KbT}\right)\right)\right)\right) \]
        4. /-lowering-/.f6443.5%

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

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

      if 1.02e148 < 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. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{+.f64}\left(\left(\mathsf{neg}\left(\left(\frac{1}{4} \cdot \frac{NaChar \cdot \left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right)}{KbT} + \frac{1}{4} \cdot \frac{NdChar \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}{KbT}\right)\right)\right), \color{blue}{\left(\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar\right)}\right) \]
      7. Simplified42.6%

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

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

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

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

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

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

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, Vef\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(NaChar, KbT\right), \left(\frac{NdChar}{KbT}\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right)\right) \]
        6. /-lowering-/.f6462.0%

          \[\leadsto \mathsf{+.f64}\left(\mathsf{*.f64}\left(\mathsf{*.f64}\left(\frac{-1}{4}, Vef\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(NaChar, KbT\right), \mathsf{/.f64}\left(NdChar, KbT\right)\right)\right), \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, NdChar\right)\right)\right) \]
      10. Simplified62.0%

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

      \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -7.2 \cdot 10^{+92}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq 1.02 \cdot 10^{+148}:\\ \;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} + 1}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right) + \left(Vef \cdot -0.25\right) \cdot \left(\frac{NdChar}{KbT} + \frac{NaChar}{KbT}\right)\\ \end{array} \]
    5. Add Preprocessing

    Alternative 10: 36.1% accurate, 3.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(Vef + EDonor\right) + \left(mu - Ec\right)\\ t_1 := t\_0 \cdot t\_0\\ t_2 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -1.72 \cdot 10^{+75}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;KbT \leq 4.3 \cdot 10^{+55}:\\ \;\;\;\;\frac{NdChar}{2 + \frac{t\_0 + \frac{\frac{0.16666666666666666 \cdot \left(t\_0 \cdot t\_1\right)}{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 (+ (+ Vef EDonor) (- mu Ec)))
            (t_1 (* t_0 t_0))
            (t_2 (* 0.5 (+ NdChar NaChar))))
       (if (<= KbT -1.72e+75)
         t_2
         (if (<= KbT 4.3e+55)
           (/
            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 = (Vef + EDonor) + (mu - Ec);
    	double t_1 = t_0 * t_0;
    	double t_2 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -1.72e+75) {
    		tmp = t_2;
    	} else if (KbT <= 4.3e+55) {
    		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 = (vef + edonor) + (mu - ec)
        t_1 = t_0 * t_0
        t_2 = 0.5d0 * (ndchar + nachar)
        if (kbt <= (-1.72d+75)) then
            tmp = t_2
        else if (kbt <= 4.3d+55) 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 = (Vef + EDonor) + (mu - Ec);
    	double t_1 = t_0 * t_0;
    	double t_2 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -1.72e+75) {
    		tmp = t_2;
    	} else if (KbT <= 4.3e+55) {
    		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 = (Vef + EDonor) + (mu - Ec)
    	t_1 = t_0 * t_0
    	t_2 = 0.5 * (NdChar + NaChar)
    	tmp = 0
    	if KbT <= -1.72e+75:
    		tmp = t_2
    	elif KbT <= 4.3e+55:
    		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(Vef + EDonor) + Float64(mu - Ec))
    	t_1 = Float64(t_0 * t_0)
    	t_2 = Float64(0.5 * Float64(NdChar + NaChar))
    	tmp = 0.0
    	if (KbT <= -1.72e+75)
    		tmp = t_2;
    	elseif (KbT <= 4.3e+55)
    		tmp = Float64(NdChar / Float64(2.0 + Float64(Float64(t_0 + Float64(Float64(Float64(Float64(0.16666666666666666 * 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 = (Vef + EDonor) + (mu - Ec);
    	t_1 = t_0 * t_0;
    	t_2 = 0.5 * (NdChar + NaChar);
    	tmp = 0.0;
    	if (KbT <= -1.72e+75)
    		tmp = t_2;
    	elseif (KbT <= 4.3e+55)
    		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[(Vef + EDonor), $MachinePrecision] + N[(mu - Ec), $MachinePrecision]), $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, -1.72e+75], t$95$2, If[LessEqual[KbT, 4.3e+55], N[(NdChar / N[(2.0 + N[(N[(t$95$0 + N[(N[(N[(N[(0.16666666666666666 * N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision] / KbT), $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(Vef + EDonor\right) + \left(mu - Ec\right)\\
    t_1 := t\_0 \cdot t\_0\\
    t_2 := 0.5 \cdot \left(NdChar + NaChar\right)\\
    \mathbf{if}\;KbT \leq -1.72 \cdot 10^{+75}:\\
    \;\;\;\;t\_2\\
    
    \mathbf{elif}\;KbT \leq 4.3 \cdot 10^{+55}:\\
    \;\;\;\;\frac{NdChar}{2 + \frac{t\_0 + \frac{\frac{0.16666666666666666 \cdot \left(t\_0 \cdot t\_1\right)}{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 < -1.72e75 or 4.2999999999999999e55 < 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. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\left(\frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)\right)}{KbT}}}\right), \color{blue}{\left(\frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(\mathsf{neg}\left(mu\right)\right)}{KbT}}}\right)}\right) \]
      3. Simplified99.9%

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

        \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
      6. 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-+.f6452.9%

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

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

      if -1.72e75 < KbT < 4.2999999999999999e55

      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. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \left(2 + \left(\mathsf{neg}\left(\frac{-1 \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) + -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) \]
        2. unsub-negN/A

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(-1 \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) + -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), \color{blue}{KbT}\right)\right)\right) \]
      10. Simplified34.6%

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

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

    Alternative 11: 35.8% accurate, 5.3× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left(Vef + EDonor\right) + \left(mu - Ec\right)\\ t_1 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -4.7 \cdot 10^{+39}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;KbT \leq 5.2 \cdot 10^{+57}:\\ \;\;\;\;\frac{NdChar}{2 + \frac{t\_0 + \frac{-0.5 \cdot \left(t\_0 \cdot \left(\left(Ec - mu\right) - \left(Vef + EDonor\right)\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 (+ (+ Vef EDonor) (- mu Ec))) (t_1 (* 0.5 (+ NdChar NaChar))))
       (if (<= KbT -4.7e+39)
         t_1
         (if (<= KbT 5.2e+57)
           (/
            NdChar
            (+
             2.0
             (/
              (+ t_0 (/ (* -0.5 (* t_0 (- (- Ec mu) (+ Vef EDonor)))) 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 = (Vef + EDonor) + (mu - Ec);
    	double t_1 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -4.7e+39) {
    		tmp = t_1;
    	} else if (KbT <= 5.2e+57) {
    		tmp = NdChar / (2.0 + ((t_0 + ((-0.5 * (t_0 * ((Ec - mu) - (Vef + EDonor)))) / 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 = (vef + edonor) + (mu - ec)
        t_1 = 0.5d0 * (ndchar + nachar)
        if (kbt <= (-4.7d+39)) then
            tmp = t_1
        else if (kbt <= 5.2d+57) then
            tmp = ndchar / (2.0d0 + ((t_0 + (((-0.5d0) * (t_0 * ((ec - mu) - (vef + edonor)))) / 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 = (Vef + EDonor) + (mu - Ec);
    	double t_1 = 0.5 * (NdChar + NaChar);
    	double tmp;
    	if (KbT <= -4.7e+39) {
    		tmp = t_1;
    	} else if (KbT <= 5.2e+57) {
    		tmp = NdChar / (2.0 + ((t_0 + ((-0.5 * (t_0 * ((Ec - mu) - (Vef + EDonor)))) / KbT)) / KbT));
    	} else {
    		tmp = t_1;
    	}
    	return tmp;
    }
    
    def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
    	t_0 = (Vef + EDonor) + (mu - Ec)
    	t_1 = 0.5 * (NdChar + NaChar)
    	tmp = 0
    	if KbT <= -4.7e+39:
    		tmp = t_1
    	elif KbT <= 5.2e+57:
    		tmp = NdChar / (2.0 + ((t_0 + ((-0.5 * (t_0 * ((Ec - mu) - (Vef + EDonor)))) / KbT)) / KbT))
    	else:
    		tmp = t_1
    	return tmp
    
    function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = Float64(Float64(Vef + EDonor) + Float64(mu - Ec))
    	t_1 = Float64(0.5 * Float64(NdChar + NaChar))
    	tmp = 0.0
    	if (KbT <= -4.7e+39)
    		tmp = t_1;
    	elseif (KbT <= 5.2e+57)
    		tmp = Float64(NdChar / Float64(2.0 + Float64(Float64(t_0 + Float64(Float64(-0.5 * Float64(t_0 * Float64(Float64(Ec - mu) - Float64(Vef + EDonor)))) / 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 = (Vef + EDonor) + (mu - Ec);
    	t_1 = 0.5 * (NdChar + NaChar);
    	tmp = 0.0;
    	if (KbT <= -4.7e+39)
    		tmp = t_1;
    	elseif (KbT <= 5.2e+57)
    		tmp = NdChar / (2.0 + ((t_0 + ((-0.5 * (t_0 * ((Ec - mu) - (Vef + EDonor)))) / 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[(N[(Vef + EDonor), $MachinePrecision] + N[(mu - Ec), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -4.7e+39], t$95$1, If[LessEqual[KbT, 5.2e+57], N[(NdChar / N[(2.0 + N[(N[(t$95$0 + N[(N[(-0.5 * N[(t$95$0 * N[(N[(Ec - mu), $MachinePrecision] - N[(Vef + EDonor), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := \left(Vef + EDonor\right) + \left(mu - Ec\right)\\
    t_1 := 0.5 \cdot \left(NdChar + NaChar\right)\\
    \mathbf{if}\;KbT \leq -4.7 \cdot 10^{+39}:\\
    \;\;\;\;t\_1\\
    
    \mathbf{elif}\;KbT \leq 5.2 \cdot 10^{+57}:\\
    \;\;\;\;\frac{NdChar}{2 + \frac{t\_0 + \frac{-0.5 \cdot \left(t\_0 \cdot \left(\left(Ec - mu\right) - \left(Vef + EDonor\right)\right)\right)}{KbT}}{KbT}}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if KbT < -4.6999999999999999e39 or 5.2e57 < 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. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\left(\frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)\right)}{KbT}}}\right), \color{blue}{\left(\frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(\mathsf{neg}\left(mu\right)\right)}{KbT}}}\right)}\right) \]
      3. Simplified99.9%

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

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

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

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

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

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

      if -4.6999999999999999e39 < KbT < 5.2e57

      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. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\left(-1 \cdot \left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right) + \frac{-1}{2} \cdot \frac{{\left(\left(EDonor + \left(Vef + mu\right)\right) - Ec\right)}^{2}}{KbT}\right), \color{blue}{KbT}\right)\right)\right) \]
      10. Simplified33.6%

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

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

    Alternative 12: 32.4% accurate, 6.0× speedup?

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

          \[\leadsto \mathsf{+.f64}\left(\left(\frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)\right)}{KbT}}}\right), \color{blue}{\left(\frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(\mathsf{neg}\left(mu\right)\right)}{KbT}}}\right)}\right) \]
      3. Simplified99.9%

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

        \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
      6. 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.6%

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

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

      if -1.35000000000000002e39 < KbT < 1.69999999999999989e-157

      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. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(mu, KbT\right)\right)\right)\right) \]
      10. Simplified32.3%

        \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{mu}{KbT}}}} \]
      11. Taylor expanded in mu around 0

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(mu, \mathsf{+.f64}\left(\left(\frac{1}{2} \cdot \frac{mu}{{KbT}^{2}}\right), \color{blue}{\left(\frac{1}{KbT}\right)}\right)\right)\right)\right) \]
        4. associate-*r/N/A

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(mu, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, mu\right), \mathsf{*.f64}\left(KbT, KbT\right)\right), \left(\frac{1}{KbT}\right)\right)\right)\right)\right) \]
        9. /-lowering-/.f6425.9%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(mu, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, mu\right), \mathsf{*.f64}\left(KbT, KbT\right)\right), \mathsf{/.f64}\left(1, \color{blue}{KbT}\right)\right)\right)\right)\right) \]
      13. Simplified25.9%

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

      if 1.69999999999999989e-157 < KbT < 4.8999999999999998e-45

      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. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(EDonor, KbT\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right), \mathsf{/.f64}\left(mu, KbT\right)\right)\right), \mathsf{/.f64}\left(Ec, \color{blue}{KbT}\right)\right)\right) \]
      10. Simplified27.7%

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

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

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

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

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

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

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

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

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

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

    Alternative 13: 31.0% accurate, 6.9× speedup?

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

          \[\leadsto \mathsf{+.f64}\left(\left(\frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)\right)}{KbT}}}\right), \color{blue}{\left(\frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(\mathsf{neg}\left(mu\right)\right)}{KbT}}}\right)}\right) \]
      3. Simplified99.9%

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

        \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
      6. 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.6%

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

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

      if -7.19999999999999969e39 < KbT < 2.09999999999999987e-46

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(EDonor, KbT\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right), \mathsf{/.f64}\left(mu, KbT\right)\right)\right), \mathsf{/.f64}\left(Ec, \color{blue}{KbT}\right)\right)\right) \]
      10. Simplified22.4%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 14: 31.5% accurate, 6.9× speedup?

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

          \[\leadsto \mathsf{+.f64}\left(\left(\frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)\right)}{KbT}}}\right), \color{blue}{\left(\frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(\mathsf{neg}\left(mu\right)\right)}{KbT}}}\right)}\right) \]
      3. Simplified99.9%

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

        \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
      6. 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-+.f6448.3%

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

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

      if -7.99999999999999952e39 < KbT < 9.6000000000000002e-5

      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. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(2, \mathsf{/.f64}\left(EDonor, KbT\right)\right), \mathsf{+.f64}\left(\mathsf{/.f64}\left(Vef, KbT\right), \mathsf{/.f64}\left(mu, KbT\right)\right)\right), \mathsf{/.f64}\left(Ec, \color{blue}{KbT}\right)\right)\right) \]
      10. Simplified21.5%

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

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

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

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

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

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

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

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

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

    Alternative 15: 32.1% accurate, 8.5× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -2.15 \cdot 10^{+39}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 1.9 \cdot 10^{-80}:\\ \;\;\;\;\frac{NdChar}{2 + mu \cdot \left(\frac{1}{KbT} + \frac{mu \cdot 0.5}{KbT \cdot KbT}\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
    (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
     :precision binary64
     (let* ((t_0 (* 0.5 (+ NdChar NaChar))))
       (if (<= KbT -2.15e+39)
         t_0
         (if (<= KbT 1.9e-80)
           (/ NdChar (+ 2.0 (* mu (+ (/ 1.0 KbT) (/ (* mu 0.5) (* 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 <= -2.15e+39) {
    		tmp = t_0;
    	} else if (KbT <= 1.9e-80) {
    		tmp = NdChar / (2.0 + (mu * ((1.0 / KbT) + ((mu * 0.5) / (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 <= (-2.15d+39)) then
            tmp = t_0
        else if (kbt <= 1.9d-80) then
            tmp = ndchar / (2.0d0 + (mu * ((1.0d0 / kbt) + ((mu * 0.5d0) / (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 <= -2.15e+39) {
    		tmp = t_0;
    	} else if (KbT <= 1.9e-80) {
    		tmp = NdChar / (2.0 + (mu * ((1.0 / KbT) + ((mu * 0.5) / (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 <= -2.15e+39:
    		tmp = t_0
    	elif KbT <= 1.9e-80:
    		tmp = NdChar / (2.0 + (mu * ((1.0 / KbT) + ((mu * 0.5) / (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 <= -2.15e+39)
    		tmp = t_0;
    	elseif (KbT <= 1.9e-80)
    		tmp = Float64(NdChar / Float64(2.0 + Float64(mu * Float64(Float64(1.0 / KbT) + Float64(Float64(mu * 0.5) / Float64(KbT * KbT))))));
    	else
    		tmp = t_0;
    	end
    	return tmp
    end
    
    function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
    	t_0 = 0.5 * (NdChar + NaChar);
    	tmp = 0.0;
    	if (KbT <= -2.15e+39)
    		tmp = t_0;
    	elseif (KbT <= 1.9e-80)
    		tmp = NdChar / (2.0 + (mu * ((1.0 / KbT) + ((mu * 0.5) / (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, -2.15e+39], t$95$0, If[LessEqual[KbT, 1.9e-80], N[(NdChar / N[(2.0 + N[(mu * N[(N[(1.0 / KbT), $MachinePrecision] + N[(N[(mu * 0.5), $MachinePrecision] / N[(KbT * KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
    \mathbf{if}\;KbT \leq -2.15 \cdot 10^{+39}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;KbT \leq 1.9 \cdot 10^{-80}:\\
    \;\;\;\;\frac{NdChar}{2 + mu \cdot \left(\frac{1}{KbT} + \frac{mu \cdot 0.5}{KbT \cdot KbT}\right)}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if KbT < -2.15e39 or 1.89999999999999983e-80 < 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. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\left(\frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)\right)}{KbT}}}\right), \color{blue}{\left(\frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(\mathsf{neg}\left(mu\right)\right)}{KbT}}}\right)}\right) \]
      3. Simplified99.9%

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

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

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

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

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

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

      if -2.15e39 < KbT < 1.89999999999999983e-80

      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. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(mu, KbT\right)\right)\right)\right) \]
      10. Simplified31.1%

        \[\leadsto \frac{NdChar}{1 + e^{\color{blue}{\frac{mu}{KbT}}}} \]
      11. Taylor expanded in mu around 0

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(mu, \mathsf{+.f64}\left(\left(\frac{1}{2} \cdot \frac{mu}{{KbT}^{2}}\right), \color{blue}{\left(\frac{1}{KbT}\right)}\right)\right)\right)\right) \]
        4. associate-*r/N/A

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(mu, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, mu\right), \mathsf{*.f64}\left(KbT, KbT\right)\right), \left(\frac{1}{KbT}\right)\right)\right)\right)\right) \]
        9. /-lowering-/.f6424.3%

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(2, \mathsf{*.f64}\left(mu, \mathsf{+.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{1}{2}, mu\right), \mathsf{*.f64}\left(KbT, KbT\right)\right), \mathsf{/.f64}\left(1, \color{blue}{KbT}\right)\right)\right)\right)\right) \]
      13. Simplified24.3%

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

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

    Alternative 16: 28.7% accurate, 15.2× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -9.5 \cdot 10^{+38}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 1.45 \cdot 10^{-56}:\\ \;\;\;\;\frac{NdChar}{\frac{Vef}{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 -9.5e+38)
         t_0
         (if (<= KbT 1.45e-56) (/ NdChar (/ Vef 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 <= -9.5e+38) {
    		tmp = t_0;
    	} else if (KbT <= 1.45e-56) {
    		tmp = NdChar / (Vef / 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 <= (-9.5d+38)) then
            tmp = t_0
        else if (kbt <= 1.45d-56) then
            tmp = ndchar / (vef / 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 <= -9.5e+38) {
    		tmp = t_0;
    	} else if (KbT <= 1.45e-56) {
    		tmp = NdChar / (Vef / 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 <= -9.5e+38:
    		tmp = t_0
    	elif KbT <= 1.45e-56:
    		tmp = NdChar / (Vef / 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 <= -9.5e+38)
    		tmp = t_0;
    	elseif (KbT <= 1.45e-56)
    		tmp = Float64(NdChar / Float64(Vef / 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 <= -9.5e+38)
    		tmp = t_0;
    	elseif (KbT <= 1.45e-56)
    		tmp = NdChar / (Vef / 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, -9.5e+38], t$95$0, If[LessEqual[KbT, 1.45e-56], N[(NdChar / N[(Vef / KbT), $MachinePrecision]), $MachinePrecision], t$95$0]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
    \mathbf{if}\;KbT \leq -9.5 \cdot 10^{+38}:\\
    \;\;\;\;t\_0\\
    
    \mathbf{elif}\;KbT \leq 1.45 \cdot 10^{-56}:\\
    \;\;\;\;\frac{NdChar}{\frac{Vef}{KbT}}\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_0\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if KbT < -9.4999999999999995e38 or 1.44999999999999996e-56 < 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. Step-by-step derivation
        1. +-lowering-+.f64N/A

          \[\leadsto \mathsf{+.f64}\left(\left(\frac{NdChar}{1 + e^{\frac{\mathsf{neg}\left(\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)\right)}{KbT}}}\right), \color{blue}{\left(\frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(\mathsf{neg}\left(mu\right)\right)}{KbT}}}\right)}\right) \]
      3. Simplified99.9%

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

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

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

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

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

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

      if -9.4999999999999995e38 < KbT < 1.44999999999999996e-56

      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. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{/.f64}\left(Vef, \color{blue}{KbT}\right)\right) \]
      13. Simplified20.2%

        \[\leadsto \frac{NdChar}{\color{blue}{\frac{Vef}{KbT}}} \]
    3. Recombined 2 regimes into one program.
    4. Final simplification33.0%

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

    Alternative 17: 21.3% accurate, 17.6× speedup?

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \color{blue}{2}\right) \]
      9. Step-by-step derivation
        1. Simplified24.6%

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

        if -2.5000000000000001e-157 < NdChar < 2.79999999999999988e156

        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. Step-by-step derivation
          1. +-lowering-+.f64N/A

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

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

          \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
        6. 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-+.f6426.6%

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

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

          \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar} \]
        9. Step-by-step derivation
          1. *-lowering-*.f6425.4%

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{NaChar}\right) \]
        10. Simplified25.4%

          \[\leadsto \color{blue}{0.5 \cdot NaChar} \]
      10. Recombined 2 regimes into one program.
      11. Final simplification25.0%

        \[\leadsto \begin{array}{l} \mathbf{if}\;NdChar \leq -2.5 \cdot 10^{-157}:\\ \;\;\;\;\frac{NdChar}{2}\\ \mathbf{elif}\;NdChar \leq 2.8 \cdot 10^{+156}:\\ \;\;\;\;NaChar \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{2}\\ \end{array} \]
      12. Add Preprocessing

      Alternative 18: 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. Step-by-step derivation
        1. +-lowering-+.f64N/A

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

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

        \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
      6. 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-+.f6427.7%

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

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

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

      Alternative 19: 18.9% accurate, 76.3× speedup?

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

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

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

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

        \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
      6. 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-+.f6427.7%

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

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

        \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar} \]
      9. Step-by-step derivation
        1. *-lowering-*.f6418.4%

          \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{NaChar}\right) \]
      10. Simplified18.4%

        \[\leadsto \color{blue}{0.5 \cdot NaChar} \]
      11. Final simplification18.4%

        \[\leadsto NaChar \cdot 0.5 \]
      12. Add Preprocessing

      Reproduce

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