
(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:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (- (/ NaChar (+ 1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))) (/ NdChar (- -1.0 (pow (E) (/ (- mu (- (- Ec Vef) EDonor)) KbT))))))
\begin{array}{l}
\\
\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}} - \frac{NdChar}{-1 - {\mathsf{E}\left(\right)}^{\left(\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}\right)}}
\end{array}
Initial program 99.9%
lift-exp.f64N/A
lift-/.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f6499.9
Applied rewrites99.9%
Final simplification99.9%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))
(t_1 (+ (+ mu Vef) EDonor))
(t_2 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))
(t_3 (/ NaChar (- -1.0 t_2)))
(t_4 (- (/ NdChar (+ 1.0 t_0)) t_3)))
(if (<= t_4 -2e+48)
(- (/ NaChar (+ 1.0 1.0)) (/ NdChar (- -1.0 t_0)))
(if (<= t_4 -5e-120)
(*
(-
(/ 1.0 (+ 1.0 t_2))
(/ NdChar (* (- -1.0 (- 1.0 (/ (- Ec t_1) KbT))) NaChar)))
NaChar)
(if (<= t_4 1e-72)
(/ NdChar (+ 1.0 (pow (E) (/ (- t_1 Ec) KbT))))
(- (* 0.5 NdChar) t_3))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}\\
t_1 := \left(mu + Vef\right) + EDonor\\
t_2 := e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}\\
t_3 := \frac{NaChar}{-1 - t\_2}\\
t_4 := \frac{NdChar}{1 + t\_0} - t\_3\\
\mathbf{if}\;t\_4 \leq -2 \cdot 10^{+48}:\\
\;\;\;\;\frac{NaChar}{1 + 1} - \frac{NdChar}{-1 - t\_0}\\
\mathbf{elif}\;t\_4 \leq -5 \cdot 10^{-120}:\\
\;\;\;\;\left(\frac{1}{1 + t\_2} - \frac{NdChar}{\left(-1 - \left(1 - \frac{Ec - t\_1}{KbT}\right)\right) \cdot NaChar}\right) \cdot NaChar\\
\mathbf{elif}\;t\_4 \leq 10^{-72}:\\
\;\;\;\;\frac{NdChar}{1 + {\mathsf{E}\left(\right)}^{\left(\frac{t\_1 - Ec}{KbT}\right)}}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot NdChar - t\_3\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -2.00000000000000009e48Initial program 99.7%
Taylor expanded in KbT around inf
Applied rewrites72.7%
if -2.00000000000000009e48 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -5.00000000000000007e-120Initial program 100.0%
Taylor expanded in KbT around inf
Applied rewrites57.0%
lift-exp.f64N/A
*-lft-identityN/A
pow-expN/A
lift-exp.f64N/A
lift-pow.f6457.0
lift-exp.f64N/A
exp-1-eN/A
lower-E.f6457.0
Applied rewrites57.0%
Taylor expanded in NaChar around inf
Applied rewrites96.9%
Taylor expanded in KbT around inf
Applied rewrites75.0%
if -5.00000000000000007e-120 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 9.9999999999999997e-73Initial program 99.9%
Taylor expanded in KbT around inf
Applied rewrites14.8%
lift-exp.f64N/A
*-lft-identityN/A
pow-expN/A
lift-exp.f64N/A
lift-pow.f6414.8
lift-exp.f64N/A
exp-1-eN/A
lower-E.f6414.8
Applied rewrites14.8%
Taylor expanded in NaChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites82.0%
if 9.9999999999999997e-73 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 100.0%
Taylor expanded in KbT around inf
lower-*.f6474.4
Applied rewrites74.4%
Final simplification77.4%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0
(-
(/ NdChar (+ 1.0 (exp (/ (- EDonor Ec) KbT))))
(/ NaChar (- -1.0 (exp (/ (- (+ EAccept Ev) mu) KbT))))))
(t_1 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))
(t_2
(-
(/ NdChar (+ 1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT))))
(/ NaChar (- -1.0 t_1)))))
(if (<= t_2 -4e-308) t_0 (if (<= t_2 2e-292) (/ NaChar (+ 1.0 t_1)) t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NdChar / (1.0 + exp(((EDonor - Ec) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + Ev) - mu) / KbT))));
double t_1 = exp((((EAccept + (Ev + Vef)) - mu) / KbT));
double t_2 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - t_1));
double tmp;
if (t_2 <= -4e-308) {
tmp = t_0;
} else if (t_2 <= 2e-292) {
tmp = NaChar / (1.0 + t_1);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = (ndchar / (1.0d0 + exp(((edonor - ec) / kbt)))) - (nachar / ((-1.0d0) - exp((((eaccept + ev) - mu) / kbt))))
t_1 = exp((((eaccept + (ev + vef)) - mu) / kbt))
t_2 = (ndchar / (1.0d0 + exp(((mu - ((ec - vef) - edonor)) / kbt)))) - (nachar / ((-1.0d0) - t_1))
if (t_2 <= (-4d-308)) then
tmp = t_0
else if (t_2 <= 2d-292) then
tmp = nachar / (1.0d0 + t_1)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NdChar / (1.0 + Math.exp(((EDonor - Ec) / KbT)))) - (NaChar / (-1.0 - Math.exp((((EAccept + Ev) - mu) / KbT))));
double t_1 = Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT));
double t_2 = (NdChar / (1.0 + Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - t_1));
double tmp;
if (t_2 <= -4e-308) {
tmp = t_0;
} else if (t_2 <= 2e-292) {
tmp = NaChar / (1.0 + t_1);
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NdChar / (1.0 + math.exp(((EDonor - Ec) / KbT)))) - (NaChar / (-1.0 - math.exp((((EAccept + Ev) - mu) / KbT)))) t_1 = math.exp((((EAccept + (Ev + Vef)) - mu) / KbT)) t_2 = (NdChar / (1.0 + math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - t_1)) tmp = 0 if t_2 <= -4e-308: tmp = t_0 elif t_2 <= 2e-292: tmp = NaChar / (1.0 + t_1) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(EDonor - Ec) / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Float64(EAccept + Ev) - mu) / KbT))))) t_1 = exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)) t_2 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) - Float64(NaChar / Float64(-1.0 - t_1))) tmp = 0.0 if (t_2 <= -4e-308) tmp = t_0; elseif (t_2 <= 2e-292) tmp = Float64(NaChar / Float64(1.0 + t_1)); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NdChar / (1.0 + exp(((EDonor - Ec) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + Ev) - mu) / KbT)))); t_1 = exp((((EAccept + (Ev + Vef)) - mu) / KbT)); t_2 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - t_1)); tmp = 0.0; if (t_2 <= -4e-308) tmp = t_0; elseif (t_2 <= 2e-292) tmp = NaChar / (1.0 + t_1); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(EDonor - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(N[(EAccept + Ev), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -4e-308], t$95$0, If[LessEqual[t$95$2, 2e-292], N[(NaChar / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{EDonor - Ec}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}}\\
t_1 := e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}\\
t_2 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - t\_1}\\
\mathbf{if}\;t\_2 \leq -4 \cdot 10^{-308}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{-292}:\\
\;\;\;\;\frac{NaChar}{1 + t\_1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -4.00000000000000013e-308 or 2.0000000000000001e-292 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 99.9%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites88.8%
Taylor expanded in mu around 0
Applied rewrites81.5%
if -4.00000000000000013e-308 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 2.0000000000000001e-292Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64100.0
Applied rewrites100.0%
Final simplification86.1%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0
(-
(/ NaChar (+ 1.0 (exp (/ (- mu) KbT))))
(/ NdChar (- -1.0 (exp (/ (- (+ mu EDonor) Ec) KbT))))))
(t_1
(-
(/ NdChar (+ 1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT))))
(/ NaChar (- -1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))))))
(if (<= t_1 -2e-259)
t_0
(if (<= t_1 0.0)
(/ NdChar (+ 1.0 (exp (/ (- (+ (+ mu Vef) EDonor) Ec) KbT))))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar / (1.0 + exp((-mu / KbT)))) - (NdChar / (-1.0 - exp((((mu + EDonor) - Ec) / KbT))));
double t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
double tmp;
if (t_1 <= -2e-259) {
tmp = t_0;
} else if (t_1 <= 0.0) {
tmp = NdChar / (1.0 + exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (nachar / (1.0d0 + exp((-mu / kbt)))) - (ndchar / ((-1.0d0) - exp((((mu + edonor) - ec) / kbt))))
t_1 = (ndchar / (1.0d0 + exp(((mu - ((ec - vef) - edonor)) / kbt)))) - (nachar / ((-1.0d0) - exp((((eaccept + (ev + vef)) - mu) / kbt))))
if (t_1 <= (-2d-259)) then
tmp = t_0
else if (t_1 <= 0.0d0) then
tmp = ndchar / (1.0d0 + exp(((((mu + vef) + edonor) - ec) / kbt)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar / (1.0 + Math.exp((-mu / KbT)))) - (NdChar / (-1.0 - Math.exp((((mu + EDonor) - Ec) / KbT))));
double t_1 = (NdChar / (1.0 + Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
double tmp;
if (t_1 <= -2e-259) {
tmp = t_0;
} else if (t_1 <= 0.0) {
tmp = NdChar / (1.0 + Math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NaChar / (1.0 + math.exp((-mu / KbT)))) - (NdChar / (-1.0 - math.exp((((mu + EDonor) - Ec) / KbT)))) t_1 = (NdChar / (1.0 + math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - math.exp((((EAccept + (Ev + Vef)) - mu) / KbT)))) tmp = 0 if t_1 <= -2e-259: tmp = t_0 elif t_1 <= 0.0: tmp = NdChar / (1.0 + math.exp(((((mu + Vef) + EDonor) - Ec) / KbT))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NaChar / Float64(1.0 + exp(Float64(Float64(-mu) / KbT)))) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(Float64(mu + EDonor) - Ec) / KbT))))) t_1 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT))))) tmp = 0.0 if (t_1 <= -2e-259) tmp = t_0; elseif (t_1 <= 0.0) tmp = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT)))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NaChar / (1.0 + exp((-mu / KbT)))) - (NdChar / (-1.0 - exp((((mu + EDonor) - Ec) / KbT)))); t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT)))); tmp = 0.0; if (t_1 <= -2e-259) tmp = t_0; elseif (t_1 <= 0.0) tmp = NdChar / (1.0 + exp(((((mu + Vef) + EDonor) - Ec) / KbT))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar / N[(1.0 + N[Exp[N[((-mu) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - N[Exp[N[(N[(N[(mu + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-259], t$95$0, If[LessEqual[t$95$1, 0.0], N[(NdChar / N[(1.0 + N[Exp[N[(N[(N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{1 + e^{\frac{-mu}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{\left(mu + EDonor\right) - Ec}{KbT}}}\\
t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-259}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -2.0000000000000001e-259 or 0.0 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 99.9%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites89.1%
Taylor expanded in mu around inf
Applied rewrites76.4%
if -2.0000000000000001e-259 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 0.0Initial program 100.0%
Taylor expanded in NaChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6498.6
Applied rewrites98.6%
Final simplification82.2%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0
(-
(/ NaChar (+ 1.0 (exp (/ Ev KbT))))
(/ NdChar (- -1.0 (exp (/ (- (+ mu EDonor) Ec) KbT))))))
(t_1
(-
(/ NdChar (+ 1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT))))
(/ NaChar (- -1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))))))
(if (<= t_1 -5e-120)
t_0
(if (<= t_1 1e-148)
(/ NdChar (+ 1.0 (pow (E) (/ (- (+ (+ mu Vef) EDonor) Ec) KbT))))
t_0))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{1 + e^{\frac{Ev}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{\left(mu + EDonor\right) - Ec}{KbT}}}\\
t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-120}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 10^{-148}:\\
\;\;\;\;\frac{NdChar}{1 + {\mathsf{E}\left(\right)}^{\left(\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -5.00000000000000007e-120 or 9.99999999999999936e-149 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 99.9%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites88.7%
Taylor expanded in Ev around inf
Applied rewrites71.8%
if -5.00000000000000007e-120 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 9.99999999999999936e-149Initial program 99.9%
Taylor expanded in KbT around inf
Applied rewrites11.2%
lift-exp.f64N/A
*-lft-identityN/A
pow-expN/A
lift-exp.f64N/A
lift-pow.f6411.2
lift-exp.f64N/A
exp-1-eN/A
lower-E.f6411.2
Applied rewrites11.2%
Taylor expanded in NaChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites84.6%
Final simplification76.7%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (* (+ NaChar NdChar) 0.5))
(t_1
(-
(/ NdChar (+ 1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT))))
(/ NaChar (- -1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))))))
(if (<= t_1 -5e-243)
t_0
(if (<= t_1 5e-157)
(/ NdChar (- 2.0 (- (/ (- Ec mu) KbT) (/ EDonor KbT))))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar + NdChar) * 0.5;
double t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
double tmp;
if (t_1 <= -5e-243) {
tmp = t_0;
} else if (t_1 <= 5e-157) {
tmp = NdChar / (2.0 - (((Ec - mu) / KbT) - (EDonor / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (nachar + ndchar) * 0.5d0
t_1 = (ndchar / (1.0d0 + exp(((mu - ((ec - vef) - edonor)) / kbt)))) - (nachar / ((-1.0d0) - exp((((eaccept + (ev + vef)) - mu) / kbt))))
if (t_1 <= (-5d-243)) then
tmp = t_0
else if (t_1 <= 5d-157) then
tmp = ndchar / (2.0d0 - (((ec - mu) / kbt) - (edonor / kbt)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar + NdChar) * 0.5;
double t_1 = (NdChar / (1.0 + Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
double tmp;
if (t_1 <= -5e-243) {
tmp = t_0;
} else if (t_1 <= 5e-157) {
tmp = NdChar / (2.0 - (((Ec - mu) / KbT) - (EDonor / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NaChar + NdChar) * 0.5 t_1 = (NdChar / (1.0 + math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - math.exp((((EAccept + (Ev + Vef)) - mu) / KbT)))) tmp = 0 if t_1 <= -5e-243: tmp = t_0 elif t_1 <= 5e-157: tmp = NdChar / (2.0 - (((Ec - mu) / KbT) - (EDonor / KbT))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NaChar + NdChar) * 0.5) t_1 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT))))) tmp = 0.0 if (t_1 <= -5e-243) tmp = t_0; elseif (t_1 <= 5e-157) tmp = Float64(NdChar / Float64(2.0 - Float64(Float64(Float64(Ec - mu) / KbT) - Float64(EDonor / KbT)))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NaChar + NdChar) * 0.5; t_1 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT)))); tmp = 0.0; if (t_1 <= -5e-243) tmp = t_0; elseif (t_1 <= 5e-157) tmp = NdChar / (2.0 - (((Ec - mu) / KbT) - (EDonor / KbT))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-243], t$95$0, If[LessEqual[t$95$1, 5e-157], N[(NdChar / N[(2.0 - N[(N[(N[(Ec - mu), $MachinePrecision] / KbT), $MachinePrecision] - N[(EDonor / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
t_1 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-243}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-157}:\\
\;\;\;\;\frac{NdChar}{2 - \left(\frac{Ec - mu}{KbT} - \frac{EDonor}{KbT}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -5e-243 or 5.0000000000000002e-157 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 99.9%
Taylor expanded in KbT around inf
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6437.5
Applied rewrites37.5%
if -5e-243 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 5.0000000000000002e-157Initial program 100.0%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites69.4%
Taylor expanded in NaChar around 0
Applied rewrites70.2%
Taylor expanded in KbT around inf
Applied rewrites39.4%
Final simplification38.2%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (- (/ NdChar (+ 1.0 (pow (exp -1.0) (/ (- (- (- Ec Vef) EDonor) mu) KbT)))) (/ NaChar (- -1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) 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 + pow(exp(-1.0), ((((Ec - Vef) - EDonor) - mu) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - 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((-1.0d0)) ** ((((ec - vef) - edonor) - mu) / kbt)))) - (nachar / ((-1.0d0) - exp((((eaccept + (ev + vef)) - 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.pow(Math.exp(-1.0), ((((Ec - Vef) - EDonor) - mu) / KbT)))) - (NaChar / (-1.0 - Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): return (NdChar / (1.0 + math.pow(math.exp(-1.0), ((((Ec - Vef) - EDonor) - mu) / KbT)))) - (NaChar / (-1.0 - math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))))
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) return Float64(Float64(NdChar / Float64(1.0 + (exp(-1.0) ^ Float64(Float64(Float64(Float64(Ec - Vef) - EDonor) - mu) / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT))))) end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = (NdChar / (1.0 + (exp(-1.0) ^ ((((Ec - Vef) - EDonor) - mu) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT)))); end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(N[(NdChar / N[(1.0 + N[Power[N[Exp[-1.0], $MachinePrecision], 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[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{NdChar}{1 + {\left(e^{-1}\right)}^{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT}\right)}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}
\end{array}
Initial program 99.9%
lift-exp.f64N/A
lift-/.f64N/A
lift-neg.f64N/A
distribute-frac-negN/A
neg-mul-1N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
lower-/.f6499.9
Applied rewrites99.9%
Final simplification99.9%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0
(-
(/ NaChar (+ 1.0 (exp (/ Vef KbT))))
(/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))))))
(if (<= Vef -9.5e+211)
t_0
(if (<= Vef 5.8e+144)
(-
(/ NaChar (+ 1.0 (exp (/ (- (+ EAccept Ev) mu) KbT))))
(/ NdChar (- -1.0 (exp (/ (- (+ mu EDonor) Ec) KbT)))))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar / (1.0 + exp((Vef / KbT)))) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (Vef <= -9.5e+211) {
tmp = t_0;
} else if (Vef <= 5.8e+144) {
tmp = (NaChar / (1.0 + exp((((EAccept + Ev) - mu) / KbT)))) - (NdChar / (-1.0 - exp((((mu + EDonor) - Ec) / KbT))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = (nachar / (1.0d0 + exp((vef / kbt)))) - (ndchar / ((-1.0d0) - exp(((mu - ((ec - vef) - edonor)) / kbt))))
if (vef <= (-9.5d+211)) then
tmp = t_0
else if (vef <= 5.8d+144) then
tmp = (nachar / (1.0d0 + exp((((eaccept + ev) - mu) / kbt)))) - (ndchar / ((-1.0d0) - exp((((mu + edonor) - ec) / kbt))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar / (1.0 + Math.exp((Vef / KbT)))) - (NdChar / (-1.0 - Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (Vef <= -9.5e+211) {
tmp = t_0;
} else if (Vef <= 5.8e+144) {
tmp = (NaChar / (1.0 + Math.exp((((EAccept + Ev) - mu) / KbT)))) - (NdChar / (-1.0 - Math.exp((((mu + EDonor) - Ec) / KbT))));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NaChar / (1.0 + math.exp((Vef / KbT)))) - (NdChar / (-1.0 - math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) tmp = 0 if Vef <= -9.5e+211: tmp = t_0 elif Vef <= 5.8e+144: tmp = (NaChar / (1.0 + math.exp((((EAccept + Ev) - mu) / KbT)))) - (NdChar / (-1.0 - math.exp((((mu + EDonor) - Ec) / KbT)))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT)))) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT))))) tmp = 0.0 if (Vef <= -9.5e+211) tmp = t_0; elseif (Vef <= 5.8e+144) tmp = Float64(Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(EAccept + Ev) - mu) / KbT)))) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(Float64(mu + EDonor) - Ec) / KbT))))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NaChar / (1.0 + exp((Vef / KbT)))) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))); tmp = 0.0; if (Vef <= -9.5e+211) tmp = t_0; elseif (Vef <= 5.8e+144) tmp = (NaChar / (1.0 + exp((((EAccept + Ev) - mu) / KbT)))) - (NdChar / (-1.0 - exp((((mu + EDonor) - Ec) / KbT)))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Vef, -9.5e+211], t$95$0, If[LessEqual[Vef, 5.8e+144], N[(N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(EAccept + Ev), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - N[Exp[N[(N[(N[(mu + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\
\mathbf{if}\;Vef \leq -9.5 \cdot 10^{+211}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;Vef \leq 5.8 \cdot 10^{+144}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{\left(mu + EDonor\right) - Ec}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if Vef < -9.4999999999999997e211 or 5.79999999999999996e144 < Vef Initial program 100.0%
Taylor expanded in Vef around inf
lower-/.f6497.3
Applied rewrites97.3%
if -9.4999999999999997e211 < Vef < 5.79999999999999996e144Initial program 99.9%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites95.6%
Final simplification96.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0
(-
(/ NaChar (+ 1.0 (exp (/ Vef KbT))))
(/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))))))
(if (<= Vef -2.7e+169)
t_0
(if (<= Vef 4.1e+74)
(-
(/ NdChar (+ 1.0 (exp (/ (- EDonor Ec) KbT))))
(/ NaChar (- -1.0 (exp (/ (- (+ EAccept Ev) mu) KbT)))))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar / (1.0 + exp((Vef / KbT)))) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (Vef <= -2.7e+169) {
tmp = t_0;
} else if (Vef <= 4.1e+74) {
tmp = (NdChar / (1.0 + exp(((EDonor - Ec) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + Ev) - mu) / KbT))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = (nachar / (1.0d0 + exp((vef / kbt)))) - (ndchar / ((-1.0d0) - exp(((mu - ((ec - vef) - edonor)) / kbt))))
if (vef <= (-2.7d+169)) then
tmp = t_0
else if (vef <= 4.1d+74) then
tmp = (ndchar / (1.0d0 + exp(((edonor - ec) / kbt)))) - (nachar / ((-1.0d0) - exp((((eaccept + ev) - mu) / kbt))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar / (1.0 + Math.exp((Vef / KbT)))) - (NdChar / (-1.0 - Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (Vef <= -2.7e+169) {
tmp = t_0;
} else if (Vef <= 4.1e+74) {
tmp = (NdChar / (1.0 + Math.exp(((EDonor - Ec) / KbT)))) - (NaChar / (-1.0 - Math.exp((((EAccept + Ev) - mu) / KbT))));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NaChar / (1.0 + math.exp((Vef / KbT)))) - (NdChar / (-1.0 - math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) tmp = 0 if Vef <= -2.7e+169: tmp = t_0 elif Vef <= 4.1e+74: tmp = (NdChar / (1.0 + math.exp(((EDonor - Ec) / KbT)))) - (NaChar / (-1.0 - math.exp((((EAccept + Ev) - mu) / KbT)))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT)))) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT))))) tmp = 0.0 if (Vef <= -2.7e+169) tmp = t_0; elseif (Vef <= 4.1e+74) tmp = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(EDonor - Ec) / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Float64(EAccept + Ev) - mu) / KbT))))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NaChar / (1.0 + exp((Vef / KbT)))) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))); tmp = 0.0; if (Vef <= -2.7e+169) tmp = t_0; elseif (Vef <= 4.1e+74) tmp = (NdChar / (1.0 + exp(((EDonor - Ec) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + Ev) - mu) / KbT)))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Vef, -2.7e+169], t$95$0, If[LessEqual[Vef, 4.1e+74], N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(EDonor - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(N[(EAccept + Ev), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\
\mathbf{if}\;Vef \leq -2.7 \cdot 10^{+169}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;Vef \leq 4.1 \cdot 10^{+74}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor - Ec}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if Vef < -2.69999999999999991e169 or 4.1e74 < Vef Initial program 100.0%
Taylor expanded in Vef around inf
lower-/.f6491.4
Applied rewrites91.4%
if -2.69999999999999991e169 < Vef < 4.1e74Initial program 99.9%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites96.7%
Taylor expanded in mu around 0
Applied rewrites88.2%
Final simplification89.1%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (- (/ NdChar (+ 1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))) (/ NaChar (- -1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) 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(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - 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(((mu - ((ec - vef) - edonor)) / kbt)))) - (nachar / ((-1.0d0) - exp((((eaccept + (ev + vef)) - 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(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): return (NdChar / (1.0 + math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))))
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) return Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT))))) end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT)))); end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (+ 1.0 (exp (/ EDonor KbT)))))
(t_1 (/ NaChar (+ 1.0 (exp (/ (- mu) KbT)))))
(t_2 (/ NaChar (+ 1.0 (exp (/ Vef KbT))))))
(if (<= Vef -4.6e+96)
t_2
(if (<= Vef -6.7e-16)
t_1
(if (<= Vef 2.1e-158)
t_0
(if (<= Vef 1.8e-113) t_1 (if (<= Vef 1.95e+46) t_0 t_2)))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + exp((EDonor / KbT)));
double t_1 = NaChar / (1.0 + exp((-mu / KbT)));
double t_2 = NaChar / (1.0 + exp((Vef / KbT)));
double tmp;
if (Vef <= -4.6e+96) {
tmp = t_2;
} else if (Vef <= -6.7e-16) {
tmp = t_1;
} else if (Vef <= 2.1e-158) {
tmp = t_0;
} else if (Vef <= 1.8e-113) {
tmp = t_1;
} else if (Vef <= 1.95e+46) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = ndchar / (1.0d0 + exp((edonor / kbt)))
t_1 = nachar / (1.0d0 + exp((-mu / kbt)))
t_2 = nachar / (1.0d0 + exp((vef / kbt)))
if (vef <= (-4.6d+96)) then
tmp = t_2
else if (vef <= (-6.7d-16)) then
tmp = t_1
else if (vef <= 2.1d-158) then
tmp = t_0
else if (vef <= 1.8d-113) then
tmp = t_1
else if (vef <= 1.95d+46) then
tmp = t_0
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 = NdChar / (1.0 + Math.exp((EDonor / KbT)));
double t_1 = NaChar / (1.0 + Math.exp((-mu / KbT)));
double t_2 = NaChar / (1.0 + Math.exp((Vef / KbT)));
double tmp;
if (Vef <= -4.6e+96) {
tmp = t_2;
} else if (Vef <= -6.7e-16) {
tmp = t_1;
} else if (Vef <= 2.1e-158) {
tmp = t_0;
} else if (Vef <= 1.8e-113) {
tmp = t_1;
} else if (Vef <= 1.95e+46) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NdChar / (1.0 + math.exp((EDonor / KbT))) t_1 = NaChar / (1.0 + math.exp((-mu / KbT))) t_2 = NaChar / (1.0 + math.exp((Vef / KbT))) tmp = 0 if Vef <= -4.6e+96: tmp = t_2 elif Vef <= -6.7e-16: tmp = t_1 elif Vef <= 2.1e-158: tmp = t_0 elif Vef <= 1.8e-113: tmp = t_1 elif Vef <= 1.95e+46: tmp = t_0 else: tmp = t_2 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT)))) t_1 = Float64(NaChar / Float64(1.0 + exp(Float64(Float64(-mu) / KbT)))) t_2 = Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT)))) tmp = 0.0 if (Vef <= -4.6e+96) tmp = t_2; elseif (Vef <= -6.7e-16) tmp = t_1; elseif (Vef <= 2.1e-158) tmp = t_0; elseif (Vef <= 1.8e-113) tmp = t_1; elseif (Vef <= 1.95e+46) tmp = t_0; else tmp = t_2; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NdChar / (1.0 + exp((EDonor / KbT))); t_1 = NaChar / (1.0 + exp((-mu / KbT))); t_2 = NaChar / (1.0 + exp((Vef / KbT))); tmp = 0.0; if (Vef <= -4.6e+96) tmp = t_2; elseif (Vef <= -6.7e-16) tmp = t_1; elseif (Vef <= 2.1e-158) tmp = t_0; elseif (Vef <= 1.8e-113) tmp = t_1; elseif (Vef <= 1.95e+46) tmp = t_0; else tmp = t_2; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(NaChar / N[(1.0 + N[Exp[N[((-mu) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Vef, -4.6e+96], t$95$2, If[LessEqual[Vef, -6.7e-16], t$95$1, If[LessEqual[Vef, 2.1e-158], t$95$0, If[LessEqual[Vef, 1.8e-113], t$95$1, If[LessEqual[Vef, 1.95e+46], t$95$0, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\
t_1 := \frac{NaChar}{1 + e^{\frac{-mu}{KbT}}}\\
t_2 := \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\
\mathbf{if}\;Vef \leq -4.6 \cdot 10^{+96}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;Vef \leq -6.7 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;Vef \leq 2.1 \cdot 10^{-158}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;Vef \leq 1.8 \cdot 10^{-113}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;Vef \leq 1.95 \cdot 10^{+46}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if Vef < -4.6000000000000003e96 or 1.94999999999999997e46 < Vef Initial program 99.9%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6468.0
Applied rewrites68.0%
Taylor expanded in Vef around inf
Applied rewrites59.8%
if -4.6000000000000003e96 < Vef < -6.7000000000000004e-16 or 2.09999999999999991e-158 < Vef < 1.79999999999999987e-113Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6471.2
Applied rewrites71.2%
Taylor expanded in mu around inf
Applied rewrites62.2%
if -6.7000000000000004e-16 < Vef < 2.09999999999999991e-158 or 1.79999999999999987e-113 < Vef < 1.94999999999999997e46Initial program 99.9%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites99.1%
Taylor expanded in NaChar around 0
Applied rewrites68.8%
Taylor expanded in EDonor around inf
Applied rewrites51.4%
Final simplification56.2%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (+ 1.0 (exp (/ (- (+ mu EDonor) Ec) KbT)))))
(t_1 (/ NaChar (+ 1.0 (exp (/ Vef KbT))))))
(if (<= Vef -9.8e+213)
t_1
(if (<= Vef 2.1e-158)
t_0
(if (<= Vef 2.35e-114)
(/ NaChar (+ 1.0 (exp (/ (- mu) KbT))))
(if (<= Vef 6e+191) t_0 t_1))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + exp((((mu + EDonor) - Ec) / KbT)));
double t_1 = NaChar / (1.0 + exp((Vef / KbT)));
double tmp;
if (Vef <= -9.8e+213) {
tmp = t_1;
} else if (Vef <= 2.1e-158) {
tmp = t_0;
} else if (Vef <= 2.35e-114) {
tmp = NaChar / (1.0 + exp((-mu / KbT)));
} else if (Vef <= 6e+191) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ndchar / (1.0d0 + exp((((mu + edonor) - ec) / kbt)))
t_1 = nachar / (1.0d0 + exp((vef / kbt)))
if (vef <= (-9.8d+213)) then
tmp = t_1
else if (vef <= 2.1d-158) then
tmp = t_0
else if (vef <= 2.35d-114) then
tmp = nachar / (1.0d0 + exp((-mu / kbt)))
else if (vef <= 6d+191) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + Math.exp((((mu + EDonor) - Ec) / KbT)));
double t_1 = NaChar / (1.0 + Math.exp((Vef / KbT)));
double tmp;
if (Vef <= -9.8e+213) {
tmp = t_1;
} else if (Vef <= 2.1e-158) {
tmp = t_0;
} else if (Vef <= 2.35e-114) {
tmp = NaChar / (1.0 + Math.exp((-mu / KbT)));
} else if (Vef <= 6e+191) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NdChar / (1.0 + math.exp((((mu + EDonor) - Ec) / KbT))) t_1 = NaChar / (1.0 + math.exp((Vef / KbT))) tmp = 0 if Vef <= -9.8e+213: tmp = t_1 elif Vef <= 2.1e-158: tmp = t_0 elif Vef <= 2.35e-114: tmp = NaChar / (1.0 + math.exp((-mu / KbT))) elif Vef <= 6e+191: tmp = t_0 else: tmp = t_1 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Float64(mu + EDonor) - Ec) / KbT)))) t_1 = Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT)))) tmp = 0.0 if (Vef <= -9.8e+213) tmp = t_1; elseif (Vef <= 2.1e-158) tmp = t_0; elseif (Vef <= 2.35e-114) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(Float64(-mu) / KbT)))); elseif (Vef <= 6e+191) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NdChar / (1.0 + exp((((mu + EDonor) - Ec) / KbT))); t_1 = NaChar / (1.0 + exp((Vef / KbT))); tmp = 0.0; if (Vef <= -9.8e+213) tmp = t_1; elseif (Vef <= 2.1e-158) tmp = t_0; elseif (Vef <= 2.35e-114) tmp = NaChar / (1.0 + exp((-mu / KbT))); elseif (Vef <= 6e+191) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(1.0 + N[Exp[N[(N[(N[(mu + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Vef, -9.8e+213], t$95$1, If[LessEqual[Vef, 2.1e-158], t$95$0, If[LessEqual[Vef, 2.35e-114], N[(NaChar / N[(1.0 + N[Exp[N[((-mu) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[Vef, 6e+191], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{\left(mu + EDonor\right) - Ec}{KbT}}}\\
t_1 := \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\
\mathbf{if}\;Vef \leq -9.8 \cdot 10^{+213}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;Vef \leq 2.1 \cdot 10^{-158}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;Vef \leq 2.35 \cdot 10^{-114}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{-mu}{KbT}}}\\
\mathbf{elif}\;Vef \leq 6 \cdot 10^{+191}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if Vef < -9.79999999999999994e213 or 5.9999999999999995e191 < Vef Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6482.1
Applied rewrites82.1%
Taylor expanded in Vef around inf
Applied rewrites80.2%
if -9.79999999999999994e213 < Vef < 2.09999999999999991e-158 or 2.35000000000000003e-114 < Vef < 5.9999999999999995e191Initial program 99.9%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites93.1%
Taylor expanded in NaChar around 0
Applied rewrites64.2%
if 2.09999999999999991e-158 < Vef < 2.35000000000000003e-114Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6494.3
Applied rewrites94.3%
Taylor expanded in mu around inf
Applied rewrites83.9%
Final simplification68.2%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (+ 1.0 (exp (/ (- (+ (+ mu Vef) EDonor) Ec) KbT))))))
(if (<= NdChar -5.8e+154)
t_0
(if (<= NdChar 1.38e+109)
(/ NaChar (+ 1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT))))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
double tmp;
if (NdChar <= -5.8e+154) {
tmp = t_0;
} else if (NdChar <= 1.38e+109) {
tmp = NaChar / (1.0 + exp((((EAccept + (Ev + Vef)) - mu) / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = ndchar / (1.0d0 + exp(((((mu + vef) + edonor) - ec) / kbt)))
if (ndchar <= (-5.8d+154)) then
tmp = t_0
else if (ndchar <= 1.38d+109) then
tmp = nachar / (1.0d0 + exp((((eaccept + (ev + vef)) - mu) / kbt)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + Math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
double tmp;
if (NdChar <= -5.8e+154) {
tmp = t_0;
} else if (NdChar <= 1.38e+109) {
tmp = NaChar / (1.0 + Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NdChar / (1.0 + math.exp(((((mu + Vef) + EDonor) - Ec) / KbT))) tmp = 0 if NdChar <= -5.8e+154: tmp = t_0 elif NdChar <= 1.38e+109: tmp = NaChar / (1.0 + math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT)))) tmp = 0.0 if (NdChar <= -5.8e+154) tmp = t_0; elseif (NdChar <= 1.38e+109) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NdChar / (1.0 + exp(((((mu + Vef) + EDonor) - Ec) / KbT))); tmp = 0.0; if (NdChar <= -5.8e+154) tmp = t_0; elseif (NdChar <= 1.38e+109) tmp = NaChar / (1.0 + exp((((EAccept + (Ev + Vef)) - mu) / KbT))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(1.0 + N[Exp[N[(N[(N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NdChar, -5.8e+154], t$95$0, If[LessEqual[NdChar, 1.38e+109], N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\
\mathbf{if}\;NdChar \leq -5.8 \cdot 10^{+154}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;NdChar \leq 1.38 \cdot 10^{+109}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if NdChar < -5.79999999999999959e154 or 1.37999999999999994e109 < NdChar Initial program 100.0%
Taylor expanded in NaChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6484.6
Applied rewrites84.6%
if -5.79999999999999959e154 < NdChar < 1.37999999999999994e109Initial program 99.9%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6471.7
Applied rewrites71.7%
Final simplification75.6%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (+ 1.0 (exp (/ (- (+ mu EDonor) Ec) KbT))))))
(if (<= NdChar -5.8e+154)
t_0
(if (<= NdChar 6.9e+109)
(/ NaChar (+ 1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT))))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + exp((((mu + EDonor) - Ec) / KbT)));
double tmp;
if (NdChar <= -5.8e+154) {
tmp = t_0;
} else if (NdChar <= 6.9e+109) {
tmp = NaChar / (1.0 + exp((((EAccept + (Ev + Vef)) - mu) / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = ndchar / (1.0d0 + exp((((mu + edonor) - ec) / kbt)))
if (ndchar <= (-5.8d+154)) then
tmp = t_0
else if (ndchar <= 6.9d+109) then
tmp = nachar / (1.0d0 + exp((((eaccept + (ev + vef)) - mu) / kbt)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + Math.exp((((mu + EDonor) - Ec) / KbT)));
double tmp;
if (NdChar <= -5.8e+154) {
tmp = t_0;
} else if (NdChar <= 6.9e+109) {
tmp = NaChar / (1.0 + Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NdChar / (1.0 + math.exp((((mu + EDonor) - Ec) / KbT))) tmp = 0 if NdChar <= -5.8e+154: tmp = t_0 elif NdChar <= 6.9e+109: tmp = NaChar / (1.0 + math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Float64(mu + EDonor) - Ec) / KbT)))) tmp = 0.0 if (NdChar <= -5.8e+154) tmp = t_0; elseif (NdChar <= 6.9e+109) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NdChar / (1.0 + exp((((mu + EDonor) - Ec) / KbT))); tmp = 0.0; if (NdChar <= -5.8e+154) tmp = t_0; elseif (NdChar <= 6.9e+109) tmp = NaChar / (1.0 + exp((((EAccept + (Ev + Vef)) - mu) / KbT))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(1.0 + N[Exp[N[(N[(N[(mu + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NdChar, -5.8e+154], t$95$0, If[LessEqual[NdChar, 6.9e+109], N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{\left(mu + EDonor\right) - Ec}{KbT}}}\\
\mathbf{if}\;NdChar \leq -5.8 \cdot 10^{+154}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;NdChar \leq 6.9 \cdot 10^{+109}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if NdChar < -5.79999999999999959e154 or 6.8999999999999999e109 < NdChar Initial program 100.0%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites89.8%
Taylor expanded in NaChar around 0
Applied rewrites77.2%
if -5.79999999999999959e154 < NdChar < 6.8999999999999999e109Initial program 99.9%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6471.7
Applied rewrites71.7%
Final simplification73.4%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (+ 1.0 (exp (/ EDonor KbT))))))
(if (<= EDonor -3550.0)
t_0
(if (<= EDonor 1.6e-232)
(/ NdChar (+ 1.0 (exp (/ mu KbT))))
(if (<= EDonor 9.6e+55)
(/ NaChar (+ 1.0 (exp (/ EAccept KbT))))
t_0)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + exp((EDonor / KbT)));
double tmp;
if (EDonor <= -3550.0) {
tmp = t_0;
} else if (EDonor <= 1.6e-232) {
tmp = NdChar / (1.0 + exp((mu / KbT)));
} else if (EDonor <= 9.6e+55) {
tmp = NaChar / (1.0 + exp((EAccept / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = ndchar / (1.0d0 + exp((edonor / kbt)))
if (edonor <= (-3550.0d0)) then
tmp = t_0
else if (edonor <= 1.6d-232) then
tmp = ndchar / (1.0d0 + exp((mu / kbt)))
else if (edonor <= 9.6d+55) then
tmp = nachar / (1.0d0 + exp((eaccept / kbt)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + Math.exp((EDonor / KbT)));
double tmp;
if (EDonor <= -3550.0) {
tmp = t_0;
} else if (EDonor <= 1.6e-232) {
tmp = NdChar / (1.0 + Math.exp((mu / KbT)));
} else if (EDonor <= 9.6e+55) {
tmp = NaChar / (1.0 + Math.exp((EAccept / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NdChar / (1.0 + math.exp((EDonor / KbT))) tmp = 0 if EDonor <= -3550.0: tmp = t_0 elif EDonor <= 1.6e-232: tmp = NdChar / (1.0 + math.exp((mu / KbT))) elif EDonor <= 9.6e+55: tmp = NaChar / (1.0 + math.exp((EAccept / KbT))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT)))) tmp = 0.0 if (EDonor <= -3550.0) tmp = t_0; elseif (EDonor <= 1.6e-232) tmp = Float64(NdChar / Float64(1.0 + exp(Float64(mu / KbT)))); elseif (EDonor <= 9.6e+55) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(EAccept / KbT)))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NdChar / (1.0 + exp((EDonor / KbT))); tmp = 0.0; if (EDonor <= -3550.0) tmp = t_0; elseif (EDonor <= 1.6e-232) tmp = NdChar / (1.0 + exp((mu / KbT))); elseif (EDonor <= 9.6e+55) tmp = NaChar / (1.0 + exp((EAccept / KbT))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[EDonor, -3550.0], t$95$0, If[LessEqual[EDonor, 1.6e-232], N[(NdChar / N[(1.0 + N[Exp[N[(mu / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[EDonor, 9.6e+55], N[(NaChar / N[(1.0 + N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\
\mathbf{if}\;EDonor \leq -3550:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;EDonor \leq 1.6 \cdot 10^{-232}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{mu}{KbT}}}\\
\mathbf{elif}\;EDonor \leq 9.6 \cdot 10^{+55}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if EDonor < -3550 or 9.5999999999999997e55 < EDonor Initial program 100.0%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites79.8%
Taylor expanded in NaChar around 0
Applied rewrites59.8%
Taylor expanded in EDonor around inf
Applied rewrites53.4%
if -3550 < EDonor < 1.59999999999999993e-232Initial program 99.7%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites87.7%
Taylor expanded in NaChar around 0
Applied rewrites61.9%
Taylor expanded in mu around inf
Applied rewrites44.2%
if 1.59999999999999993e-232 < EDonor < 9.5999999999999997e55Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6473.8
Applied rewrites73.8%
Taylor expanded in EAccept around inf
Applied rewrites42.0%
Final simplification47.6%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NaChar (+ 1.0 (exp (/ Vef KbT))))))
(if (<= Vef -3.8e+96)
t_0
(if (<= Vef 1.95e+46) (/ NdChar (+ 1.0 (exp (/ EDonor KbT)))) t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (1.0 + exp((Vef / KbT)));
double tmp;
if (Vef <= -3.8e+96) {
tmp = t_0;
} else if (Vef <= 1.95e+46) {
tmp = NdChar / (1.0 + exp((EDonor / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = nachar / (1.0d0 + exp((vef / kbt)))
if (vef <= (-3.8d+96)) then
tmp = t_0
else if (vef <= 1.95d+46) then
tmp = ndchar / (1.0d0 + exp((edonor / kbt)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (1.0 + Math.exp((Vef / KbT)));
double tmp;
if (Vef <= -3.8e+96) {
tmp = t_0;
} else if (Vef <= 1.95e+46) {
tmp = NdChar / (1.0 + Math.exp((EDonor / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NaChar / (1.0 + math.exp((Vef / KbT))) tmp = 0 if Vef <= -3.8e+96: tmp = t_0 elif Vef <= 1.95e+46: tmp = NdChar / (1.0 + math.exp((EDonor / KbT))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT)))) tmp = 0.0 if (Vef <= -3.8e+96) tmp = t_0; elseif (Vef <= 1.95e+46) tmp = Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT)))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NaChar / (1.0 + exp((Vef / KbT))); tmp = 0.0; if (Vef <= -3.8e+96) tmp = t_0; elseif (Vef <= 1.95e+46) tmp = NdChar / (1.0 + exp((EDonor / KbT))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Vef, -3.8e+96], t$95$0, If[LessEqual[Vef, 1.95e+46], N[(NdChar / N[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\
\mathbf{if}\;Vef \leq -3.8 \cdot 10^{+96}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;Vef \leq 1.95 \cdot 10^{+46}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if Vef < -3.8000000000000002e96 or 1.94999999999999997e46 < Vef Initial program 99.9%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6468.0
Applied rewrites68.0%
Taylor expanded in Vef around inf
Applied rewrites59.8%
if -3.8000000000000002e96 < Vef < 1.94999999999999997e46Initial program 99.9%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites97.4%
Taylor expanded in NaChar around 0
Applied rewrites63.3%
Taylor expanded in EDonor around inf
Applied rewrites45.0%
Final simplification50.4%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ (- (+ (+ mu Vef) EDonor) Ec) KbT)))
(if (<= KbT -1.45e+144)
(+ (* 0.5 NaChar) (fma -0.25 (* t_0 NdChar) (* 0.5 NdChar)))
(if (<= KbT 2.4e+191)
(/ NdChar (+ 1.0 (exp (/ EDonor KbT))))
(- (/ NdChar (fma 1.0 t_0 2.0)) (/ NaChar (- -1.0 1.0)))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (((mu + Vef) + EDonor) - Ec) / KbT;
double tmp;
if (KbT <= -1.45e+144) {
tmp = (0.5 * NaChar) + fma(-0.25, (t_0 * NdChar), (0.5 * NdChar));
} else if (KbT <= 2.4e+191) {
tmp = NdChar / (1.0 + exp((EDonor / KbT)));
} else {
tmp = (NdChar / fma(1.0, t_0, 2.0)) - (NaChar / (-1.0 - 1.0));
}
return tmp;
}
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT) tmp = 0.0 if (KbT <= -1.45e+144) tmp = Float64(Float64(0.5 * NaChar) + fma(-0.25, Float64(t_0 * NdChar), Float64(0.5 * NdChar))); elseif (KbT <= 2.4e+191) tmp = Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT)))); else tmp = Float64(Float64(NdChar / fma(1.0, t_0, 2.0)) - Float64(NaChar / Float64(-1.0 - 1.0))); end return tmp end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]}, If[LessEqual[KbT, -1.45e+144], N[(N[(0.5 * NaChar), $MachinePrecision] + N[(-0.25 * N[(t$95$0 * NdChar), $MachinePrecision] + N[(0.5 * NdChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 2.4e+191], N[(NdChar / N[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(NdChar / N[(1.0 * t$95$0 + 2.0), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}\\
\mathbf{if}\;KbT \leq -1.45 \cdot 10^{+144}:\\
\;\;\;\;0.5 \cdot NaChar + \mathsf{fma}\left(-0.25, t\_0 \cdot NdChar, 0.5 \cdot NdChar\right)\\
\mathbf{elif}\;KbT \leq 2.4 \cdot 10^{+191}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{\mathsf{fma}\left(1, t\_0, 2\right)} - \frac{NaChar}{-1 - 1}\\
\end{array}
\end{array}
if KbT < -1.44999999999999999e144Initial program 99.7%
Taylor expanded in KbT around inf
Applied rewrites60.4%
Taylor expanded in KbT around inf
lower-fma.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-*.f6449.2
Applied rewrites49.2%
Taylor expanded in KbT around inf
lower-*.f6449.2
Applied rewrites49.2%
if -1.44999999999999999e144 < KbT < 2.39999999999999986e191Initial program 100.0%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites80.4%
Taylor expanded in NaChar around 0
Applied rewrites62.2%
Taylor expanded in EDonor around inf
Applied rewrites41.0%
if 2.39999999999999986e191 < KbT Initial program 99.7%
Taylor expanded in KbT around inf
Applied rewrites84.2%
lift-exp.f64N/A
*-lft-identityN/A
pow-expN/A
lift-exp.f64N/A
lift-pow.f6484.4
lift-exp.f64N/A
exp-1-eN/A
lower-E.f6484.4
Applied rewrites84.4%
Taylor expanded in KbT around inf
+-commutativeN/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
log-EN/A
mul-1-negN/A
associate-+r+N/A
sub-negN/A
associate--l+N/A
associate-/l*N/A
lower-fma.f64N/A
Applied rewrites74.1%
Final simplification46.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (if (<= NdChar -4.1e-63) (* 0.5 NdChar) (if (<= NdChar 3.6e-19) (* 0.5 NaChar) (* 0.5 NdChar))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (NdChar <= -4.1e-63) {
tmp = 0.5 * NdChar;
} else if (NdChar <= 3.6e-19) {
tmp = 0.5 * NaChar;
} else {
tmp = 0.5 * NdChar;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: tmp
if (ndchar <= (-4.1d-63)) then
tmp = 0.5d0 * ndchar
else if (ndchar <= 3.6d-19) then
tmp = 0.5d0 * nachar
else
tmp = 0.5d0 * ndchar
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (NdChar <= -4.1e-63) {
tmp = 0.5 * NdChar;
} else if (NdChar <= 3.6e-19) {
tmp = 0.5 * NaChar;
} else {
tmp = 0.5 * NdChar;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if NdChar <= -4.1e-63: tmp = 0.5 * NdChar elif NdChar <= 3.6e-19: tmp = 0.5 * NaChar else: tmp = 0.5 * NdChar return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (NdChar <= -4.1e-63) tmp = Float64(0.5 * NdChar); elseif (NdChar <= 3.6e-19) tmp = Float64(0.5 * NaChar); else tmp = Float64(0.5 * NdChar); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if (NdChar <= -4.1e-63) tmp = 0.5 * NdChar; elseif (NdChar <= 3.6e-19) tmp = 0.5 * NaChar; else tmp = 0.5 * NdChar; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[NdChar, -4.1e-63], N[(0.5 * NdChar), $MachinePrecision], If[LessEqual[NdChar, 3.6e-19], N[(0.5 * NaChar), $MachinePrecision], N[(0.5 * NdChar), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;NdChar \leq -4.1 \cdot 10^{-63}:\\
\;\;\;\;0.5 \cdot NdChar\\
\mathbf{elif}\;NdChar \leq 3.6 \cdot 10^{-19}:\\
\;\;\;\;0.5 \cdot NaChar\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot NdChar\\
\end{array}
\end{array}
if NdChar < -4.0999999999999998e-63 or 3.6000000000000001e-19 < NdChar Initial program 100.0%
Taylor expanded in KbT around inf
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6427.0
Applied rewrites27.0%
Taylor expanded in NaChar around 0
Applied rewrites24.2%
if -4.0999999999999998e-63 < NdChar < 3.6000000000000001e-19Initial program 99.8%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6474.5
Applied rewrites74.5%
Taylor expanded in KbT around inf
Applied rewrites25.3%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (* (+ NaChar 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 + 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 + 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 + NdChar) * 0.5;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): return (NaChar + NdChar) * 0.5
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) return Float64(Float64(NaChar + NdChar) * 0.5) end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = (NaChar + NdChar) * 0.5; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]
\begin{array}{l}
\\
\left(NaChar + NdChar\right) \cdot 0.5
\end{array}
Initial program 99.9%
Taylor expanded in KbT around inf
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6426.6
Applied rewrites26.6%
Final simplification26.6%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (* 0.5 NdChar))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return 0.5 * NdChar;
}
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
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;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): return 0.5 * NdChar
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) return Float64(0.5 * NdChar) end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.5 * NdChar; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(0.5 * NdChar), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot NdChar
\end{array}
Initial program 99.9%
Taylor expanded in KbT around inf
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6426.6
Applied rewrites26.6%
Taylor expanded in NaChar around 0
Applied rewrites18.3%
herbie shell --seed 2024271
(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))))))