Bulmash initializePoisson

Percentage Accurate: 100.0% → 100.0%
Time: 19.3s
Alternatives: 22
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 22 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

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

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

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

Alternative 2: 77.7% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{NdChar}{1 + e^{\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\ \mathbf{if}\;Vef \leq -3.2 \cdot 10^{+148}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;Vef \leq 1.5 \cdot 10^{+92}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} + \frac{NaChar}{1 + {\left(e \cdot e\right)}^{\left(\frac{Vef + \left(\left(EAccept + Ev\right) - mu\right)}{KbT \cdot 2}\right)}}\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \end{array} \]
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
 :precision binary64
 (let* ((t_0
         (+
          (/ NdChar (+ 1.0 (exp (/ (+ Vef (+ mu (- EDonor Ec))) KbT))))
          (/ NaChar (+ 1.0 (exp (/ Vef KbT)))))))
   (if (<= Vef -3.2e+148)
     t_0
     (if (<= Vef 1.5e+92)
       (+
        (/ NdChar (+ 1.0 (exp (/ EDonor KbT))))
        (/
         NaChar
         (+ 1.0 (pow (* E E) (/ (+ Vef (- (+ EAccept Ev) mu)) (* KbT 2.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 / (1.0 + exp(((Vef + (mu + (EDonor - Ec))) / KbT)))) + (NaChar / (1.0 + exp((Vef / KbT))));
	double tmp;
	if (Vef <= -3.2e+148) {
		tmp = t_0;
	} else if (Vef <= 1.5e+92) {
		tmp = (NdChar / (1.0 + exp((EDonor / KbT)))) + (NaChar / (1.0 + pow((((double) M_E) * ((double) M_E)), ((Vef + ((EAccept + Ev) - mu)) / (KbT * 2.0)))));
	} else {
		tmp = t_0;
	}
	return tmp;
}
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 / (1.0 + Math.exp(((Vef + (mu + (EDonor - Ec))) / KbT)))) + (NaChar / (1.0 + Math.exp((Vef / KbT))));
	double tmp;
	if (Vef <= -3.2e+148) {
		tmp = t_0;
	} else if (Vef <= 1.5e+92) {
		tmp = (NdChar / (1.0 + Math.exp((EDonor / KbT)))) + (NaChar / (1.0 + Math.pow((Math.E * Math.E), ((Vef + ((EAccept + Ev) - mu)) / (KbT * 2.0)))));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
	t_0 = (NdChar / (1.0 + math.exp(((Vef + (mu + (EDonor - Ec))) / KbT)))) + (NaChar / (1.0 + math.exp((Vef / KbT))))
	tmp = 0
	if Vef <= -3.2e+148:
		tmp = t_0
	elif Vef <= 1.5e+92:
		tmp = (NdChar / (1.0 + math.exp((EDonor / KbT)))) + (NaChar / (1.0 + math.pow((math.e * math.e), ((Vef + ((EAccept + Ev) - mu)) / (KbT * 2.0)))))
	else:
		tmp = t_0
	return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
	t_0 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Vef + Float64(mu + Float64(EDonor - Ec))) / KbT)))) + Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT)))))
	tmp = 0.0
	if (Vef <= -3.2e+148)
		tmp = t_0;
	elseif (Vef <= 1.5e+92)
		tmp = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT)))) + Float64(NaChar / Float64(1.0 + (Float64(exp(1) * exp(1)) ^ Float64(Float64(Vef + Float64(Float64(EAccept + Ev) - mu)) / Float64(KbT * 2.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 / (1.0 + exp(((Vef + (mu + (EDonor - Ec))) / KbT)))) + (NaChar / (1.0 + exp((Vef / KbT))));
	tmp = 0.0;
	if (Vef <= -3.2e+148)
		tmp = t_0;
	elseif (Vef <= 1.5e+92)
		tmp = (NdChar / (1.0 + exp((EDonor / KbT)))) + (NaChar / (1.0 + ((2.71828182845904523536 * 2.71828182845904523536) ^ ((Vef + ((EAccept + Ev) - mu)) / (KbT * 2.0)))));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(Vef + N[(mu + N[(EDonor - Ec), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Vef, -3.2e+148], t$95$0, If[LessEqual[Vef, 1.5e+92], N[(N[(NdChar / N[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Power[N[(E * E), $MachinePrecision], N[(N[(Vef + N[(N[(EAccept + Ev), $MachinePrecision] - mu), $MachinePrecision]), $MachinePrecision] / N[(KbT * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Vef < -3.1999999999999999e148 or 1.50000000000000007e92 < Vef

    1. Initial program 100.0%

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

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

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

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

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

    if -3.1999999999999999e148 < Vef < 1.50000000000000007e92

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \left({\left(e^{1}\right)}^{\left(\frac{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}}{2}\right)} \cdot \color{blue}{{\left(e^{1}\right)}^{\left(\frac{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}}{2}\right)}}\right)\right)\right)\right) \]
      2. pow-prod-downN/A

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

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\left(e^{1}\right), \left(e^{1}\right)\right), \left(\frac{\color{blue}{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}}}{2}\right)\right)\right)\right)\right) \]
      5. exp-1-eN/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{E.f64}\left(\right), \left(e^{1}\right)\right), \left(\frac{\frac{\color{blue}{Vef + \left(EAccept + \left(Ev - mu\right)\right)}}{KbT}}{2}\right)\right)\right)\right)\right) \]
      7. exp-1-eN/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{E.f64}\left(\right), \mathsf{E.f64}\left(\right)\right), \left(\frac{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{\color{blue}{KbT}}}{2}\right)\right)\right)\right)\right) \]
      9. associate-/l/N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{E.f64}\left(\right), \mathsf{E.f64}\left(\right)\right), \left(\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{\color{blue}{2 \cdot KbT}}\right)\right)\right)\right)\right) \]
      10. /-lowering-/.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{E.f64}\left(\right), \mathsf{E.f64}\left(\right)\right), \mathsf{/.f64}\left(\left(Vef + \left(EAccept + \left(Ev - mu\right)\right)\right), \color{blue}{\left(2 \cdot KbT\right)}\right)\right)\right)\right)\right) \]
      11. +-lowering-+.f64N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{E.f64}\left(\right), \mathsf{E.f64}\left(\right)\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \left(EAccept + \left(Ev - mu\right)\right)\right), \left(\color{blue}{2} \cdot KbT\right)\right)\right)\right)\right)\right) \]
      12. associate-+r-N/A

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{E.f64}\left(\right), \mathsf{E.f64}\left(\right)\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \left(\left(EAccept + Ev\right) - mu\right)\right), \left(2 \cdot KbT\right)\right)\right)\right)\right)\right) \]
      13. --lowering--.f64N/A

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

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{E.f64}\left(\right), \mathsf{E.f64}\left(\right)\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), mu\right)\right), \left(2 \cdot KbT\right)\right)\right)\right)\right)\right) \]
      15. *-lowering-*.f6476.6%

        \[\leadsto \mathsf{+.f64}\left(\mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(EDonor, KbT\right)\right)\right)\right), \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{pow.f64}\left(\mathsf{*.f64}\left(\mathsf{E.f64}\left(\right), \mathsf{E.f64}\left(\right)\right), \mathsf{/.f64}\left(\mathsf{+.f64}\left(Vef, \mathsf{\_.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), mu\right)\right), \mathsf{*.f64}\left(2, \color{blue}{KbT}\right)\right)\right)\right)\right)\right) \]
    10. Applied egg-rr76.6%

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

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

