
(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 17 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 (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))) (/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT))))))
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(((((Ev + Vef) + EAccept) - mu) / KbT)))) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
code = (nachar / (1.0d0 + exp(((((ev + vef) + eaccept) - mu) / kbt)))) - (ndchar / ((-1.0d0) - exp(((mu - ((ec - vef) - edonor)) / kbt))))
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return (NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) - (NdChar / (-1.0 - Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): return (NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) - (NdChar / (-1.0 - math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))))
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) return Float64(Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)))) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT))))) end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))); end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / 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]
\begin{array}{l}
\\
\frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))))
(t_1 (- (/ NaChar (+ 1.0 (exp (/ Ev KbT)))) t_0))
(t_2 (/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))))
(t_3 (- t_2 t_0)))
(if (<= t_3 -5e-253) t_1 (if (<= t_3 5e-220) t_2 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 - ((Ec - Vef) - EDonor)) / KbT)));
double t_1 = (NaChar / (1.0 + exp((Ev / KbT)))) - t_0;
double t_2 = NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)));
double t_3 = t_2 - t_0;
double tmp;
if (t_3 <= -5e-253) {
tmp = t_1;
} else if (t_3 <= 5e-220) {
tmp = t_2;
} 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) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = ndchar / ((-1.0d0) - exp(((mu - ((ec - vef) - edonor)) / kbt)))
t_1 = (nachar / (1.0d0 + exp((ev / kbt)))) - t_0
t_2 = nachar / (1.0d0 + exp(((((ev + vef) + eaccept) - mu) / kbt)))
t_3 = t_2 - t_0
if (t_3 <= (-5d-253)) then
tmp = t_1
else if (t_3 <= 5d-220) then
tmp = t_2
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 - ((Ec - Vef) - EDonor)) / KbT)));
double t_1 = (NaChar / (1.0 + Math.exp((Ev / KbT)))) - t_0;
double t_2 = NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)));
double t_3 = t_2 - t_0;
double tmp;
if (t_3 <= -5e-253) {
tmp = t_1;
} else if (t_3 <= 5e-220) {
tmp = t_2;
} 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 - ((Ec - Vef) - EDonor)) / KbT))) t_1 = (NaChar / (1.0 + math.exp((Ev / KbT)))) - t_0 t_2 = NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) - mu) / KbT))) t_3 = t_2 - t_0 tmp = 0 if t_3 <= -5e-253: tmp = t_1 elif t_3 <= 5e-220: tmp = t_2 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(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) t_1 = Float64(Float64(NaChar / Float64(1.0 + exp(Float64(Ev / KbT)))) - t_0) t_2 = Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)))) t_3 = Float64(t_2 - t_0) tmp = 0.0 if (t_3 <= -5e-253) tmp = t_1; elseif (t_3 <= 5e-220) tmp = t_2; 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 - ((Ec - Vef) - EDonor)) / KbT))); t_1 = (NaChar / (1.0 + exp((Ev / KbT)))) - t_0; t_2 = NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT))); t_3 = t_2 - t_0; tmp = 0.0; if (t_3 <= -5e-253) tmp = t_1; elseif (t_3 <= 5e-220) tmp = t_2; 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[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NaChar / N[(1.0 + N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(t$95$2 - t$95$0), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-253], t$95$1, If[LessEqual[t$95$3, 5e-220], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\
t_1 := \frac{NaChar}{1 + e^{\frac{Ev}{KbT}}} - t\_0\\
t_2 := \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}}\\
t_3 := t\_2 - t\_0\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{-253}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-220}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\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.99999999999999971e-253 or 5.0000000000000002e-220 < (+.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 Ev around inf
lower-/.f6477.4
Applied rewrites77.4%
if -4.99999999999999971e-253 < (+.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-220Initial 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.1
Applied rewrites94.1%
Final simplification81.5%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (* (+ NaChar NdChar) 0.5))
(t_1
(-
(/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT))))
(/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))))))
(if (<= t_1 -2e-272)
t_0
(if (<= t_1 2e-271)
(/
NdChar
(- (+ (+ (/ mu KbT) (/ Vef KbT)) (+ 2.0 (/ EDonor KbT))) (/ Ec KbT)))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar + NdChar) * 0.5;
double t_1 = (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (t_1 <= -2e-272) {
tmp = t_0;
} else if (t_1 <= 2e-271) {
tmp = NdChar / ((((mu / KbT) + (Vef / KbT)) + (2.0 + (EDonor / KbT))) - (Ec / KbT));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (nachar + ndchar) * 0.5d0
t_1 = (nachar / (1.0d0 + exp(((((ev + vef) + eaccept) - mu) / kbt)))) - (ndchar / ((-1.0d0) - exp(((mu - ((ec - vef) - edonor)) / kbt))))
if (t_1 <= (-2d-272)) then
tmp = t_0
else if (t_1 <= 2d-271) then
tmp = ndchar / ((((mu / kbt) + (vef / kbt)) + (2.0d0 + (edonor / kbt))) - (ec / kbt))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar + NdChar) * 0.5;
double t_1 = (NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) - (NdChar / (-1.0 - Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (t_1 <= -2e-272) {
tmp = t_0;
} else if (t_1 <= 2e-271) {
tmp = NdChar / ((((mu / KbT) + (Vef / KbT)) + (2.0 + (EDonor / KbT))) - (Ec / 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 = (NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) - (NdChar / (-1.0 - math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) tmp = 0 if t_1 <= -2e-272: tmp = t_0 elif t_1 <= 2e-271: tmp = NdChar / ((((mu / KbT) + (Vef / KbT)) + (2.0 + (EDonor / KbT))) - (Ec / 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(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)))) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT))))) tmp = 0.0 if (t_1 <= -2e-272) tmp = t_0; elseif (t_1 <= 2e-271) tmp = Float64(NdChar / Float64(Float64(Float64(Float64(mu / KbT) + Float64(Vef / KbT)) + Float64(2.0 + Float64(EDonor / KbT))) - Float64(Ec / KbT))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NaChar + NdChar) * 0.5; t_1 = (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))); tmp = 0.0; if (t_1 <= -2e-272) tmp = t_0; elseif (t_1 <= 2e-271) tmp = NdChar / ((((mu / KbT) + (Vef / KbT)) + (2.0 + (EDonor / KbT))) - (Ec / KbT)); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / 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[t$95$1, -2e-272], t$95$0, If[LessEqual[t$95$1, 2e-271], N[(NdChar / N[(N[(N[(N[(mu / KbT), $MachinePrecision] + N[(Vef / KbT), $MachinePrecision]), $MachinePrecision] + N[(2.0 + N[(EDonor / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(Ec / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
t_1 := \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-272}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-271}:\\
\;\;\;\;\frac{NdChar}{\left(\left(\frac{mu}{KbT} + \frac{Vef}{KbT}\right) + \left(2 + \frac{EDonor}{KbT}\right)\right) - \frac{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))))) < -1.99999999999999986e-272 or 1.99999999999999993e-271 < (+.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
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6437.1
Applied rewrites37.1%
if -1.99999999999999986e-272 < (+.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))))) < 1.99999999999999993e-271Initial 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-+.f6493.7
Applied rewrites93.7%
Taylor expanded in KbT around inf
Applied rewrites54.2%
Final simplification40.8%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (* (+ NaChar NdChar) 0.5))
(t_1
(-
(/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT))))
(/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))))))
(if (<= t_1 -2e-272)
t_0
(if (<= t_1 2e-271)
(/
NaChar
(- (+ (+ (/ Vef KbT) (/ Ev KbT)) (+ 2.0 (/ EAccept KbT))) (/ 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 + NdChar) * 0.5;
double t_1 = (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (t_1 <= -2e-272) {
tmp = t_0;
} else if (t_1 <= 2e-271) {
tmp = NaChar / ((((Vef / KbT) + (Ev / KbT)) + (2.0 + (EAccept / KbT))) - (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) :: t_1
real(8) :: tmp
t_0 = (nachar + ndchar) * 0.5d0
t_1 = (nachar / (1.0d0 + exp(((((ev + vef) + eaccept) - mu) / kbt)))) - (ndchar / ((-1.0d0) - exp(((mu - ((ec - vef) - edonor)) / kbt))))
if (t_1 <= (-2d-272)) then
tmp = t_0
else if (t_1 <= 2d-271) then
tmp = nachar / ((((vef / kbt) + (ev / kbt)) + (2.0d0 + (eaccept / kbt))) - (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 + NdChar) * 0.5;
double t_1 = (NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) - (NdChar / (-1.0 - Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (t_1 <= -2e-272) {
tmp = t_0;
} else if (t_1 <= 2e-271) {
tmp = NaChar / ((((Vef / KbT) + (Ev / KbT)) + (2.0 + (EAccept / KbT))) - (mu / 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 = (NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) - (NdChar / (-1.0 - math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) tmp = 0 if t_1 <= -2e-272: tmp = t_0 elif t_1 <= 2e-271: tmp = NaChar / ((((Vef / KbT) + (Ev / KbT)) + (2.0 + (EAccept / KbT))) - (mu / 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(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)))) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT))))) tmp = 0.0 if (t_1 <= -2e-272) tmp = t_0; elseif (t_1 <= 2e-271) tmp = Float64(NaChar / Float64(Float64(Float64(Float64(Vef / KbT) + Float64(Ev / KbT)) + Float64(2.0 + Float64(EAccept / KbT))) - Float64(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 + NdChar) * 0.5; t_1 = (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))); tmp = 0.0; if (t_1 <= -2e-272) tmp = t_0; elseif (t_1 <= 2e-271) tmp = NaChar / ((((Vef / KbT) + (Ev / KbT)) + (2.0 + (EAccept / KbT))) - (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 + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / 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[t$95$1, -2e-272], t$95$0, If[LessEqual[t$95$1, 2e-271], N[(NaChar / N[(N[(N[(N[(Vef / KbT), $MachinePrecision] + N[(Ev / KbT), $MachinePrecision]), $MachinePrecision] + N[(2.0 + N[(EAccept / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(mu / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
t_1 := \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-272}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-271}:\\
\;\;\;\;\frac{NaChar}{\left(\left(\frac{Vef}{KbT} + \frac{Ev}{KbT}\right) + \left(2 + \frac{EAccept}{KbT}\right)\right) - \frac{mu}{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))))) < -1.99999999999999986e-272 or 1.99999999999999993e-271 < (+.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
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6437.1
Applied rewrites37.1%
if -1.99999999999999986e-272 < (+.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))))) < 1.99999999999999993e-271Initial 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-+.f6495.1
Applied rewrites95.1%
Taylor expanded in KbT around inf
Applied rewrites38.4%
Final simplification37.4%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (exp (/ Vef KbT))))
(if (<= Ec -5.1e-55)
(/ NaChar (+ 1.0 (exp (/ EAccept KbT))))
(if (<= Ec -2.5e-289)
(+ (* 0.5 NdChar) (/ NaChar (+ 1.0 (exp (/ Ev KbT)))))
(if (<= Ec 4.5e-99)
(/ NdChar (- t_0 -1.0))
(if (<= Ec 5.4e+227)
(/ NaChar (+ 1.0 t_0))
(/ NdChar (- (exp (/ (- Ec) KbT)) -1.0))))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = exp((Vef / KbT));
double tmp;
if (Ec <= -5.1e-55) {
tmp = NaChar / (1.0 + exp((EAccept / KbT)));
} else if (Ec <= -2.5e-289) {
tmp = (0.5 * NdChar) + (NaChar / (1.0 + exp((Ev / KbT))));
} else if (Ec <= 4.5e-99) {
tmp = NdChar / (t_0 - -1.0);
} else if (Ec <= 5.4e+227) {
tmp = NaChar / (1.0 + t_0);
} else {
tmp = NdChar / (exp((-Ec / KbT)) - -1.0);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = exp((vef / kbt))
if (ec <= (-5.1d-55)) then
tmp = nachar / (1.0d0 + exp((eaccept / kbt)))
else if (ec <= (-2.5d-289)) then
tmp = (0.5d0 * ndchar) + (nachar / (1.0d0 + exp((ev / kbt))))
else if (ec <= 4.5d-99) then
tmp = ndchar / (t_0 - (-1.0d0))
else if (ec <= 5.4d+227) then
tmp = nachar / (1.0d0 + t_0)
else
tmp = ndchar / (exp((-ec / kbt)) - (-1.0d0))
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = Math.exp((Vef / KbT));
double tmp;
if (Ec <= -5.1e-55) {
tmp = NaChar / (1.0 + Math.exp((EAccept / KbT)));
} else if (Ec <= -2.5e-289) {
tmp = (0.5 * NdChar) + (NaChar / (1.0 + Math.exp((Ev / KbT))));
} else if (Ec <= 4.5e-99) {
tmp = NdChar / (t_0 - -1.0);
} else if (Ec <= 5.4e+227) {
tmp = NaChar / (1.0 + t_0);
} else {
tmp = NdChar / (Math.exp((-Ec / KbT)) - -1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = math.exp((Vef / KbT)) tmp = 0 if Ec <= -5.1e-55: tmp = NaChar / (1.0 + math.exp((EAccept / KbT))) elif Ec <= -2.5e-289: tmp = (0.5 * NdChar) + (NaChar / (1.0 + math.exp((Ev / KbT)))) elif Ec <= 4.5e-99: tmp = NdChar / (t_0 - -1.0) elif Ec <= 5.4e+227: tmp = NaChar / (1.0 + t_0) else: tmp = NdChar / (math.exp((-Ec / KbT)) - -1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = exp(Float64(Vef / KbT)) tmp = 0.0 if (Ec <= -5.1e-55) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(EAccept / KbT)))); elseif (Ec <= -2.5e-289) tmp = Float64(Float64(0.5 * NdChar) + Float64(NaChar / Float64(1.0 + exp(Float64(Ev / KbT))))); elseif (Ec <= 4.5e-99) tmp = Float64(NdChar / Float64(t_0 - -1.0)); elseif (Ec <= 5.4e+227) tmp = Float64(NaChar / Float64(1.0 + t_0)); else tmp = Float64(NdChar / Float64(exp(Float64(Float64(-Ec) / KbT)) - -1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = exp((Vef / KbT)); tmp = 0.0; if (Ec <= -5.1e-55) tmp = NaChar / (1.0 + exp((EAccept / KbT))); elseif (Ec <= -2.5e-289) tmp = (0.5 * NdChar) + (NaChar / (1.0 + exp((Ev / KbT)))); elseif (Ec <= 4.5e-99) tmp = NdChar / (t_0 - -1.0); elseif (Ec <= 5.4e+227) tmp = NaChar / (1.0 + t_0); else tmp = NdChar / (exp((-Ec / KbT)) - -1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[Ec, -5.1e-55], N[(NaChar / N[(1.0 + N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[Ec, -2.5e-289], N[(N[(0.5 * NdChar), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[Ec, 4.5e-99], N[(NdChar / N[(t$95$0 - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[Ec, 5.4e+227], N[(NaChar / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], N[(NdChar / N[(N[Exp[N[((-Ec) / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\frac{Vef}{KbT}}\\
\mathbf{if}\;Ec \leq -5.1 \cdot 10^{-55}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\
\mathbf{elif}\;Ec \leq -2.5 \cdot 10^{-289}:\\
\;\;\;\;0.5 \cdot NdChar + \frac{NaChar}{1 + e^{\frac{Ev}{KbT}}}\\
\mathbf{elif}\;Ec \leq 4.5 \cdot 10^{-99}:\\
\;\;\;\;\frac{NdChar}{t\_0 - -1}\\
\mathbf{elif}\;Ec \leq 5.4 \cdot 10^{+227}:\\
\;\;\;\;\frac{NaChar}{1 + t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{-Ec}{KbT}} - -1}\\
\end{array}
\end{array}
if Ec < -5.09999999999999995e-55Initial 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-+.f6470.6
Applied rewrites70.6%
Taylor expanded in EAccept around inf
Applied rewrites47.4%
if -5.09999999999999995e-55 < Ec < -2.50000000000000014e-289Initial program 100.0%
Taylor expanded in Ev around inf
lower-/.f6477.4
Applied rewrites77.4%
Taylor expanded in KbT around inf
lower-*.f6450.8
Applied rewrites50.8%
if -2.50000000000000014e-289 < Ec < 4.5000000000000003e-99Initial 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-+.f6472.2
Applied rewrites72.2%
Taylor expanded in Vef around inf
Applied rewrites59.9%
if 4.5000000000000003e-99 < Ec < 5.3999999999999997e227Initial 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.4
Applied rewrites73.4%
Taylor expanded in Vef around inf
Applied rewrites53.6%
if 5.3999999999999997e227 < Ec 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-+.f6478.1
Applied rewrites78.1%
Taylor expanded in Ec around inf
Applied rewrites74.4%
Final simplification54.2%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (exp (/ Vef KbT))))
(if (<= Ec -7.6e-72)
(/ NaChar (+ 1.0 (exp (/ EAccept KbT))))
(if (<= Ec -2.55e-287)
(/ NdChar (- (exp (/ mu KbT)) -1.0))
(if (<= Ec 4.5e-99)
(/ NdChar (- t_0 -1.0))
(if (<= Ec 5.4e+227)
(/ NaChar (+ 1.0 t_0))
(/ NdChar (- (exp (/ (- Ec) KbT)) -1.0))))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = exp((Vef / KbT));
double tmp;
if (Ec <= -7.6e-72) {
tmp = NaChar / (1.0 + exp((EAccept / KbT)));
} else if (Ec <= -2.55e-287) {
tmp = NdChar / (exp((mu / KbT)) - -1.0);
} else if (Ec <= 4.5e-99) {
tmp = NdChar / (t_0 - -1.0);
} else if (Ec <= 5.4e+227) {
tmp = NaChar / (1.0 + t_0);
} else {
tmp = NdChar / (exp((-Ec / KbT)) - -1.0);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = exp((vef / kbt))
if (ec <= (-7.6d-72)) then
tmp = nachar / (1.0d0 + exp((eaccept / kbt)))
else if (ec <= (-2.55d-287)) then
tmp = ndchar / (exp((mu / kbt)) - (-1.0d0))
else if (ec <= 4.5d-99) then
tmp = ndchar / (t_0 - (-1.0d0))
else if (ec <= 5.4d+227) then
tmp = nachar / (1.0d0 + t_0)
else
tmp = ndchar / (exp((-ec / kbt)) - (-1.0d0))
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = Math.exp((Vef / KbT));
double tmp;
if (Ec <= -7.6e-72) {
tmp = NaChar / (1.0 + Math.exp((EAccept / KbT)));
} else if (Ec <= -2.55e-287) {
tmp = NdChar / (Math.exp((mu / KbT)) - -1.0);
} else if (Ec <= 4.5e-99) {
tmp = NdChar / (t_0 - -1.0);
} else if (Ec <= 5.4e+227) {
tmp = NaChar / (1.0 + t_0);
} else {
tmp = NdChar / (Math.exp((-Ec / KbT)) - -1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = math.exp((Vef / KbT)) tmp = 0 if Ec <= -7.6e-72: tmp = NaChar / (1.0 + math.exp((EAccept / KbT))) elif Ec <= -2.55e-287: tmp = NdChar / (math.exp((mu / KbT)) - -1.0) elif Ec <= 4.5e-99: tmp = NdChar / (t_0 - -1.0) elif Ec <= 5.4e+227: tmp = NaChar / (1.0 + t_0) else: tmp = NdChar / (math.exp((-Ec / KbT)) - -1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = exp(Float64(Vef / KbT)) tmp = 0.0 if (Ec <= -7.6e-72) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(EAccept / KbT)))); elseif (Ec <= -2.55e-287) tmp = Float64(NdChar / Float64(exp(Float64(mu / KbT)) - -1.0)); elseif (Ec <= 4.5e-99) tmp = Float64(NdChar / Float64(t_0 - -1.0)); elseif (Ec <= 5.4e+227) tmp = Float64(NaChar / Float64(1.0 + t_0)); else tmp = Float64(NdChar / Float64(exp(Float64(Float64(-Ec) / KbT)) - -1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = exp((Vef / KbT)); tmp = 0.0; if (Ec <= -7.6e-72) tmp = NaChar / (1.0 + exp((EAccept / KbT))); elseif (Ec <= -2.55e-287) tmp = NdChar / (exp((mu / KbT)) - -1.0); elseif (Ec <= 4.5e-99) tmp = NdChar / (t_0 - -1.0); elseif (Ec <= 5.4e+227) tmp = NaChar / (1.0 + t_0); else tmp = NdChar / (exp((-Ec / KbT)) - -1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[Ec, -7.6e-72], N[(NaChar / N[(1.0 + N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[Ec, -2.55e-287], N[(NdChar / N[(N[Exp[N[(mu / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[Ec, 4.5e-99], N[(NdChar / N[(t$95$0 - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[Ec, 5.4e+227], N[(NaChar / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], N[(NdChar / N[(N[Exp[N[((-Ec) / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\frac{Vef}{KbT}}\\
\mathbf{if}\;Ec \leq -7.6 \cdot 10^{-72}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\
\mathbf{elif}\;Ec \leq -2.55 \cdot 10^{-287}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{mu}{KbT}} - -1}\\
\mathbf{elif}\;Ec \leq 4.5 \cdot 10^{-99}:\\
\;\;\;\;\frac{NdChar}{t\_0 - -1}\\
\mathbf{elif}\;Ec \leq 5.4 \cdot 10^{+227}:\\
\;\;\;\;\frac{NaChar}{1 + t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{-Ec}{KbT}} - -1}\\
\end{array}
\end{array}
if Ec < -7.60000000000000004e-72Initial 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-+.f6470.5
Applied rewrites70.5%
Taylor expanded in EAccept around inf
Applied rewrites48.1%
if -7.60000000000000004e-72 < Ec < -2.5499999999999999e-287Initial 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-+.f6460.3
Applied rewrites60.3%
Taylor expanded in mu around inf
Applied rewrites50.4%
if -2.5499999999999999e-287 < Ec < 4.5000000000000003e-99Initial 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-+.f6470.8
Applied rewrites70.8%
Taylor expanded in Vef around inf
Applied rewrites58.8%
if 4.5000000000000003e-99 < Ec < 5.3999999999999997e227Initial 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.4
Applied rewrites73.4%
Taylor expanded in Vef around inf
Applied rewrites53.6%
if 5.3999999999999997e227 < Ec 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-+.f6478.1
Applied rewrites78.1%
Taylor expanded in Ec around inf
Applied rewrites74.4%
Final simplification54.1%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (- (exp (/ (- (+ (+ mu Vef) EDonor) Ec) KbT)) -1.0))))
(if (<= NdChar -4.2e+155)
t_0
(if (<= NdChar 1.52e-75)
(/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) 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 / (exp(((((mu + Vef) + EDonor) - Ec) / KbT)) - -1.0);
double tmp;
if (NdChar <= -4.2e+155) {
tmp = t_0;
} else if (NdChar <= 1.52e-75) {
tmp = NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - 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 / (exp(((((mu + vef) + edonor) - ec) / kbt)) - (-1.0d0))
if (ndchar <= (-4.2d+155)) then
tmp = t_0
else if (ndchar <= 1.52d-75) then
tmp = nachar / (1.0d0 + exp(((((ev + vef) + eaccept) - 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 / (Math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)) - -1.0);
double tmp;
if (NdChar <= -4.2e+155) {
tmp = t_0;
} else if (NdChar <= 1.52e-75) {
tmp = NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NdChar / (math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)) - -1.0) tmp = 0 if NdChar <= -4.2e+155: tmp = t_0 elif NdChar <= 1.52e-75: tmp = NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) - mu) / KbT))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NdChar / Float64(exp(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT)) - -1.0)) tmp = 0.0 if (NdChar <= -4.2e+155) tmp = t_0; elseif (NdChar <= 1.52e-75) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - 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 / (exp(((((mu + Vef) + EDonor) - Ec) / KbT)) - -1.0); tmp = 0.0; if (NdChar <= -4.2e+155) tmp = t_0; elseif (NdChar <= 1.52e-75) tmp = NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - 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[(N[Exp[N[(N[(N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NdChar, -4.2e+155], t$95$0, If[LessEqual[NdChar, 1.52e-75], N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}} - -1}\\
\mathbf{if}\;NdChar \leq -4.2 \cdot 10^{+155}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;NdChar \leq 1.52 \cdot 10^{-75}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if NdChar < -4.2e155 or 1.5200000000000001e-75 < 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-+.f6478.9
Applied rewrites78.9%
if -4.2e155 < NdChar < 1.5200000000000001e-75Initial 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-+.f6475.0
Applied rewrites75.0%
Final simplification76.6%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(if (<= NdChar -4e+156)
(/ NdChar (- (exp (/ Vef KbT)) -1.0))
(if (<= NdChar 6.6e+206)
(/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT))))
(/ NdChar (- (exp (/ mu KbT)) -1.0)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (NdChar <= -4e+156) {
tmp = NdChar / (exp((Vef / KbT)) - -1.0);
} else if (NdChar <= 6.6e+206) {
tmp = NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)));
} else {
tmp = NdChar / (exp((mu / KbT)) - -1.0);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: tmp
if (ndchar <= (-4d+156)) then
tmp = ndchar / (exp((vef / kbt)) - (-1.0d0))
else if (ndchar <= 6.6d+206) then
tmp = nachar / (1.0d0 + exp(((((ev + vef) + eaccept) - mu) / kbt)))
else
tmp = ndchar / (exp((mu / kbt)) - (-1.0d0))
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (NdChar <= -4e+156) {
tmp = NdChar / (Math.exp((Vef / KbT)) - -1.0);
} else if (NdChar <= 6.6e+206) {
tmp = NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)));
} else {
tmp = NdChar / (Math.exp((mu / KbT)) - -1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if NdChar <= -4e+156: tmp = NdChar / (math.exp((Vef / KbT)) - -1.0) elif NdChar <= 6.6e+206: tmp = NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) - mu) / KbT))) else: tmp = NdChar / (math.exp((mu / KbT)) - -1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (NdChar <= -4e+156) tmp = Float64(NdChar / Float64(exp(Float64(Vef / KbT)) - -1.0)); elseif (NdChar <= 6.6e+206) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)))); else tmp = Float64(NdChar / Float64(exp(Float64(mu / KbT)) - -1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if (NdChar <= -4e+156) tmp = NdChar / (exp((Vef / KbT)) - -1.0); elseif (NdChar <= 6.6e+206) tmp = NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT))); else tmp = NdChar / (exp((mu / KbT)) - -1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[NdChar, -4e+156], N[(NdChar / N[(N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[NdChar, 6.6e+206], N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(NdChar / N[(N[Exp[N[(mu / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;NdChar \leq -4 \cdot 10^{+156}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{Vef}{KbT}} - -1}\\
\mathbf{elif}\;NdChar \leq 6.6 \cdot 10^{+206}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{mu}{KbT}} - -1}\\
\end{array}
\end{array}
if NdChar < -3.9999999999999999e156Initial 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.0
Applied rewrites84.0%
Taylor expanded in Vef around inf
Applied rewrites62.1%
if -3.9999999999999999e156 < NdChar < 6.59999999999999969e206Initial 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-+.f6469.8
Applied rewrites69.8%
if 6.59999999999999969e206 < 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-+.f6490.2
Applied rewrites90.2%
Taylor expanded in mu around inf
Applied rewrites76.3%
Final simplification69.4%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (exp (/ Vef KbT))))
(if (<= NdChar -4.2e+155)
(/ NdChar (- t_0 -1.0))
(if (<= NdChar 3.8e-8)
(/ NaChar (+ 1.0 t_0))
(if (<= NdChar 1.55e+197)
(/ NdChar (- (exp (/ EDonor KbT)) -1.0))
(/ NdChar (- (exp (/ mu KbT)) -1.0)))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = exp((Vef / KbT));
double tmp;
if (NdChar <= -4.2e+155) {
tmp = NdChar / (t_0 - -1.0);
} else if (NdChar <= 3.8e-8) {
tmp = NaChar / (1.0 + t_0);
} else if (NdChar <= 1.55e+197) {
tmp = NdChar / (exp((EDonor / KbT)) - -1.0);
} else {
tmp = NdChar / (exp((mu / KbT)) - -1.0);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = exp((vef / kbt))
if (ndchar <= (-4.2d+155)) then
tmp = ndchar / (t_0 - (-1.0d0))
else if (ndchar <= 3.8d-8) then
tmp = nachar / (1.0d0 + t_0)
else if (ndchar <= 1.55d+197) then
tmp = ndchar / (exp((edonor / kbt)) - (-1.0d0))
else
tmp = ndchar / (exp((mu / kbt)) - (-1.0d0))
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = Math.exp((Vef / KbT));
double tmp;
if (NdChar <= -4.2e+155) {
tmp = NdChar / (t_0 - -1.0);
} else if (NdChar <= 3.8e-8) {
tmp = NaChar / (1.0 + t_0);
} else if (NdChar <= 1.55e+197) {
tmp = NdChar / (Math.exp((EDonor / KbT)) - -1.0);
} else {
tmp = NdChar / (Math.exp((mu / KbT)) - -1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = math.exp((Vef / KbT)) tmp = 0 if NdChar <= -4.2e+155: tmp = NdChar / (t_0 - -1.0) elif NdChar <= 3.8e-8: tmp = NaChar / (1.0 + t_0) elif NdChar <= 1.55e+197: tmp = NdChar / (math.exp((EDonor / KbT)) - -1.0) else: tmp = NdChar / (math.exp((mu / KbT)) - -1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = exp(Float64(Vef / KbT)) tmp = 0.0 if (NdChar <= -4.2e+155) tmp = Float64(NdChar / Float64(t_0 - -1.0)); elseif (NdChar <= 3.8e-8) tmp = Float64(NaChar / Float64(1.0 + t_0)); elseif (NdChar <= 1.55e+197) tmp = Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) - -1.0)); else tmp = Float64(NdChar / Float64(exp(Float64(mu / KbT)) - -1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = exp((Vef / KbT)); tmp = 0.0; if (NdChar <= -4.2e+155) tmp = NdChar / (t_0 - -1.0); elseif (NdChar <= 3.8e-8) tmp = NaChar / (1.0 + t_0); elseif (NdChar <= 1.55e+197) tmp = NdChar / (exp((EDonor / KbT)) - -1.0); else tmp = NdChar / (exp((mu / KbT)) - -1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[NdChar, -4.2e+155], N[(NdChar / N[(t$95$0 - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[NdChar, 3.8e-8], N[(NaChar / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[NdChar, 1.55e+197], N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], N[(NdChar / N[(N[Exp[N[(mu / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\frac{Vef}{KbT}}\\
\mathbf{if}\;NdChar \leq -4.2 \cdot 10^{+155}:\\
\;\;\;\;\frac{NdChar}{t\_0 - -1}\\
\mathbf{elif}\;NdChar \leq 3.8 \cdot 10^{-8}:\\
\;\;\;\;\frac{NaChar}{1 + t\_0}\\
\mathbf{elif}\;NdChar \leq 1.55 \cdot 10^{+197}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{mu}{KbT}} - -1}\\
\end{array}
\end{array}
if NdChar < -4.2e155Initial 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.0
Applied rewrites84.0%
Taylor expanded in Vef around inf
Applied rewrites62.1%
if -4.2e155 < NdChar < 3.80000000000000028e-8Initial 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-+.f6474.0
Applied rewrites74.0%
Taylor expanded in Vef around inf
Applied rewrites50.5%
if 3.80000000000000028e-8 < NdChar < 1.55e197Initial 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-+.f6473.6
Applied rewrites73.6%
Taylor expanded in EDonor around inf
Applied rewrites55.3%
if 1.55e197 < 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-+.f6487.2
Applied rewrites87.2%
Taylor expanded in mu around inf
Applied rewrites75.1%
Final simplification54.9%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (- (exp (/ EDonor KbT)) -1.0))))
(if (<= NdChar -1.9e+91)
t_0
(if (<= NdChar -1800.0)
(/ NaChar (+ 1.0 (exp (/ EAccept KbT))))
(if (<= NdChar 3.8e-8) (/ NaChar (+ 1.0 (exp (/ Vef KbT)))) t_0)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (exp((EDonor / KbT)) - -1.0);
double tmp;
if (NdChar <= -1.9e+91) {
tmp = t_0;
} else if (NdChar <= -1800.0) {
tmp = NaChar / (1.0 + exp((EAccept / KbT)));
} else if (NdChar <= 3.8e-8) {
tmp = NaChar / (1.0 + exp((Vef / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = ndchar / (exp((edonor / kbt)) - (-1.0d0))
if (ndchar <= (-1.9d+91)) then
tmp = t_0
else if (ndchar <= (-1800.0d0)) then
tmp = nachar / (1.0d0 + exp((eaccept / kbt)))
else if (ndchar <= 3.8d-8) then
tmp = nachar / (1.0d0 + exp((vef / kbt)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (Math.exp((EDonor / KbT)) - -1.0);
double tmp;
if (NdChar <= -1.9e+91) {
tmp = t_0;
} else if (NdChar <= -1800.0) {
tmp = NaChar / (1.0 + Math.exp((EAccept / KbT)));
} else if (NdChar <= 3.8e-8) {
tmp = NaChar / (1.0 + Math.exp((Vef / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NdChar / (math.exp((EDonor / KbT)) - -1.0) tmp = 0 if NdChar <= -1.9e+91: tmp = t_0 elif NdChar <= -1800.0: tmp = NaChar / (1.0 + math.exp((EAccept / KbT))) elif NdChar <= 3.8e-8: tmp = NaChar / (1.0 + math.exp((Vef / KbT))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) - -1.0)) tmp = 0.0 if (NdChar <= -1.9e+91) tmp = t_0; elseif (NdChar <= -1800.0) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(EAccept / KbT)))); elseif (NdChar <= 3.8e-8) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT)))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NdChar / (exp((EDonor / KbT)) - -1.0); tmp = 0.0; if (NdChar <= -1.9e+91) tmp = t_0; elseif (NdChar <= -1800.0) tmp = NaChar / (1.0 + exp((EAccept / KbT))); elseif (NdChar <= 3.8e-8) tmp = NaChar / (1.0 + exp((Vef / KbT))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NdChar, -1.9e+91], t$95$0, If[LessEqual[NdChar, -1800.0], N[(NaChar / N[(1.0 + N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[NdChar, 3.8e-8], N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\
\mathbf{if}\;NdChar \leq -1.9 \cdot 10^{+91}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;NdChar \leq -1800:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\
\mathbf{elif}\;NdChar \leq 3.8 \cdot 10^{-8}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if NdChar < -1.8999999999999999e91 or 3.80000000000000028e-8 < 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-+.f6477.5
Applied rewrites77.5%
Taylor expanded in EDonor around inf
Applied rewrites52.6%
if -1.8999999999999999e91 < NdChar < -1800Initial 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-+.f6474.3
Applied rewrites74.3%
Taylor expanded in EAccept around inf
Applied rewrites47.9%
if -1800 < NdChar < 3.80000000000000028e-8Initial 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-+.f6474.8
Applied rewrites74.8%
Taylor expanded in Vef around inf
Applied rewrites52.6%
Final simplification52.2%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NaChar (+ 1.0 (exp (/ Vef KbT))))))
(if (<= Vef -4e-29)
t_0
(if (<= Vef 7.4e-183)
(/ NaChar (+ 1.0 (exp (/ EAccept KbT))))
(if (<= Vef 1.22e+67) (/ NaChar (+ 1.0 (exp (/ Ev KbT)))) t_0)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (1.0 + exp((Vef / KbT)));
double tmp;
if (Vef <= -4e-29) {
tmp = t_0;
} else if (Vef <= 7.4e-183) {
tmp = NaChar / (1.0 + exp((EAccept / KbT)));
} else if (Vef <= 1.22e+67) {
tmp = NaChar / (1.0 + exp((Ev / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = nachar / (1.0d0 + exp((vef / kbt)))
if (vef <= (-4d-29)) then
tmp = t_0
else if (vef <= 7.4d-183) then
tmp = nachar / (1.0d0 + exp((eaccept / kbt)))
else if (vef <= 1.22d+67) then
tmp = nachar / (1.0d0 + exp((ev / kbt)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (1.0 + Math.exp((Vef / KbT)));
double tmp;
if (Vef <= -4e-29) {
tmp = t_0;
} else if (Vef <= 7.4e-183) {
tmp = NaChar / (1.0 + Math.exp((EAccept / KbT)));
} else if (Vef <= 1.22e+67) {
tmp = NaChar / (1.0 + Math.exp((Ev / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NaChar / (1.0 + math.exp((Vef / KbT))) tmp = 0 if Vef <= -4e-29: tmp = t_0 elif Vef <= 7.4e-183: tmp = NaChar / (1.0 + math.exp((EAccept / KbT))) elif Vef <= 1.22e+67: tmp = NaChar / (1.0 + math.exp((Ev / KbT))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT)))) tmp = 0.0 if (Vef <= -4e-29) tmp = t_0; elseif (Vef <= 7.4e-183) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(EAccept / KbT)))); elseif (Vef <= 1.22e+67) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(Ev / KbT)))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NaChar / (1.0 + exp((Vef / KbT))); tmp = 0.0; if (Vef <= -4e-29) tmp = t_0; elseif (Vef <= 7.4e-183) tmp = NaChar / (1.0 + exp((EAccept / KbT))); elseif (Vef <= 1.22e+67) tmp = NaChar / (1.0 + exp((Ev / KbT))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Vef, -4e-29], t$95$0, If[LessEqual[Vef, 7.4e-183], N[(NaChar / N[(1.0 + N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[Vef, 1.22e+67], N[(NaChar / N[(1.0 + N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\
\mathbf{if}\;Vef \leq -4 \cdot 10^{-29}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;Vef \leq 7.4 \cdot 10^{-183}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\
\mathbf{elif}\;Vef \leq 1.22 \cdot 10^{+67}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if Vef < -3.99999999999999977e-29 or 1.22000000000000004e67 < 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-+.f6463.5
Applied rewrites63.5%
Taylor expanded in Vef around inf
Applied rewrites54.0%
if -3.99999999999999977e-29 < Vef < 7.3999999999999997e-183Initial 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-+.f6456.6
Applied rewrites56.6%
Taylor expanded in EAccept around inf
Applied rewrites38.4%
if 7.3999999999999997e-183 < Vef < 1.22000000000000004e67Initial 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-+.f6459.8
Applied rewrites59.8%
Taylor expanded in Ev around inf
Applied rewrites40.6%
Final simplification46.6%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(if (<= KbT -6.6e+92)
(* (+ NaChar NdChar) 0.5)
(if (<= KbT -4.5e-141)
(/ NaChar (+ 1.0 (exp (/ EAccept KbT))))
(if (<= KbT 3e+117)
(/ NaChar (+ 1.0 (exp (/ Ev KbT))))
(fma 0.5 (+ NaChar NdChar) (* -0.25 (* (/ NdChar KbT) EDonor)))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (KbT <= -6.6e+92) {
tmp = (NaChar + NdChar) * 0.5;
} else if (KbT <= -4.5e-141) {
tmp = NaChar / (1.0 + exp((EAccept / KbT)));
} else if (KbT <= 3e+117) {
tmp = NaChar / (1.0 + exp((Ev / KbT)));
} else {
tmp = fma(0.5, (NaChar + NdChar), (-0.25 * ((NdChar / KbT) * EDonor)));
}
return tmp;
}
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (KbT <= -6.6e+92) tmp = Float64(Float64(NaChar + NdChar) * 0.5); elseif (KbT <= -4.5e-141) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(EAccept / KbT)))); elseif (KbT <= 3e+117) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(Ev / KbT)))); else tmp = fma(0.5, Float64(NaChar + NdChar), Float64(-0.25 * Float64(Float64(NdChar / KbT) * EDonor))); end return tmp end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[KbT, -6.6e+92], N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[KbT, -4.5e-141], N[(NaChar / N[(1.0 + N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 3e+117], N[(NaChar / N[(1.0 + N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(NaChar + NdChar), $MachinePrecision] + N[(-0.25 * N[(N[(NdChar / KbT), $MachinePrecision] * EDonor), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;KbT \leq -6.6 \cdot 10^{+92}:\\
\;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\
\mathbf{elif}\;KbT \leq -4.5 \cdot 10^{-141}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\
\mathbf{elif}\;KbT \leq 3 \cdot 10^{+117}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.5, NaChar + NdChar, -0.25 \cdot \left(\frac{NdChar}{KbT} \cdot EDonor\right)\right)\\
\end{array}
\end{array}
if KbT < -6.59999999999999948e92Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6464.3
Applied rewrites64.3%
if -6.59999999999999948e92 < KbT < -4.5e-141Initial 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-+.f6454.9
Applied rewrites54.9%
Taylor expanded in EAccept around inf
Applied rewrites34.0%
if -4.5e-141 < KbT < 3e117Initial 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-+.f6468.9
Applied rewrites68.9%
Taylor expanded in Ev around inf
Applied rewrites40.5%
if 3e117 < KbT Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites41.0%
Taylor expanded in EDonor around inf
Applied rewrites55.7%
Final simplification46.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (exp (/ Vef KbT))))
(if (<= NdChar -4.2e+155)
(/ NdChar (- t_0 -1.0))
(if (<= NdChar 3.8e-8)
(/ NaChar (+ 1.0 t_0))
(/ NdChar (- (exp (/ EDonor KbT)) -1.0))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = exp((Vef / KbT));
double tmp;
if (NdChar <= -4.2e+155) {
tmp = NdChar / (t_0 - -1.0);
} else if (NdChar <= 3.8e-8) {
tmp = NaChar / (1.0 + t_0);
} else {
tmp = NdChar / (exp((EDonor / KbT)) - -1.0);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = exp((vef / kbt))
if (ndchar <= (-4.2d+155)) then
tmp = ndchar / (t_0 - (-1.0d0))
else if (ndchar <= 3.8d-8) then
tmp = nachar / (1.0d0 + t_0)
else
tmp = ndchar / (exp((edonor / kbt)) - (-1.0d0))
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = Math.exp((Vef / KbT));
double tmp;
if (NdChar <= -4.2e+155) {
tmp = NdChar / (t_0 - -1.0);
} else if (NdChar <= 3.8e-8) {
tmp = NaChar / (1.0 + t_0);
} else {
tmp = NdChar / (Math.exp((EDonor / KbT)) - -1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = math.exp((Vef / KbT)) tmp = 0 if NdChar <= -4.2e+155: tmp = NdChar / (t_0 - -1.0) elif NdChar <= 3.8e-8: tmp = NaChar / (1.0 + t_0) else: tmp = NdChar / (math.exp((EDonor / KbT)) - -1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = exp(Float64(Vef / KbT)) tmp = 0.0 if (NdChar <= -4.2e+155) tmp = Float64(NdChar / Float64(t_0 - -1.0)); elseif (NdChar <= 3.8e-8) tmp = Float64(NaChar / Float64(1.0 + t_0)); else tmp = Float64(NdChar / Float64(exp(Float64(EDonor / KbT)) - -1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = exp((Vef / KbT)); tmp = 0.0; if (NdChar <= -4.2e+155) tmp = NdChar / (t_0 - -1.0); elseif (NdChar <= 3.8e-8) tmp = NaChar / (1.0 + t_0); else tmp = NdChar / (exp((EDonor / KbT)) - -1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[NdChar, -4.2e+155], N[(NdChar / N[(t$95$0 - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[NdChar, 3.8e-8], N[(NaChar / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], N[(NdChar / N[(N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\frac{Vef}{KbT}}\\
\mathbf{if}\;NdChar \leq -4.2 \cdot 10^{+155}:\\
\;\;\;\;\frac{NdChar}{t\_0 - -1}\\
\mathbf{elif}\;NdChar \leq 3.8 \cdot 10^{-8}:\\
\;\;\;\;\frac{NaChar}{1 + t\_0}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{EDonor}{KbT}} - -1}\\
\end{array}
\end{array}
if NdChar < -4.2e155Initial 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.0
Applied rewrites84.0%
Taylor expanded in Vef around inf
Applied rewrites62.1%
if -4.2e155 < NdChar < 3.80000000000000028e-8Initial 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-+.f6474.0
Applied rewrites74.0%
Taylor expanded in Vef around inf
Applied rewrites50.5%
if 3.80000000000000028e-8 < 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-+.f6478.2
Applied rewrites78.2%
Taylor expanded in EDonor around inf
Applied rewrites54.4%
Final simplification52.9%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(if (<= KbT -6.6e+92)
(* (+ NaChar NdChar) 0.5)
(if (<= KbT 2.2e+115)
(/ NaChar (+ 1.0 (exp (/ EAccept KbT))))
(fma 0.5 (+ NaChar NdChar) (* -0.25 (* (/ NdChar KbT) EDonor))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (KbT <= -6.6e+92) {
tmp = (NaChar + NdChar) * 0.5;
} else if (KbT <= 2.2e+115) {
tmp = NaChar / (1.0 + exp((EAccept / KbT)));
} else {
tmp = fma(0.5, (NaChar + NdChar), (-0.25 * ((NdChar / KbT) * EDonor)));
}
return tmp;
}
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (KbT <= -6.6e+92) tmp = Float64(Float64(NaChar + NdChar) * 0.5); elseif (KbT <= 2.2e+115) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(EAccept / KbT)))); else tmp = fma(0.5, Float64(NaChar + NdChar), Float64(-0.25 * Float64(Float64(NdChar / KbT) * EDonor))); end return tmp end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[KbT, -6.6e+92], N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision], If[LessEqual[KbT, 2.2e+115], N[(NaChar / N[(1.0 + N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(NaChar + NdChar), $MachinePrecision] + N[(-0.25 * N[(N[(NdChar / KbT), $MachinePrecision] * EDonor), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;KbT \leq -6.6 \cdot 10^{+92}:\\
\;\;\;\;\left(NaChar + NdChar\right) \cdot 0.5\\
\mathbf{elif}\;KbT \leq 2.2 \cdot 10^{+115}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.5, NaChar + NdChar, -0.25 \cdot \left(\frac{NdChar}{KbT} \cdot EDonor\right)\right)\\
\end{array}
\end{array}
if KbT < -6.59999999999999948e92Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6464.3
Applied rewrites64.3%
if -6.59999999999999948e92 < KbT < 2.2e115Initial 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-+.f6465.3
Applied rewrites65.3%
Taylor expanded in EAccept around inf
Applied rewrites36.9%
if 2.2e115 < KbT Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
+-commutativeN/A
distribute-lft-outN/A
lower-fma.f64N/A
lower-+.f64N/A
mul-1-negN/A
distribute-neg-frac2N/A
lower-/.f64N/A
Applied rewrites41.0%
Taylor expanded in EDonor around inf
Applied rewrites55.7%
Final simplification44.7%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (if (<= NdChar -4.2e+155) (* 0.5 NdChar) (if (<= NdChar 2.6e-7) (* 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.2e+155) {
tmp = 0.5 * NdChar;
} else if (NdChar <= 2.6e-7) {
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.2d+155)) then
tmp = 0.5d0 * ndchar
else if (ndchar <= 2.6d-7) 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.2e+155) {
tmp = 0.5 * NdChar;
} else if (NdChar <= 2.6e-7) {
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.2e+155: tmp = 0.5 * NdChar elif NdChar <= 2.6e-7: 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.2e+155) tmp = Float64(0.5 * NdChar); elseif (NdChar <= 2.6e-7) 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.2e+155) tmp = 0.5 * NdChar; elseif (NdChar <= 2.6e-7) 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.2e+155], N[(0.5 * NdChar), $MachinePrecision], If[LessEqual[NdChar, 2.6e-7], N[(0.5 * NaChar), $MachinePrecision], N[(0.5 * NdChar), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;NdChar \leq -4.2 \cdot 10^{+155}:\\
\;\;\;\;0.5 \cdot NdChar\\
\mathbf{elif}\;NdChar \leq 2.6 \cdot 10^{-7}:\\
\;\;\;\;0.5 \cdot NaChar\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot NdChar\\
\end{array}
\end{array}
if NdChar < -4.2e155 or 2.59999999999999999e-7 < NdChar Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6430.3
Applied rewrites30.3%
Taylor expanded in NaChar around 0
Applied rewrites27.4%
if -4.2e155 < NdChar < 2.59999999999999999e-7Initial 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-+.f6474.0
Applied rewrites74.0%
Taylor expanded in KbT around inf
Applied rewrites24.6%
(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 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6429.6
Applied rewrites29.6%
Final simplification29.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 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6429.6
Applied rewrites29.6%
Taylor expanded in NaChar around 0
Applied rewrites18.1%
herbie shell --seed 2024270
(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))))))