Bulmash initializePoisson

Percentage Accurate: 100.0% → 100.0%
Time: 25.6s
Alternatives: 28
Speedup: 1.0×

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 28 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

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

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

Alternative 1: 100.0% accurate, 1.0× speedup?

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

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

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

Alternative 2: 67.3% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;Vef \leq -1 \cdot 10^{-115}:\\
\;\;\;\;\frac{NaChar}{1 + t\_0} + \frac{NdChar}{\left(2 + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right) - \frac{Ec}{KbT}}\\

\mathbf{elif}\;Vef \leq -4.2 \cdot 10^{-188}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} + \frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\

\mathbf{elif}\;Vef \leq 100000000000:\\
\;\;\;\;\frac{NdChar}{1 + mu \cdot \left(\frac{1}{KbT} - \frac{\frac{Ec}{KbT} + \left(-1 - \left(\frac{Vef}{KbT} + \frac{EDonor}{KbT}\right)\right)}{mu}\right)} - \frac{NaChar}{-1 - t\_0}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if Vef < -1.64999999999999992e96 or 1e11 < 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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in Vef around inf 90.8%

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

      \[\leadsto \frac{NdChar}{1 + e^{\frac{Vef}{KbT}}} + \frac{NaChar}{\color{blue}{1 + e^{\frac{EAccept + \left(Ev + Vef\right)}{KbT}}}} \]
    6. Step-by-step derivation
      1. +-commutative46.0%

        \[\leadsto NdChar \cdot 0.5 + \frac{NaChar}{\color{blue}{e^{\frac{EAccept + \left(Ev + Vef\right)}{KbT}} + 1}} \]
      2. associate-+r+46.0%

        \[\leadsto NdChar \cdot 0.5 + \frac{NaChar}{e^{\frac{\color{blue}{\left(EAccept + Ev\right) + Vef}}{KbT}} + 1} \]
    7. Simplified85.6%

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

    if -1.64999999999999992e96 < Vef < -1.0000000000000001e-115

    1. Initial program 100.0%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+65.3%

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

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

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

    if -1.0000000000000001e-115 < Vef < -4.1999999999999998e-188

    1. Initial program 100.0%

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

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

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

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

    if -4.1999999999999998e-188 < Vef < 1e11

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 63.2%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+63.2%

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

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

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

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

Alternative 3: 77.6% accurate, 1.0× speedup?

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

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

\mathbf{elif}\;Vef \leq -8.5 \cdot 10^{-110}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} - \frac{NaChar}{-1 - t\_0}\\

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if Vef < -9.00000000000000033e95 or 1.80000000000000005e43 < 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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in Vef around inf 91.2%

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

    if -9.00000000000000033e95 < Vef < -8.50000000000000029e-110

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in EDonor around inf 78.3%

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

    if -8.50000000000000029e-110 < Vef < 1.80000000000000005e43

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in EAccept around inf 74.3%

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

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

Alternative 4: 75.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;Vef \leq -1.35 \cdot 10^{+96} \lor \neg \left(Vef \leq 1.2 \cdot 10^{+44}\right):\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{Vef}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{Vef + \left(Ev + EAccept\right)}{KbT}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Vef < -1.35000000000000011e96 or 1.20000000000000007e44 < 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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in Vef around inf 91.2%

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

      \[\leadsto \frac{NdChar}{1 + e^{\frac{Vef}{KbT}}} + \frac{NaChar}{\color{blue}{1 + e^{\frac{EAccept + \left(Ev + Vef\right)}{KbT}}}} \]
    6. Step-by-step derivation
      1. +-commutative45.4%

        \[\leadsto NdChar \cdot 0.5 + \frac{NaChar}{\color{blue}{e^{\frac{EAccept + \left(Ev + Vef\right)}{KbT}} + 1}} \]
      2. associate-+r+45.4%

        \[\leadsto NdChar \cdot 0.5 + \frac{NaChar}{e^{\frac{\color{blue}{\left(EAccept + Ev\right) + Vef}}{KbT}} + 1} \]
    7. Simplified86.6%

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

    if -1.35000000000000011e96 < Vef < 1.20000000000000007e44

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in EDonor around inf 76.9%

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

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

Alternative 5: 76.9% accurate, 1.0× speedup?

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