Alternative 3: 77.7% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Vef < -2.09999999999999989e145 or 2.64999999999999998e91 < Vef

    1. Initial program 100.0%

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

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

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

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

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

    if -2.09999999999999989e145 < Vef < 2.64999999999999998e91

    1. Initial program 99.9%

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

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

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

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

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

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

Alternative 4: 76.6% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Vef < -1.10000000000000003e151 or 2.3000000000000002e93 < Vef

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.10000000000000003e151 < Vef < 2.3000000000000002e93

    1. Initial program 99.9%

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

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

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

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

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

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

Alternative 5: 67.7% accurate, 1.0× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if mu < -2.7500000000000001e157 or 2.6000000000000002e32 < mu

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -2.7500000000000001e157 < mu < 2.6000000000000002e32

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 6: 42.0% accurate, 1.8× speedup?

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

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

\mathbf{elif}\;mu \leq -9.2 \cdot 10^{-130}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;mu \leq 5.2 \cdot 10^{-117}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\

\mathbf{elif}\;mu \leq 2.6 \cdot 10^{+32}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if mu < -2.2199999999999999e142 or 2.6000000000000002e32 < mu

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{*.f64}\left(-1, \left(\frac{mu}{KbT}\right)\right)\right)\right)\right) \]
      2. /-lowering-/.f6452.4%

        \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{*.f64}\left(-1, \mathsf{/.f64}\left(mu, KbT\right)\right)\right)\right)\right) \]
    9. Simplified52.4%

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

    if -2.2199999999999999e142 < mu < -9.2000000000000005e-130 or 5.19999999999999966e-117 < mu < 2.6000000000000002e32

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

    if -9.2000000000000005e-130 < mu < 5.19999999999999966e-117

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;mu \leq -2.22 \cdot 10^{+142}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{mu}{0 - KbT}}}\\ \mathbf{elif}\;mu \leq -9.2 \cdot 10^{-130}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\ \mathbf{elif}\;mu \leq 5.2 \cdot 10^{-117}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\ \mathbf{elif}\;mu \leq 2.6 \cdot 10^{+32}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{mu}{0 - KbT}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 39.6% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\
t_1 := \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\
\mathbf{if}\;Ev \leq -9.4 \cdot 10^{+120}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{KbT}}}\\

\mathbf{elif}\;Ev \leq -0.0148:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;Ev \leq -3.7 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;Ev \leq 3.25 \cdot 10^{-293}:\\
\;\;\;\;t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if Ev < -9.39999999999999987e120

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -9.39999999999999987e120 < Ev < -0.014800000000000001 or -3.6999999999999998e-72 < Ev < 3.25000000000000017e-293

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -0.014800000000000001 < Ev < -3.6999999999999998e-72 or 3.25000000000000017e-293 < Ev

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