\\
\begin{array}{l}
t_0 := e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}\\
\mathbf{if}\;EDonor \leq -90000 \lor \neg \left(EDonor \leq 14600000000\right):\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} - \frac{NaChar}{-1 - t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{1 + t\_0} + \frac{NdChar}{1 + e^{\frac{Vef}{KbT}}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if EDonor < -9e4 or 1.46e10 < EDonor

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in EDonor around inf 82.9%

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

    if -9e4 < EDonor < 1.46e10

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in Vef around inf 80.7%

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

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

Alternative 6: 61.9% accurate, 1.5× speedup?

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

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

\mathbf{elif}\;NaChar \leq -1.02 \cdot 10^{-234}:\\
\;\;\;\;t\_1 - \frac{NdChar}{-1 - mu \cdot \left(\frac{1}{KbT} + Ec \cdot \frac{\left(\left(\frac{1}{Ec} + \frac{EDonor}{Ec \cdot KbT}\right) + \frac{Vef}{Ec \cdot KbT}\right) + \frac{-1}{KbT}}{mu}\right)}\\

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

\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{1 + mu \cdot \left(\frac{1}{KbT} - \frac{\frac{Ec}{KbT} + \left(-1 - \left(\frac{Vef}{KbT} + \frac{EDonor}{KbT}\right)\right)}{mu}\right)} - \frac{NaChar}{-1 - t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if NaChar < -8.80000000000000029e-38

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 56.1%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+56.1%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*57.8%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative60.0%

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

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

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

    if -8.80000000000000029e-38 < NaChar < -1.01999999999999999e-234

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 61.6%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+61.6%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*65.7%

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

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

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

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

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

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

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

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

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

        \[\leadsto \frac{NdChar}{1 + mu \cdot \color{blue}{\left(\frac{1}{KbT} - \frac{Ec \cdot \left(\frac{1}{KbT} - \left(\frac{1}{Ec} + \left(\frac{EDonor}{Ec \cdot KbT} + \frac{Vef}{Ec \cdot KbT}\right)\right)\right)}{mu}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
      4. associate-/l*80.3%

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

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

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

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

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

    if -1.01999999999999999e-234 < NaChar < 7.99999999999999987e-170

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in EAccept around inf 90.2%

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

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

    if 7.99999999999999987e-170 < NaChar

    1. Initial program 100.0%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+67.4%

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

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

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

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

Alternative 7: 57.4% accurate, 1.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if mu < 4.3000000000000001e-185

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 67.3%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+67.3%

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

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

      \[\leadsto \frac{NdChar}{1 + \left(\left(\left(1 + \frac{EDonor}{KbT}\right) + \color{blue}{Vef \cdot \left(\frac{1}{KbT} + \frac{mu}{KbT \cdot Vef}\right)}\right) - \frac{Ec}{KbT}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. *-commutative67.9%

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

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

    if 4.3000000000000001e-185 < mu

    1. Initial program 100.0%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+46.3%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*47.4%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative48.8%

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

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

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

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

Alternative 8: 58.4% accurate, 1.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if mu < 8.5000000000000001e-185

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 67.3%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+67.3%

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

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

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

    if 8.5000000000000001e-185 < mu

    1. Initial program 100.0%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+46.3%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*47.4%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative48.8%

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

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

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

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

Alternative 9: 61.0% accurate, 1.6× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;NdChar + \frac{NaChar}{1 + t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if mu < 4.1e-185

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 67.3%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+67.3%

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

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

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

    if 4.1e-185 < mu

    1. Initial program 100.0%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+46.3%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*47.4%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative48.8%

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

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

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

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

Alternative 10: 57.4% accurate, 1.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if mu < 2e-185

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 67.3%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+67.3%

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(\left(1 + \frac{EDonor}{KbT}\right) + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    7. Step-by-step derivation
      1. div-inv67.3%

        \[\leadsto \frac{NdChar}{1 + \left(\left(\left(1 + \frac{EDonor}{KbT}\right) + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right) - \frac{Ec}{KbT}\right)} + \color{blue}{NaChar \cdot \frac{1}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
      2. associate-+r+67.3%

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

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

    if 2e-185 < mu

    1. Initial program 100.0%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+46.3%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*47.4%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative48.8%

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

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

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

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

Alternative 11: 62.2% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;KbT \leq 3.2 \cdot 10^{-198}:\\
\;\;\;\;NdChar + t\_0\\

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if KbT < -7.8e198 or 1.99999999999999996e109 < 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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in EAccept around inf 87.1%

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

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

    if -7.8e198 < KbT < 3.19999999999999994e-198

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 50.5%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+50.5%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*52.7%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative57.5%

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

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

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

    if 3.19999999999999994e-198 < KbT < 3.89999999999999982e-73

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 53.4%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+53.4%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*53.4%

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

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

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

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

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

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

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

    if 3.89999999999999982e-73 < KbT < 1.99999999999999996e109

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 60.1%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+60.1%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*63.6%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative58.4%

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

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

      \[\leadsto \color{blue}{\frac{NdChar}{1 + -1 \cdot \frac{Ec}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    14. Step-by-step derivation
      1. mul-1-neg58.2%

        \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(-\frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
      2. unsub-neg58.2%

        \[\leadsto \frac{NdChar}{\color{blue}{1 - \frac{Ec}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    15. Simplified58.2%

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

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

Alternative 12: 61.5% accurate, 1.6× speedup?

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

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

\mathbf{elif}\;KbT \leq 1.26 \cdot 10^{-198}:\\
\;\;\;\;NdChar + t\_0\\

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

\mathbf{elif}\;KbT \leq 1.8 \cdot 10^{+108}:\\
\;\;\;\;t\_0 + \frac{NdChar}{1 - \frac{Ec}{KbT}}\\

\mathbf{else}:\\
\;\;\;\;t\_1 + NaChar \cdot 0.5\\


\end{array}
\end{array}
Derivation
  1. Split input into 5 regimes
  2. if KbT < -2.75000000000000002e205

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in Ev around inf 88.4%

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

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

    if -2.75000000000000002e205 < KbT < 1.25999999999999992e-198

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 50.5%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+50.5%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*52.7%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative57.5%

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

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

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

    if 1.25999999999999992e-198 < KbT < 3.40000000000000008e-69

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 53.4%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+53.4%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*53.4%

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

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

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

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

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

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

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

    if 3.40000000000000008e-69 < KbT < 1.8e108

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 60.1%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+60.1%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*63.6%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative58.4%

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

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

      \[\leadsto \color{blue}{\frac{NdChar}{1 + -1 \cdot \frac{Ec}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    14. Step-by-step derivation
      1. mul-1-neg58.2%

        \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(-\frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
      2. unsub-neg58.2%

        \[\leadsto \frac{NdChar}{\color{blue}{1 - \frac{Ec}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    15. Simplified58.2%

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

    if 1.8e108 < 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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in EAccept around inf 80.3%

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -2.75 \cdot 10^{+205}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \left(NaChar \cdot 0.5 + -0.25 \cdot \frac{NaChar \cdot Ev}{KbT}\right)\\ \mathbf{elif}\;KbT \leq 1.26 \cdot 10^{-198}:\\ \;\;\;\;NdChar + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}\\ \mathbf{elif}\;KbT \leq 3.4 \cdot 10^{-69}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} + \frac{NdChar}{1 + \frac{mu}{KbT}}\\ \mathbf{elif}\;KbT \leq 1.8 \cdot 10^{+108}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} + \frac{NdChar}{1 - \frac{Ec}{KbT}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + NaChar \cdot 0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 13: 57.4% accurate, 1.6× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if mu < 2.05e-185

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 67.3%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+67.3%

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

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

    if 2.05e-185 < mu

    1. Initial program 100.0%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+46.3%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*47.4%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative48.8%

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

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

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

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

Alternative 14: 61.3% accurate, 1.6× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{1 - EDonor \cdot \left(\frac{Ec}{EDonor \cdot KbT} + \frac{-1}{KbT}\right)} - \frac{NaChar}{-1 - t\_0}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if NaChar < -1.05e-107

    1. Initial program 100.0%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+56.7%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*59.4%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative60.3%

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

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

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

    if -1.05e-107 < NaChar < 1.45e-166

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in EAccept around inf 85.8%

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

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

    if 1.45e-166 < NaChar

    1. Initial program 100.0%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+66.7%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*66.7%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative64.1%

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

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

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

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

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

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

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

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

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

Alternative 15: 64.0% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;KbT \leq 2.2 \cdot 10^{-193}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;KbT \leq 8.2 \cdot 10^{-116}:\\
\;\;\;\;KbT \cdot \frac{NdChar}{mu} - \frac{NaChar}{-1 - t\_0}\\

\mathbf{elif}\;KbT \leq 9.8 \cdot 10^{+166}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if KbT < -9.00000000000000003e198 or 9.79999999999999938e166 < 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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in EAccept around inf 89.4%

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

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

    if -9.00000000000000003e198 < KbT < 2.19999999999999977e-193 or 8.1999999999999998e-116 < KbT < 9.79999999999999938e166

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 52.3%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+52.3%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*54.4%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative54.9%

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

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

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

    if 2.19999999999999977e-193 < KbT < 8.1999999999999998e-116

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 62.1%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+62.1%

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

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

      \[\leadsto \color{blue}{\frac{KbT \cdot NdChar}{mu}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-/l*85.6%

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

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

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

Alternative 16: 61.3% accurate, 1.7× speedup?

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

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

\mathbf{elif}\;KbT \leq 4.2 \cdot 10^{-198}:\\
\;\;\;\;NdChar + t\_0\\

\mathbf{elif}\;KbT \leq 5.4 \cdot 10^{+128}:\\
\;\;\;\;t\_0 + \frac{NdChar}{1 + \frac{mu}{KbT}}\\

\mathbf{elif}\;KbT \leq 1.2 \cdot 10^{+170}:\\
\;\;\;\;t\_0 + NdChar \cdot 0.5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if KbT < -3.04999999999999972e204 or 1.2e170 < 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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in EAccept around inf 89.4%

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

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

    if -3.04999999999999972e204 < KbT < 4.19999999999999986e-198

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 50.5%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+50.5%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*52.7%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative57.5%

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

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

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

    if 4.19999999999999986e-198 < KbT < 5.40000000000000002e128

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 56.6%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+56.6%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*58.4%

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

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

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

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

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

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

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

    if 5.40000000000000002e128 < KbT < 1.2e170

    1. Initial program 99.8%

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

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

      \[\leadsto \color{blue}{0.5 \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. *-commutative63.8%

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

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

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

Alternative 17: 60.0% accurate, 1.7× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{NdChar}{1 + \left(\frac{EDonor}{KbT} - \frac{Ec}{KbT}\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if NaChar < -5.80000000000000003e-111

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 56.7%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+56.7%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*59.4%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative60.3%

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

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

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

    if -5.80000000000000003e-111 < NaChar < 1.1000000000000001e-166

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in EAccept around inf 85.8%

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

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

    if 1.1000000000000001e-166 < NaChar

    1. Initial program 100.0%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+66.7%

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

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

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

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

Alternative 18: 57.7% accurate, 1.7× speedup?

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

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if mu < 8.5000000000000001e-185

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 67.3%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+67.3%

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

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

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

    if 8.5000000000000001e-185 < mu

    1. Initial program 100.0%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+46.3%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*47.4%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative48.8%

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

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

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

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

Alternative 19: 65.7% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;KbT \leq -3.25 \cdot 10^{+199} \lor \neg \left(KbT \leq 1.55 \cdot 10^{+168}\right):\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + NaChar \cdot 0.5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if KbT < -3.2500000000000002e199 or 1.54999999999999998e168 < 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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in EAccept around inf 89.4%

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

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

    if -3.2500000000000002e199 < KbT < 1.54999999999999998e168

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 52.9%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+52.9%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*55.0%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative56.5%

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

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

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

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

Alternative 20: 65.5% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
t_0 := \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}\\
\mathbf{if}\;KbT \leq -3.15 \cdot 10^{+202}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + EAccept\right)}{KbT}}} + NdChar \cdot 0.5\\

\mathbf{elif}\;KbT \leq 10^{+119}:\\
\;\;\;\;NdChar + t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_0 + NdChar \cdot 0.5\\


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

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 85.7%

      \[\leadsto \color{blue}{0.5 \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. *-commutative85.7%

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

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

      \[\leadsto NdChar \cdot 0.5 + \frac{NaChar}{\color{blue}{1 + e^{\frac{EAccept + \left(Ev + Vef\right)}{KbT}}}} \]
    8. Step-by-step derivation
      1. +-commutative85.7%

        \[\leadsto NdChar \cdot 0.5 + \frac{NaChar}{\color{blue}{e^{\frac{EAccept + \left(Ev + Vef\right)}{KbT}} + 1}} \]
      2. associate-+r+85.7%

        \[\leadsto NdChar \cdot 0.5 + \frac{NaChar}{e^{\frac{\color{blue}{\left(EAccept + Ev\right) + Vef}}{KbT}} + 1} \]
    9. Simplified85.7%

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

    if -3.15000000000000002e202 < KbT < 9.99999999999999944e118

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 51.9%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+51.9%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*54.0%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative57.9%

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

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

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

    if 9.99999999999999944e118 < 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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 68.7%

      \[\leadsto \color{blue}{0.5 \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. *-commutative68.7%

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

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

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

Alternative 21: 65.3% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;KbT \leq -2.1 \cdot 10^{+201} \lor \neg \left(KbT \leq 1.7 \cdot 10^{+135}\right):\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + EAccept\right)}{KbT}}} + NdChar \cdot 0.5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if KbT < -2.0999999999999999e201 or 1.70000000000000005e135 < 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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 77.5%

      \[\leadsto \color{blue}{0.5 \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. *-commutative77.5%

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

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

      \[\leadsto NdChar \cdot 0.5 + \frac{NaChar}{\color{blue}{1 + e^{\frac{EAccept + \left(Ev + Vef\right)}{KbT}}}} \]
    8. Step-by-step derivation
      1. +-commutative77.5%

        \[\leadsto NdChar \cdot 0.5 + \frac{NaChar}{\color{blue}{e^{\frac{EAccept + \left(Ev + Vef\right)}{KbT}} + 1}} \]
      2. associate-+r+77.5%

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

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

    if -2.0999999999999999e201 < KbT < 1.70000000000000005e135

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 52.2%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+52.2%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*54.3%

        \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(-1 \cdot Ec\right) \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
      2. mul-1-neg54.3%

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative57.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;KbT \leq -2.1 \cdot 10^{+201} \lor \neg \left(KbT \leq 1.7 \cdot 10^{+135}\right):\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + EAccept\right)}{KbT}}} + NdChar \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;NdChar + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}\\ \end{array} \]
  5. Add Preprocessing

Alternative 22: 64.1% accurate, 1.8× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;KbT \leq -1.75 \cdot 10^{+201}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{mu}{KbT}}} + \frac{NaChar}{2}\\

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

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


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

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in mu around inf 91.4%

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

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

    if -1.7500000000000001e201 < KbT < 2.6e253

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 52.8%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+52.8%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*54.7%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative55.3%

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

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

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

    if 2.6e253 < 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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 92.2%

      \[\leadsto \color{blue}{0.5 \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. *-commutative92.2%

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

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

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

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

Alternative 23: 35.9% accurate, 1.9× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;mu \leq 5.9 \cdot 10^{-123}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} + NdChar \cdot 0.5\\

\mathbf{elif}\;mu \leq 5 \cdot 10^{+173}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{Vef}{KbT}}} + \frac{NaChar}{2}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if mu < 5.89999999999999988e-123

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 52.4%

      \[\leadsto \color{blue}{0.5 \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. *-commutative52.4%

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

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

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

    if 5.89999999999999988e-123 < mu < 5.00000000000000034e173

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in Vef around inf 78.3%

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

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

    if 5.00000000000000034e173 < mu

    1. Initial program 100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;mu \leq 5.9 \cdot 10^{-123}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} + NdChar \cdot 0.5\\ \mathbf{elif}\;mu \leq 5 \cdot 10^{+173}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{Vef}{KbT}}} + \frac{NaChar}{2}\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{mu}{KbT}}} + \frac{NaChar}{2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 24: 36.5% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;Ev \leq -1.32 \cdot 10^{+169}:\\
\;\;\;\;NdChar \cdot 0.5 + \frac{NaChar}{1 + e^{\frac{Ev}{KbT}}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if Ev < -1.3199999999999999e169

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 46.2%

      \[\leadsto \color{blue}{0.5 \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. *-commutative46.2%

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

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

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

    if -1.3199999999999999e169 < 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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 49.1%

      \[\leadsto \color{blue}{0.5 \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. *-commutative49.1%

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;Ev \leq -1.32 \cdot 10^{+169}:\\ \;\;\;\;NdChar \cdot 0.5 + \frac{NaChar}{1 + e^{\frac{Ev}{KbT}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} + NdChar \cdot 0.5\\ \end{array} \]
  5. Add Preprocessing

Alternative 25: 34.7% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
\mathbf{if}\;mu \leq 9.8 \cdot 10^{-123}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} + NdChar \cdot 0.5\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if mu < 9.7999999999999996e-123

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 52.4%

      \[\leadsto \color{blue}{0.5 \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. *-commutative52.4%

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

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

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

    if 9.7999999999999996e-123 < mu

    1. Initial program 100.0%

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;mu \leq 9.8 \cdot 10^{-123}:\\ \;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} + NdChar \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{NdChar}{1 + e^{\frac{Vef}{KbT}}} + \frac{NaChar}{2}\\ \end{array} \]
  5. Add Preprocessing

Alternative 26: 34.9% accurate, 2.1× speedup?

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

\\
\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} + 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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
  3. Add Preprocessing
  4. Taylor expanded in KbT around inf 48.8%

    \[\leadsto \color{blue}{0.5 \cdot NdChar} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
  5. Step-by-step derivation
    1. *-commutative48.8%

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

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

    \[\leadsto NdChar \cdot 0.5 + \frac{NaChar}{1 + e^{\color{blue}{\frac{EAccept}{KbT}}}} \]
  8. Final simplification38.0%

    \[\leadsto \frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}} + NdChar \cdot 0.5 \]
  9. Add Preprocessing

Alternative 27: 28.8% accurate, 5.1× speedup?

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

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

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

\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{2} + \frac{NdChar}{2 + \frac{mu}{KbT}}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if KbT < -6.00000000000000024e-61

    1. Initial program 100.0%

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

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

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

      \[\leadsto \frac{NdChar}{1 + e^{\frac{mu}{KbT}}} + \frac{NaChar}{\color{blue}{2}} \]
    6. Taylor expanded in mu around 0 43.4%

      \[\leadsto \frac{NdChar}{\color{blue}{2 + \frac{mu}{KbT}}} + \frac{NaChar}{2} \]
    7. Taylor expanded in mu around 0 44.7%

      \[\leadsto \color{blue}{0.5 \cdot NaChar + 0.5 \cdot NdChar} \]
    8. Step-by-step derivation
      1. distribute-lft-out44.7%

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

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

    if -6.00000000000000024e-61 < KbT < 9.8000000000000003e-21

    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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in KbT around inf 50.1%

      \[\leadsto \frac{NdChar}{1 + \color{blue}{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)\right) - \frac{Ec}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    5. Step-by-step derivation
      1. associate-+r+50.1%

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

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

      \[\leadsto \frac{NdChar}{1 + \color{blue}{-1 \cdot \left(Ec \cdot \left(-1 \cdot \frac{1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu}{KbT}\right)\right)}{Ec} + \frac{1}{KbT}\right)\right)}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    8. Step-by-step derivation
      1. associate-*r*53.0%

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

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

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

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

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

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

      \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \color{blue}{\frac{EDonor}{Ec \cdot KbT}}\right)} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}} \]
    11. Step-by-step derivation
      1. *-commutative62.3%

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

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

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

        \[\leadsto \frac{NdChar}{1 + \left(-Ec\right) \cdot \left(\frac{1}{KbT} - \frac{EDonor}{KbT \cdot Ec}\right)} + \frac{NaChar}{\color{blue}{\left(\left(2 + \frac{EAccept}{KbT}\right) + \left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right)\right)} - \frac{mu}{KbT}} \]
    15. Simplified18.6%

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

    if 9.8000000000000003e-21 < 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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
    3. Add Preprocessing
    4. Taylor expanded in mu around inf 63.6%

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

      \[\leadsto \frac{NdChar}{1 + e^{\frac{mu}{KbT}}} + \frac{NaChar}{\color{blue}{2}} \]
    6. Taylor expanded in mu around 0 42.3%

      \[\leadsto \frac{NdChar}{\color{blue}{2 + \frac{mu}{KbT}}} + \frac{NaChar}{2} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification33.9%

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

Alternative 28: 27.3% 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{EDonor + \left(mu + \left(Vef - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef + \left(Ev + \left(EAccept - mu\right)\right)}{KbT}}}} \]
  3. Add Preprocessing
  4. Taylor expanded in mu around inf 66.7%

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

    \[\leadsto \frac{NdChar}{1 + e^{\frac{mu}{KbT}}} + \frac{NaChar}{\color{blue}{2}} \]
  6. Taylor expanded in mu around 0 29.8%

    \[\leadsto \frac{NdChar}{\color{blue}{2 + \frac{mu}{KbT}}} + \frac{NaChar}{2} \]
  7. Taylor expanded in mu around 0 30.7%

    \[\leadsto \color{blue}{0.5 \cdot NaChar + 0.5 \cdot NdChar} \]
  8. Step-by-step derivation
    1. distribute-lft-out30.7%

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

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

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

Reproduce

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