Alternative 8: 68.8% accurate, 1.9× speedup?

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

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if NaChar < -1.35e-107 or 1.6999999999999999e-81 < NaChar

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.35e-107 < NaChar < 1.6999999999999999e-81

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \mathsf{/.f64}\left(NdChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(Vef + EDonor\right), \left(mu + -1 \cdot Ec\right)\right), KbT\right)\right)\right)\right) \]
      12. +-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(Vef, EDonor\right), \left(mu + -1 \cdot Ec\right)\right), KbT\right)\right)\right)\right) \]
      13. mul-1-negN/A

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

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

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

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

Alternative 9: 62.8% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;KbT \leq -2.8 \cdot 10^{+191}:\\
\;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\

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

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


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

    1. Initial program 99.9%

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

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

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

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

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

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

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

    if -2.7999999999999999e191 < KbT < 2.00000000000000003e205

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 2.00000000000000003e205 < KbT

    1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

    Alternative 10: 43.9% accurate, 1.9× speedup?

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

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -1.84999999999999997e145 < Vef < 2.4499999999999998e-236

      1. Initial program 99.9%

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

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

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

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

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

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

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

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

        if 2.4499999999999998e-236 < Vef < 6.29999999999999973e25

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;Vef \leq -1.85 \cdot 10^{+145}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\ \mathbf{elif}\;Vef \leq 2.45 \cdot 10^{-236}:\\ \;\;\;\;\frac{NdChar}{2} + \frac{NaChar}{1 + e^{\frac{mu}{0 - KbT}}}\\ \mathbf{elif}\;Vef \leq 6.3 \cdot 10^{+25}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\ \end{array} \]
      8. Add Preprocessing

      Alternative 11: 40.7% accurate, 1.9× speedup?

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

        1. Initial program 100.0%

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

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

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

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

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

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

          \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
        7. Step-by-step derivation
          1. flip-+N/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \left(\frac{NaChar \cdot NaChar - NdChar \cdot NdChar}{\color{blue}{NaChar - NdChar}}\right)\right) \]
          2. clear-numN/A

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

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(NaChar, NdChar\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \mathsf{*.f64}\left(NdChar, \color{blue}{NdChar}\right)\right)\right)\right)\right) \]
        8. Applied egg-rr40.3%

          \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{NaChar - NdChar}{NaChar \cdot NaChar - NdChar \cdot NdChar}}} \]
        9. Step-by-step derivation
          1. associate-/r/N/A

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

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

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(NaChar, NdChar\right)\right), \left(\frac{NaChar \cdot NaChar - NdChar \cdot NdChar}{NaChar - NdChar}\right)\right), \left(NaChar - NdChar\right)\right)\right) \]
          9. flip-+N/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(NaChar, NdChar\right)\right), \left(NaChar + NdChar\right)\right), \left(NaChar - NdChar\right)\right)\right) \]
          10. +-commutativeN/A

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(NaChar, NdChar\right)\right), \mathsf{+.f64}\left(NdChar, NaChar\right)\right), \left(NaChar - NdChar\right)\right)\right) \]
          12. --lowering--.f6471.3%

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(NaChar, NdChar\right)\right), \mathsf{+.f64}\left(NdChar, NaChar\right)\right), \mathsf{\_.f64}\left(NaChar, \color{blue}{NdChar}\right)\right)\right) \]
        10. Applied egg-rr71.3%

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

        if -3.4999999999999999e148 < KbT < 2.8000000000000001e-157

        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 2.8000000000000001e-157 < KbT < 1.60000000000000003e206

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.60000000000000003e206 < KbT

        1. Initial program 100.0%

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

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

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

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

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

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

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -3.5 \cdot 10^{+148}:\\ \;\;\;\;0.5 \cdot \left(\left(NaChar - NdChar\right) \cdot \left(\left(NdChar + NaChar\right) \cdot \frac{1}{NaChar - NdChar}\right)\right)\\ \mathbf{elif}\;KbT \leq 2.8 \cdot 10^{-157}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\ \mathbf{elif}\;KbT \leq 1.6 \cdot 10^{+206}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 12: 43.0% accurate, 2.0× speedup?

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

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if -1.65000000000000013e145 < Vef < 9.60000000000000018e26

        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 13: 39.9% accurate, 2.0× speedup?

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

        1. Initial program 100.0%

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

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

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

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

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

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

          \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
        7. Step-by-step derivation
          1. flip-+N/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \left(\frac{NaChar \cdot NaChar - NdChar \cdot NdChar}{\color{blue}{NaChar - NdChar}}\right)\right) \]
          2. clear-numN/A

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

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(NaChar, NdChar\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \mathsf{*.f64}\left(NdChar, \color{blue}{NdChar}\right)\right)\right)\right)\right) \]
        8. Applied egg-rr40.3%

          \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{NaChar - NdChar}{NaChar \cdot NaChar - NdChar \cdot NdChar}}} \]
        9. Step-by-step derivation
          1. associate-/r/N/A

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

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

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(NaChar, NdChar\right)\right), \left(\frac{NaChar \cdot NaChar - NdChar \cdot NdChar}{NaChar - NdChar}\right)\right), \left(NaChar - NdChar\right)\right)\right) \]
          9. flip-+N/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(NaChar, NdChar\right)\right), \left(NaChar + NdChar\right)\right), \left(NaChar - NdChar\right)\right)\right) \]
          10. +-commutativeN/A

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(NaChar, NdChar\right)\right), \mathsf{+.f64}\left(NdChar, NaChar\right)\right), \left(NaChar - NdChar\right)\right)\right) \]
          12. --lowering--.f6471.3%

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{*.f64}\left(\mathsf{*.f64}\left(\mathsf{/.f64}\left(1, \mathsf{\_.f64}\left(NaChar, NdChar\right)\right), \mathsf{+.f64}\left(NdChar, NaChar\right)\right), \mathsf{\_.f64}\left(NaChar, \color{blue}{NdChar}\right)\right)\right) \]
        10. Applied egg-rr71.3%

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

        if -3.60000000000000006e148 < KbT < 1.99999999999999997e-170

        1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 1.99999999999999997e-170 < KbT < 2.89999999999999987e97

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 2.89999999999999987e97 < KbT

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

      Alternative 14: 36.1% accurate, 5.3× speedup?

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

        1. Initial program 99.9%

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

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

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

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

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

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

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

        if -0.010800000000000001 < KbT < 3.60000000000000013e96

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 15: 30.8% accurate, 7.1× speedup?

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

        1. Initial program 99.9%

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

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

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

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

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

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

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

        if -0.00949999999999999976 < KbT < -1.45e-213

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\frac{-1}{2} \cdot \frac{{Ev}^{2}}{KbT}\right), Ev\right), KbT\right)\right)\right) \]
          9. associate-*r/N/A

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(Ev \cdot Ev\right)\right), KbT\right), Ev\right), KbT\right)\right)\right) \]
          13. *-lowering-*.f6417.6%

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

          \[\leadsto \frac{NaChar}{\color{blue}{2 - \frac{\frac{-0.5 \cdot \left(Ev \cdot Ev\right)}{KbT} - Ev}{KbT}}} \]

        if -1.45e-213 < KbT < 4.4999999999999998e-101

        1. Initial program 100.0%

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

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

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

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

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

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

          \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
        7. Step-by-step derivation
          1. flip-+N/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \left(\frac{NaChar \cdot NaChar - NdChar \cdot NdChar}{\color{blue}{NaChar - NdChar}}\right)\right) \]
          2. clear-numN/A

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(NaChar, NdChar\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \left(\color{blue}{NdChar} \cdot NdChar\right)\right)\right)\right)\right) \]
          8. *-lowering-*.f648.8%

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(NaChar, NdChar\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \mathsf{*.f64}\left(NdChar, \color{blue}{NdChar}\right)\right)\right)\right)\right) \]
        8. Applied egg-rr8.8%

          \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{NaChar - NdChar}{NaChar \cdot NaChar - NdChar \cdot NdChar}}} \]
        9. Taylor expanded in NdChar around -inf

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \left(-1 \cdot \frac{-1 \cdot NaChar + \frac{{NaChar}^{2}}{NdChar}}{NdChar} - 1\right)}{\color{blue}{NdChar}}\right)\right)\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \left(-1 \cdot \frac{-1 \cdot NaChar + \frac{{NaChar}^{2}}{NdChar}}{NdChar} + \left(\mathsf{neg}\left(1\right)\right)\right)}{NdChar}\right)\right)\right) \]
          3. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \left(-1 \cdot \frac{-1 \cdot NaChar + \frac{{NaChar}^{2}}{NdChar}}{NdChar} + -1\right)}{NdChar}\right)\right)\right) \]
          4. distribute-lft-inN/A

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \frac{-1 \cdot \left(-1 \cdot NaChar + \frac{{NaChar}^{2}}{NdChar}\right)}{NdChar} + -1 \cdot -1}{NdChar}\right)\right)\right) \]
          6. distribute-lft-inN/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \frac{-1 \cdot \left(-1 \cdot NaChar\right) + -1 \cdot \frac{{NaChar}^{2}}{NdChar}}{NdChar} + -1 \cdot -1}{NdChar}\right)\right)\right) \]
          7. neg-mul-1N/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \frac{\left(\mathsf{neg}\left(-1 \cdot NaChar\right)\right) + -1 \cdot \frac{{NaChar}^{2}}{NdChar}}{NdChar} + -1 \cdot -1}{NdChar}\right)\right)\right) \]
          8. mul-1-negN/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \frac{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(NaChar\right)\right)\right)\right) + -1 \cdot \frac{{NaChar}^{2}}{NdChar}}{NdChar} + -1 \cdot -1}{NdChar}\right)\right)\right) \]
          9. remove-double-negN/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \frac{NaChar + -1 \cdot \frac{{NaChar}^{2}}{NdChar}}{NdChar} + -1 \cdot -1}{NdChar}\right)\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \frac{NaChar + -1 \cdot \frac{{NaChar}^{2}}{NdChar}}{NdChar} + 1}{NdChar}\right)\right)\right) \]
          11. +-commutativeN/A

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(1 + -1 \cdot \frac{NaChar + -1 \cdot \frac{{NaChar}^{2}}{NdChar}}{NdChar}\right), \color{blue}{NdChar}\right)\right)\right) \]
        11. Simplified25.1%

          \[\leadsto 0.5 \cdot \frac{1}{\color{blue}{\frac{1 - \frac{NaChar - \frac{NaChar \cdot NaChar}{NdChar}}{NdChar}}{NdChar}}} \]
      3. Recombined 3 regimes into one program.
      4. Final simplification33.8%

        \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -0.0095:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq -1.45 \cdot 10^{-213}:\\ \;\;\;\;\frac{NaChar}{2 - \frac{\frac{-0.5 \cdot \left(Ev \cdot Ev\right)}{KbT} - Ev}{KbT}}\\ \mathbf{elif}\;KbT \leq 4.5 \cdot 10^{-101}:\\ \;\;\;\;0.5 \cdot \frac{1}{\frac{1 + \frac{\frac{NaChar \cdot NaChar}{NdChar} - NaChar}{NdChar}}{NdChar}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 16: 32.8% accurate, 8.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{if}\;KbT \leq -0.0019:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;KbT \leq 5.4 \cdot 10^{-162}:\\ \;\;\;\;\frac{NaChar}{2 + Ev \cdot \left(\frac{1}{KbT} + 0.5 \cdot \frac{Ev}{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 -0.0019)
           t_0
           (if (<= KbT 5.4e-162)
             (/ NaChar (+ 2.0 (* Ev (+ (/ 1.0 KbT) (* 0.5 (/ Ev (* 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 <= -0.0019) {
      		tmp = t_0;
      	} else if (KbT <= 5.4e-162) {
      		tmp = NaChar / (2.0 + (Ev * ((1.0 / KbT) + (0.5 * (Ev / (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 <= (-0.0019d0)) then
              tmp = t_0
          else if (kbt <= 5.4d-162) then
              tmp = nachar / (2.0d0 + (ev * ((1.0d0 / kbt) + (0.5d0 * (ev / (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 <= -0.0019) {
      		tmp = t_0;
      	} else if (KbT <= 5.4e-162) {
      		tmp = NaChar / (2.0 + (Ev * ((1.0 / KbT) + (0.5 * (Ev / (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 <= -0.0019:
      		tmp = t_0
      	elif KbT <= 5.4e-162:
      		tmp = NaChar / (2.0 + (Ev * ((1.0 / KbT) + (0.5 * (Ev / (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 <= -0.0019)
      		tmp = t_0;
      	elseif (KbT <= 5.4e-162)
      		tmp = Float64(NaChar / Float64(2.0 + Float64(Ev * Float64(Float64(1.0 / KbT) + Float64(0.5 * Float64(Ev / 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 <= -0.0019)
      		tmp = t_0;
      	elseif (KbT <= 5.4e-162)
      		tmp = NaChar / (2.0 + (Ev * ((1.0 / KbT) + (0.5 * (Ev / (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, -0.0019], t$95$0, If[LessEqual[KbT, 5.4e-162], N[(NaChar / N[(2.0 + N[(Ev * N[(N[(1.0 / KbT), $MachinePrecision] + N[(0.5 * N[(Ev / N[(KbT * KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
      \mathbf{if}\;KbT \leq -0.0019:\\
      \;\;\;\;t\_0\\
      
      \mathbf{elif}\;KbT \leq 5.4 \cdot 10^{-162}:\\
      \;\;\;\;\frac{NaChar}{2 + Ev \cdot \left(\frac{1}{KbT} + 0.5 \cdot \frac{Ev}{KbT \cdot KbT}\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_0\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if KbT < -0.0019 or 5.39999999999999968e-162 < KbT

        1. Initial program 99.9%

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

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

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

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

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

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

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

        if -0.0019 < KbT < 5.39999999999999968e-162

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      Alternative 17: 31.4% accurate, 8.5× speedup?

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

        1. Initial program 99.9%

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

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

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

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

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

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

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

        if -4.2000000000000002e-70 < KbT < 3.00000000000000006e56

        1. Initial program 100.0%

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

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

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

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

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

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

          \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
        7. Step-by-step derivation
          1. flip-+N/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \left(\frac{NaChar \cdot NaChar - NdChar \cdot NdChar}{\color{blue}{NaChar - NdChar}}\right)\right) \]
          2. clear-numN/A

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(NaChar, NdChar\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \left(\color{blue}{NdChar} \cdot NdChar\right)\right)\right)\right)\right) \]
          8. *-lowering-*.f648.0%

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(NaChar, NdChar\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \mathsf{*.f64}\left(NdChar, \color{blue}{NdChar}\right)\right)\right)\right)\right) \]
        8. Applied egg-rr8.0%

          \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{NaChar - NdChar}{NaChar \cdot NaChar - NdChar \cdot NdChar}}} \]
        9. Taylor expanded in NaChar around -inf

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \left(-1 \cdot \frac{-1 \cdot NdChar + \frac{{NdChar}^{2}}{NaChar}}{NaChar} - 1\right)}{\color{blue}{NaChar}}\right)\right)\right) \]
          2. sub-negN/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \left(-1 \cdot \frac{-1 \cdot NdChar + \frac{{NdChar}^{2}}{NaChar}}{NaChar} + \left(\mathsf{neg}\left(1\right)\right)\right)}{NaChar}\right)\right)\right) \]
          3. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \left(-1 \cdot \frac{-1 \cdot NdChar + \frac{{NdChar}^{2}}{NaChar}}{NaChar} + -1\right)}{NaChar}\right)\right)\right) \]
          4. distribute-lft-inN/A

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \frac{-1 \cdot \left(-1 \cdot NdChar + \frac{{NdChar}^{2}}{NaChar}\right)}{NaChar} + -1 \cdot -1}{NaChar}\right)\right)\right) \]
          6. distribute-lft-inN/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \frac{-1 \cdot \left(-1 \cdot NdChar\right) + -1 \cdot \frac{{NdChar}^{2}}{NaChar}}{NaChar} + -1 \cdot -1}{NaChar}\right)\right)\right) \]
          7. neg-mul-1N/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \frac{\left(\mathsf{neg}\left(-1 \cdot NdChar\right)\right) + -1 \cdot \frac{{NdChar}^{2}}{NaChar}}{NaChar} + -1 \cdot -1}{NaChar}\right)\right)\right) \]
          8. mul-1-negN/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \frac{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(NdChar\right)\right)\right)\right) + -1 \cdot \frac{{NdChar}^{2}}{NaChar}}{NaChar} + -1 \cdot -1}{NaChar}\right)\right)\right) \]
          9. remove-double-negN/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \frac{NdChar + -1 \cdot \frac{{NdChar}^{2}}{NaChar}}{NaChar} + -1 \cdot -1}{NaChar}\right)\right)\right) \]
          10. metadata-evalN/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \left(\frac{-1 \cdot \frac{NdChar + -1 \cdot \frac{{NdChar}^{2}}{NaChar}}{NaChar} + 1}{NaChar}\right)\right)\right) \]
          11. +-commutativeN/A

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\left(1 + -1 \cdot \frac{NdChar + -1 \cdot \frac{{NdChar}^{2}}{NaChar}}{NaChar}\right), \color{blue}{NaChar}\right)\right)\right) \]
        11. Simplified20.6%

          \[\leadsto 0.5 \cdot \frac{1}{\color{blue}{\frac{1 - \frac{NdChar - \frac{NdChar \cdot NdChar}{NaChar}}{NaChar}}{NaChar}}} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification33.5%

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

      Alternative 18: 29.6% accurate, 8.8× speedup?

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

        1. Initial program 99.9%

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

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

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

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

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

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

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

        if -0.23599999999999999 < KbT < -1.19999999999999998e-213

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\left(\frac{-1}{2} \cdot \frac{{Ev}^{2}}{KbT}\right), Ev\right), KbT\right)\right)\right) \]
          9. associate-*r/N/A

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{\_.f64}\left(2, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(\mathsf{/.f64}\left(\mathsf{*.f64}\left(\frac{-1}{2}, \left(Ev \cdot Ev\right)\right), KbT\right), Ev\right), KbT\right)\right)\right) \]
          13. *-lowering-*.f6417.6%

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

          \[\leadsto \frac{NaChar}{\color{blue}{2 - \frac{\frac{-0.5 \cdot \left(Ev \cdot Ev\right)}{KbT} - Ev}{KbT}}} \]

        if -1.19999999999999998e-213 < KbT < 2.05000000000000001e-201

        1. Initial program 100.0%

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

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

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

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

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

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

          \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
        7. Step-by-step derivation
          1. flip-+N/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \left(\frac{NaChar \cdot NaChar - NdChar \cdot NdChar}{\color{blue}{NaChar - NdChar}}\right)\right) \]
          2. clear-numN/A

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(NaChar, NdChar\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \left(\color{blue}{NdChar} \cdot NdChar\right)\right)\right)\right)\right) \]
          8. *-lowering-*.f649.4%

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(NaChar, NdChar\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \mathsf{*.f64}\left(NdChar, \color{blue}{NdChar}\right)\right)\right)\right)\right) \]
        8. Applied egg-rr9.4%

          \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{NaChar - NdChar}{NaChar \cdot NaChar - NdChar \cdot NdChar}}} \]
        9. Taylor expanded in NaChar around 0

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(NaChar, NdChar\right), \left(\mathsf{neg}\left({NdChar}^{2}\right)\right)\right)\right)\right) \]
          2. neg-sub0N/A

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

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(NaChar, NdChar\right), \mathsf{\_.f64}\left(0, \left(NdChar \cdot \color{blue}{NdChar}\right)\right)\right)\right)\right) \]
          5. *-lowering-*.f6428.7%

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(NaChar, NdChar\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(NdChar, \color{blue}{NdChar}\right)\right)\right)\right)\right) \]
        11. Simplified28.7%

          \[\leadsto 0.5 \cdot \frac{1}{\frac{NaChar - NdChar}{\color{blue}{0 - NdChar \cdot NdChar}}} \]
      3. Recombined 3 regimes into one program.
      4. Final simplification33.0%

        \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -0.236:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \mathbf{elif}\;KbT \leq -1.2 \cdot 10^{-213}:\\ \;\;\;\;\frac{NaChar}{2 - \frac{\frac{-0.5 \cdot \left(Ev \cdot Ev\right)}{KbT} - Ev}{KbT}}\\ \mathbf{elif}\;KbT \leq 2.05 \cdot 10^{-201}:\\ \;\;\;\;0.5 \cdot \frac{1}{\frac{NdChar - NaChar}{NdChar \cdot NdChar}}\\ \mathbf{else}:\\ \;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\ \end{array} \]
      5. Add Preprocessing

      Alternative 19: 28.7% accurate, 10.9× speedup?

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

        1. Initial program 100.0%

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

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

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

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

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

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

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

        if -4.1500000000000002e-193 < KbT < 5.7000000000000001e-201

        1. Initial program 100.0%

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

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

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

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

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

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

          \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
        7. Step-by-step derivation
          1. flip-+N/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \left(\frac{NaChar \cdot NaChar - NdChar \cdot NdChar}{\color{blue}{NaChar - NdChar}}\right)\right) \]
          2. clear-numN/A

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

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

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

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

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

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(NaChar, NdChar\right), \mathsf{\_.f64}\left(\mathsf{*.f64}\left(NaChar, NaChar\right), \mathsf{*.f64}\left(NdChar, \color{blue}{NdChar}\right)\right)\right)\right)\right) \]
        8. Applied egg-rr9.3%

          \[\leadsto 0.5 \cdot \color{blue}{\frac{1}{\frac{NaChar - NdChar}{NaChar \cdot NaChar - NdChar \cdot NdChar}}} \]
        9. Taylor expanded in NaChar around 0

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(NaChar, NdChar\right), \left(\mathsf{neg}\left({NdChar}^{2}\right)\right)\right)\right)\right) \]
          2. neg-sub0N/A

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

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

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(NaChar, NdChar\right), \mathsf{\_.f64}\left(0, \left(NdChar \cdot \color{blue}{NdChar}\right)\right)\right)\right)\right) \]
          5. *-lowering-*.f6428.1%

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{/.f64}\left(1, \mathsf{/.f64}\left(\mathsf{\_.f64}\left(NaChar, NdChar\right), \mathsf{\_.f64}\left(0, \mathsf{*.f64}\left(NdChar, \color{blue}{NdChar}\right)\right)\right)\right)\right) \]
        11. Simplified28.1%

          \[\leadsto 0.5 \cdot \frac{1}{\frac{NaChar - NdChar}{\color{blue}{0 - NdChar \cdot NdChar}}} \]
      3. Recombined 2 regimes into one program.
      4. Final simplification32.0%

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

      Alternative 20: 19.4% accurate, 17.6× speedup?

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

        1. Initial program 100.0%

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar} \]
        8. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto NdChar \cdot \color{blue}{\frac{1}{2}} \]
          2. *-lowering-*.f6423.5%

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

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

        if -1.38000000000000001e166 < Ev < 6.9999999999999998e-296

        1. Initial program 99.9%

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

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

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

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

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

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

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + \left(Ev + Vef\right)\right) - mu\right), KbT\right)\right)\right)\right) \]
          5. associate--l+N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) - mu\right)\right), KbT\right)\right)\right)\right) \]
          6. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(\left(Ev + Vef\right) + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
          7. associate-+r+N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
          8. mul-1-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(EAccept + \left(Ev + \left(Vef + -1 \cdot mu\right)\right)\right), KbT\right)\right)\right)\right) \]
          9. associate-+r+N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\left(\left(EAccept + Ev\right) + \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          10. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\left(EAccept + Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          11. +-lowering-+.f64N/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + -1 \cdot mu\right)\right), KbT\right)\right)\right)\right) \]
          12. mul-1-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef + \left(\mathsf{neg}\left(mu\right)\right)\right)\right), KbT\right)\right)\right)\right) \]
          13. sub-negN/A

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \left(Vef - mu\right)\right), KbT\right)\right)\right)\right) \]
          14. --lowering--.f6472.6%

            \[\leadsto \mathsf{/.f64}\left(NaChar, \mathsf{+.f64}\left(1, \mathsf{exp.f64}\left(\mathsf{/.f64}\left(\mathsf{+.f64}\left(\mathsf{+.f64}\left(EAccept, Ev\right), \mathsf{\_.f64}\left(Vef, mu\right)\right), KbT\right)\right)\right)\right) \]
        6. Simplified72.6%

          \[\leadsto \color{blue}{\frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) + \left(Vef - mu\right)}{KbT}}}} \]
        7. Taylor expanded in KbT around inf

          \[\leadsto \mathsf{/.f64}\left(NaChar, \color{blue}{2}\right) \]
        8. Step-by-step derivation
          1. Simplified25.8%

            \[\leadsto \frac{NaChar}{\color{blue}{2}} \]
        9. Recombined 2 regimes into one program.
        10. Add Preprocessing

        Alternative 21: 28.5% accurate, 45.8× speedup?

        \[\begin{array}{l} \\ 0.5 \cdot \left(NdChar + NaChar\right) \end{array} \]
        (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
         :precision binary64
         (* 0.5 (+ NdChar NaChar)))
        double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
        	return 0.5 * (NdChar + NaChar);
        }
        
        real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
            real(8), intent (in) :: ndchar
            real(8), intent (in) :: ec
            real(8), intent (in) :: vef
            real(8), intent (in) :: edonor
            real(8), intent (in) :: mu
            real(8), intent (in) :: kbt
            real(8), intent (in) :: nachar
            real(8), intent (in) :: ev
            real(8), intent (in) :: eaccept
            code = 0.5d0 * (ndchar + nachar)
        end function
        
        public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
        	return 0.5 * (NdChar + NaChar);
        }
        
        def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
        	return 0.5 * (NdChar + NaChar)
        
        function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
        	return Float64(0.5 * Float64(NdChar + NaChar))
        end
        
        function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
        	tmp = 0.5 * (NdChar + NaChar);
        end
        
        code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        0.5 \cdot \left(NdChar + NaChar\right)
        \end{array}
        
        Derivation
        1. Initial program 100.0%

          \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
        2. Simplified100.0%

          \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}}}} \]
        3. Add Preprocessing
        4. Taylor expanded in KbT around inf

          \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
        5. Step-by-step derivation
          1. distribute-lft-outN/A

            \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(NaChar + NdChar\right)} \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
          3. +-lowering-+.f6428.7%

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
        6. Simplified28.7%

          \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
        7. Final simplification28.7%

          \[\leadsto 0.5 \cdot \left(NdChar + NaChar\right) \]
        8. Add Preprocessing

        Alternative 22: 19.0% accurate, 76.3× speedup?

        \[\begin{array}{l} \\ NdChar \cdot 0.5 \end{array} \]
        (FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
         :precision binary64
         (* NdChar 0.5))
        double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
        	return NdChar * 0.5;
        }
        
        real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
            real(8), intent (in) :: ndchar
            real(8), intent (in) :: ec
            real(8), intent (in) :: vef
            real(8), intent (in) :: edonor
            real(8), intent (in) :: mu
            real(8), intent (in) :: kbt
            real(8), intent (in) :: nachar
            real(8), intent (in) :: ev
            real(8), intent (in) :: eaccept
            code = ndchar * 0.5d0
        end function
        
        public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
        	return NdChar * 0.5;
        }
        
        def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept):
        	return NdChar * 0.5
        
        function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
        	return Float64(NdChar * 0.5)
        end
        
        function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept)
        	tmp = NdChar * 0.5;
        end
        
        code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(NdChar * 0.5), $MachinePrecision]
        
        \begin{array}{l}
        
        \\
        NdChar \cdot 0.5
        \end{array}
        
        Derivation
        1. Initial program 100.0%

          \[\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}} \]
        2. Simplified100.0%

          \[\leadsto \color{blue}{\frac{NdChar}{1 + e^{\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}}}} \]
        3. Add Preprocessing
        4. Taylor expanded in KbT around inf

          \[\leadsto \color{blue}{\frac{1}{2} \cdot NaChar + \frac{1}{2} \cdot NdChar} \]
        5. Step-by-step derivation
          1. distribute-lft-outN/A

            \[\leadsto \frac{1}{2} \cdot \color{blue}{\left(NaChar + NdChar\right)} \]
          2. *-lowering-*.f64N/A

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \color{blue}{\left(NaChar + NdChar\right)}\right) \]
          3. +-lowering-+.f6428.7%

            \[\leadsto \mathsf{*.f64}\left(\frac{1}{2}, \mathsf{+.f64}\left(NaChar, \color{blue}{NdChar}\right)\right) \]
        6. Simplified28.7%

          \[\leadsto \color{blue}{0.5 \cdot \left(NaChar + NdChar\right)} \]
        7. Taylor expanded in NaChar around 0

          \[\leadsto \color{blue}{\frac{1}{2} \cdot NdChar} \]
        8. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto NdChar \cdot \color{blue}{\frac{1}{2}} \]
          2. *-lowering-*.f6418.4%

            \[\leadsto \mathsf{*.f64}\left(NdChar, \color{blue}{\frac{1}{2}}\right) \]
        9. Simplified18.4%

          \[\leadsto \color{blue}{NdChar \cdot 0.5} \]
        10. Add Preprocessing

        Reproduce

        ?
        herbie shell --seed 2024140 
        (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))))))