
(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 (- (/ 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 100.0%
Final simplification100.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NaChar (- -1.0 (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)))))
(t_1 (- (/ NdChar (+ 1.0 (exp (/ EDonor KbT)))) t_0))
(t_2
(-
(/ NdChar (+ 1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT))))
t_0)))
(if (<= t_2 -1e-209)
t_1
(if (<= t_2 1e-200)
(/ NdChar (+ 1.0 (exp (/ (- (+ (+ mu Vef) EDonor) Ec) KbT))))
t_1))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT)));
double t_1 = (NdChar / (1.0 + exp((EDonor / KbT)))) - t_0;
double t_2 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - t_0;
double tmp;
if (t_2 <= -1e-209) {
tmp = t_1;
} else if (t_2 <= 1e-200) {
tmp = NdChar / (1.0 + exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = nachar / ((-1.0d0) - exp((((eaccept + (ev + vef)) - mu) / kbt)))
t_1 = (ndchar / (1.0d0 + exp((edonor / kbt)))) - t_0
t_2 = (ndchar / (1.0d0 + exp(((mu - ((ec - vef) - edonor)) / kbt)))) - t_0
if (t_2 <= (-1d-209)) then
tmp = t_1
else if (t_2 <= 1d-200) then
tmp = ndchar / (1.0d0 + exp(((((mu + vef) + edonor) - ec) / kbt)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (-1.0 - Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT)));
double t_1 = (NdChar / (1.0 + Math.exp((EDonor / KbT)))) - t_0;
double t_2 = (NdChar / (1.0 + Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - t_0;
double tmp;
if (t_2 <= -1e-209) {
tmp = t_1;
} else if (t_2 <= 1e-200) {
tmp = NdChar / (1.0 + Math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
} else {
tmp = t_1;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NaChar / (-1.0 - math.exp((((EAccept + (Ev + Vef)) - mu) / KbT))) t_1 = (NdChar / (1.0 + math.exp((EDonor / KbT)))) - t_0 t_2 = (NdChar / (1.0 + math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - t_0 tmp = 0 if t_2 <= -1e-209: tmp = t_1 elif t_2 <= 1e-200: tmp = NdChar / (1.0 + math.exp(((((mu + Vef) + EDonor) - Ec) / KbT))) else: tmp = t_1 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)))) t_1 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT)))) - t_0) t_2 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) - t_0) tmp = 0.0 if (t_2 <= -1e-209) tmp = t_1; elseif (t_2 <= 1e-200) tmp = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT)))); else tmp = t_1; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))); t_1 = (NdChar / (1.0 + exp((EDonor / KbT)))) - t_0; t_2 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - t_0; tmp = 0.0; if (t_2 <= -1e-209) tmp = t_1; elseif (t_2 <= 1e-200) tmp = NdChar / (1.0 + exp(((((mu + Vef) + EDonor) - Ec) / KbT))); else tmp = t_1; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NaChar / N[(-1.0 - N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - t$95$0), $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] - t$95$0), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-209], t$95$1, If[LessEqual[t$95$2, 1e-200], 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$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{-1 - e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}}}\\
t_1 := \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} - t\_0\\
t_2 := \frac{NdChar}{1 + e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}} - t\_0\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-209}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 10^{-200}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\
\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))))) < -1e-209 or 9.9999999999999998e-201 < (+.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 EDonor around inf
lower-/.f6484.8
Applied rewrites84.8%
if -1e-209 < (+.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.9999999999999998e-201Initial program 100.0%
Taylor expanded in NaChar around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites95.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 rewrites65.0%
Taylor expanded in NdChar around inf
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-+.f6492.1
Applied rewrites92.1%
Final simplification86.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-226)
t_0
(if (<= t_1 5e-300)
(/
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 = (NdChar / (1.0 + exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) - (NaChar / (-1.0 - exp((((EAccept + (Ev + Vef)) - mu) / KbT))));
double tmp;
if (t_1 <= -5e-226) {
tmp = t_0;
} else if (t_1 <= 5e-300) {
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 = (ndchar / (1.0d0 + exp(((mu - ((ec - vef) - edonor)) / kbt)))) - (nachar / ((-1.0d0) - exp((((eaccept + (ev + vef)) - mu) / kbt))))
if (t_1 <= (-5d-226)) then
tmp = t_0
else if (t_1 <= 5d-300) 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 = (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-226) {
tmp = t_0;
} else if (t_1 <= 5e-300) {
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 = (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-226: tmp = t_0 elif t_1 <= 5e-300: 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(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-226) tmp = t_0; elseif (t_1 <= 5e-300) 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 = (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-226) tmp = t_0; elseif (t_1 <= 5e-300) 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[(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-226], t$95$0, If[LessEqual[t$95$1, 5e-300], 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{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^{-226}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-300}:\\
\;\;\;\;\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))))) < -4.9999999999999998e-226 or 4.99999999999999996e-300 < (+.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-+.f6438.2
Applied rewrites38.2%
if -4.9999999999999998e-226 < (+.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.99999999999999996e-300Initial program 100.0%
Taylor expanded in NdChar 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
lower-+.f6498.2
Applied rewrites98.2%
Taylor expanded in KbT around inf
Applied rewrites47.7%
Final simplification40.0%
(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-226)
t_0
(if (<= t_1 5e-300)
(/ (* -0.5 (* NaChar NaChar)) (- NdChar NaChar))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (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-226) {
tmp = t_0;
} else if (t_1 <= 5e-300) {
tmp = (-0.5 * (NaChar * NaChar)) / (NdChar - NaChar);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: 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-226)) then
tmp = t_0
else if (t_1 <= 5d-300) then
tmp = ((-0.5d0) * (nachar * nachar)) / (ndchar - nachar)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (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-226) {
tmp = t_0;
} else if (t_1 <= 5e-300) {
tmp = (-0.5 * (NaChar * NaChar)) / (NdChar - NaChar);
} 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-226: tmp = t_0 elif t_1 <= 5e-300: tmp = (-0.5 * (NaChar * NaChar)) / (NdChar - NaChar) 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-226) tmp = t_0; elseif (t_1 <= 5e-300) tmp = Float64(Float64(-0.5 * Float64(NaChar * NaChar)) / Float64(NdChar - NaChar)); 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-226) tmp = t_0; elseif (t_1 <= 5e-300) tmp = (-0.5 * (NaChar * NaChar)) / (NdChar - NaChar); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(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-226], t$95$0, If[LessEqual[t$95$1, 5e-300], N[(N[(-0.5 * N[(NaChar * NaChar), $MachinePrecision]), $MachinePrecision] / N[(NdChar - NaChar), $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^{-226}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-300}:\\
\;\;\;\;\frac{-0.5 \cdot \left(NaChar \cdot NaChar\right)}{NdChar - NaChar}\\
\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.9999999999999998e-226 or 4.99999999999999996e-300 < (+.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-+.f6438.2
Applied rewrites38.2%
if -4.9999999999999998e-226 < (+.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.99999999999999996e-300Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f642.7
Applied rewrites2.7%
Applied rewrites4.7%
Taylor expanded in NdChar around 0
Applied rewrites31.8%
Final simplification37.0%
(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-154)
t_0
(if (<= t_1 5e-300) (* 0.25 (/ (* Ec NdChar) 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-154) {
tmp = t_0;
} else if (t_1 <= 5e-300) {
tmp = 0.25 * ((Ec * NdChar) / 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-154)) then
tmp = t_0
else if (t_1 <= 5d-300) then
tmp = 0.25d0 * ((ec * ndchar) / 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-154) {
tmp = t_0;
} else if (t_1 <= 5e-300) {
tmp = 0.25 * ((Ec * NdChar) / 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-154: tmp = t_0 elif t_1 <= 5e-300: tmp = 0.25 * ((Ec * NdChar) / 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-154) tmp = t_0; elseif (t_1 <= 5e-300) tmp = Float64(0.25 * Float64(Float64(Ec * NdChar) / 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-154) tmp = t_0; elseif (t_1 <= 5e-300) tmp = 0.25 * ((Ec * NdChar) / 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-154], t$95$0, If[LessEqual[t$95$1, 5e-300], N[(0.25 * N[(N[(Ec * NdChar), $MachinePrecision] / KbT), $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^{-154}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-300}:\\
\;\;\;\;0.25 \cdot \frac{Ec \cdot NdChar}{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))))) < -5.0000000000000002e-154 or 4.99999999999999996e-300 < (+.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-+.f6440.1
Applied rewrites40.1%
if -5.0000000000000002e-154 < (+.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.99999999999999996e-300Initial program 100.0%
Taylor expanded in KbT around -inf
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
Applied rewrites1.5%
Taylor expanded in Ec around inf
Applied rewrites19.9%
Final simplification35.4%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0
(-
(/ NaChar (- (exp (/ (- (+ EAccept Ev) mu) KbT)) -1.0))
(/ NdChar (- -1.0 (exp (/ (- (+ mu EDonor) Ec) KbT)))))))
(if (<= mu -2.1e+146)
t_0
(if (<= mu 2e+61)
(-
(/ NaChar (- (exp (/ (+ EAccept (+ Ev Vef)) KbT)) -1.0))
(/ NdChar (- -1.0 (exp (/ (- (+ EDonor Vef) Ec) KbT)))))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar / (exp((((EAccept + Ev) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - exp((((mu + EDonor) - Ec) / KbT))));
double tmp;
if (mu <= -2.1e+146) {
tmp = t_0;
} else if (mu <= 2e+61) {
tmp = (NaChar / (exp(((EAccept + (Ev + Vef)) / KbT)) - -1.0)) - (NdChar / (-1.0 - exp((((EDonor + Vef) - Ec) / KbT))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = (nachar / (exp((((eaccept + ev) - mu) / kbt)) - (-1.0d0))) - (ndchar / ((-1.0d0) - exp((((mu + edonor) - ec) / kbt))))
if (mu <= (-2.1d+146)) then
tmp = t_0
else if (mu <= 2d+61) then
tmp = (nachar / (exp(((eaccept + (ev + vef)) / kbt)) - (-1.0d0))) - (ndchar / ((-1.0d0) - exp((((edonor + vef) - ec) / kbt))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar / (Math.exp((((EAccept + Ev) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - Math.exp((((mu + EDonor) - Ec) / KbT))));
double tmp;
if (mu <= -2.1e+146) {
tmp = t_0;
} else if (mu <= 2e+61) {
tmp = (NaChar / (Math.exp(((EAccept + (Ev + Vef)) / KbT)) - -1.0)) - (NdChar / (-1.0 - Math.exp((((EDonor + Vef) - Ec) / KbT))));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NaChar / (math.exp((((EAccept + Ev) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - math.exp((((mu + EDonor) - Ec) / KbT)))) tmp = 0 if mu <= -2.1e+146: tmp = t_0 elif mu <= 2e+61: tmp = (NaChar / (math.exp(((EAccept + (Ev + Vef)) / KbT)) - -1.0)) - (NdChar / (-1.0 - math.exp((((EDonor + Vef) - 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(exp(Float64(Float64(Float64(EAccept + Ev) - mu) / KbT)) - -1.0)) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(Float64(mu + EDonor) - Ec) / KbT))))) tmp = 0.0 if (mu <= -2.1e+146) tmp = t_0; elseif (mu <= 2e+61) tmp = Float64(Float64(NaChar / Float64(exp(Float64(Float64(EAccept + Float64(Ev + Vef)) / KbT)) - -1.0)) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(Float64(EDonor + Vef) - 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 / (exp((((EAccept + Ev) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - exp((((mu + EDonor) - Ec) / KbT)))); tmp = 0.0; if (mu <= -2.1e+146) tmp = t_0; elseif (mu <= 2e+61) tmp = (NaChar / (exp(((EAccept + (Ev + Vef)) / KbT)) - -1.0)) - (NdChar / (-1.0 - exp((((EDonor + Vef) - Ec) / KbT)))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar / N[(N[Exp[N[(N[(N[(EAccept + Ev), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - N[Exp[N[(N[(N[(mu + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[mu, -2.1e+146], t$95$0, If[LessEqual[mu, 2e+61], N[(N[(NaChar / N[(N[Exp[N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - N[Exp[N[(N[(N[(EDonor + Vef), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}} - -1} - \frac{NdChar}{-1 - e^{\frac{\left(mu + EDonor\right) - Ec}{KbT}}}\\
\mathbf{if}\;mu \leq -2.1 \cdot 10^{+146}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;mu \leq 2 \cdot 10^{+61}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept + \left(Ev + Vef\right)}{KbT}} - -1} - \frac{NdChar}{-1 - e^{\frac{\left(EDonor + Vef\right) - Ec}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if mu < -2.1000000000000001e146 or 1.9999999999999999e61 < mu Initial program 100.0%
Taylor expanded in NaChar around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites91.5%
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%
if -2.1000000000000001e146 < mu < 1.9999999999999999e61Initial program 100.0%
Taylor expanded in mu 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.3%
Final simplification97.1%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (+ EAccept (+ Ev Vef)))
(t_1
(-
(/ NdChar (+ 1.0 (exp (/ mu KbT))))
(/ NaChar (- -1.0 (exp (/ (- t_0 mu) KbT)))))))
(if (<= mu -3.1e+147)
t_1
(if (<= mu 5.5e+165)
(-
(/ NaChar (- (exp (/ t_0 KbT)) -1.0))
(/ NdChar (- -1.0 (exp (/ (- (+ EDonor Vef) Ec) KbT)))))
t_1))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = EAccept + (Ev + Vef);
double t_1 = (NdChar / (1.0 + exp((mu / KbT)))) - (NaChar / (-1.0 - exp(((t_0 - mu) / KbT))));
double tmp;
if (mu <= -3.1e+147) {
tmp = t_1;
} else if (mu <= 5.5e+165) {
tmp = (NaChar / (exp((t_0 / KbT)) - -1.0)) - (NdChar / (-1.0 - exp((((EDonor + Vef) - Ec) / KbT))));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = eaccept + (ev + vef)
t_1 = (ndchar / (1.0d0 + exp((mu / kbt)))) - (nachar / ((-1.0d0) - exp(((t_0 - mu) / kbt))))
if (mu <= (-3.1d+147)) then
tmp = t_1
else if (mu <= 5.5d+165) then
tmp = (nachar / (exp((t_0 / kbt)) - (-1.0d0))) - (ndchar / ((-1.0d0) - exp((((edonor + vef) - ec) / kbt))))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = EAccept + (Ev + Vef);
double t_1 = (NdChar / (1.0 + Math.exp((mu / KbT)))) - (NaChar / (-1.0 - Math.exp(((t_0 - mu) / KbT))));
double tmp;
if (mu <= -3.1e+147) {
tmp = t_1;
} else if (mu <= 5.5e+165) {
tmp = (NaChar / (Math.exp((t_0 / KbT)) - -1.0)) - (NdChar / (-1.0 - Math.exp((((EDonor + Vef) - Ec) / KbT))));
} else {
tmp = t_1;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = EAccept + (Ev + Vef) t_1 = (NdChar / (1.0 + math.exp((mu / KbT)))) - (NaChar / (-1.0 - math.exp(((t_0 - mu) / KbT)))) tmp = 0 if mu <= -3.1e+147: tmp = t_1 elif mu <= 5.5e+165: tmp = (NaChar / (math.exp((t_0 / KbT)) - -1.0)) - (NdChar / (-1.0 - math.exp((((EDonor + Vef) - Ec) / KbT)))) else: tmp = t_1 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(EAccept + Float64(Ev + Vef)) t_1 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(mu / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(t_0 - mu) / KbT))))) tmp = 0.0 if (mu <= -3.1e+147) tmp = t_1; elseif (mu <= 5.5e+165) tmp = Float64(Float64(NaChar / Float64(exp(Float64(t_0 / KbT)) - -1.0)) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(Float64(EDonor + Vef) - Ec) / KbT))))); else tmp = t_1; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = EAccept + (Ev + Vef); t_1 = (NdChar / (1.0 + exp((mu / KbT)))) - (NaChar / (-1.0 - exp(((t_0 - mu) / KbT)))); tmp = 0.0; if (mu <= -3.1e+147) tmp = t_1; elseif (mu <= 5.5e+165) tmp = (NaChar / (exp((t_0 / KbT)) - -1.0)) - (NdChar / (-1.0 - exp((((EDonor + Vef) - Ec) / KbT)))); else tmp = t_1; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(1.0 + N[Exp[N[(mu / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(t$95$0 - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[mu, -3.1e+147], t$95$1, If[LessEqual[mu, 5.5e+165], N[(N[(NaChar / N[(N[Exp[N[(t$95$0 / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - N[Exp[N[(N[(N[(EDonor + Vef), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := EAccept + \left(Ev + Vef\right)\\
t_1 := \frac{NdChar}{1 + e^{\frac{mu}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{t\_0 - mu}{KbT}}}\\
\mathbf{if}\;mu \leq -3.1 \cdot 10^{+147}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;mu \leq 5.5 \cdot 10^{+165}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{t\_0}{KbT}} - -1} - \frac{NdChar}{-1 - e^{\frac{\left(EDonor + Vef\right) - Ec}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if mu < -3.1e147 or 5.4999999999999998e165 < mu Initial program 100.0%
Taylor expanded in mu around inf
lower-/.f6493.1
Applied rewrites93.1%
if -3.1e147 < mu < 5.4999999999999998e165Initial program 100.0%
Taylor expanded in mu 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.1%
Final simplification95.3%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NaChar (- (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)) -1.0))))
(if (<= NaChar -1.6e+59)
t_0
(if (<= NaChar 1.05e+35)
(/ 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 / (exp((((EAccept + (Ev + Vef)) - mu) / KbT)) - -1.0);
double tmp;
if (NaChar <= -1.6e+59) {
tmp = t_0;
} else if (NaChar <= 1.05e+35) {
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) :: tmp
t_0 = nachar / (exp((((eaccept + (ev + vef)) - mu) / kbt)) - (-1.0d0))
if (nachar <= (-1.6d+59)) then
tmp = t_0
else if (nachar <= 1.05d+35) 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 / (Math.exp((((EAccept + (Ev + Vef)) - mu) / KbT)) - -1.0);
double tmp;
if (NaChar <= -1.6e+59) {
tmp = t_0;
} else if (NaChar <= 1.05e+35) {
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 / (math.exp((((EAccept + (Ev + Vef)) - mu) / KbT)) - -1.0) tmp = 0 if NaChar <= -1.6e+59: tmp = t_0 elif NaChar <= 1.05e+35: 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(NaChar / Float64(exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)) - -1.0)) tmp = 0.0 if (NaChar <= -1.6e+59) tmp = t_0; elseif (NaChar <= 1.05e+35) 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 / (exp((((EAccept + (Ev + Vef)) - mu) / KbT)) - -1.0); tmp = 0.0; if (NaChar <= -1.6e+59) tmp = t_0; elseif (NaChar <= 1.05e+35) 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[(NaChar / N[(N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NaChar, -1.6e+59], t$95$0, If[LessEqual[NaChar, 1.05e+35], 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}{e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}} - -1}\\
\mathbf{if}\;NaChar \leq -1.6 \cdot 10^{+59}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;NaChar \leq 1.05 \cdot 10^{+35}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if NaChar < -1.59999999999999991e59 or 1.0499999999999999e35 < NaChar Initial program 100.0%
Taylor expanded in NdChar 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
lower-+.f6477.3
Applied rewrites77.3%
if -1.59999999999999991e59 < NaChar < 1.0499999999999999e35Initial program 100.0%
Taylor expanded in NaChar around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites90.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 rewrites87.2%
Taylor expanded in NdChar around inf
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.3
Applied rewrites72.3%
Final simplification74.3%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (* (+ NaChar NdChar) 0.5)))
(if (<= KbT -1.25e+169)
t_0
(if (<= KbT 2.05e+200)
(/ NaChar (- (exp (/ (- (+ EAccept (+ Ev Vef)) mu) KbT)) -1.0))
(fma -0.25 (* (/ NdChar KbT) EDonor) 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 tmp;
if (KbT <= -1.25e+169) {
tmp = t_0;
} else if (KbT <= 2.05e+200) {
tmp = NaChar / (exp((((EAccept + (Ev + Vef)) - mu) / KbT)) - -1.0);
} else {
tmp = fma(-0.25, ((NdChar / KbT) * EDonor), t_0);
}
return tmp;
}
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NaChar + NdChar) * 0.5) tmp = 0.0 if (KbT <= -1.25e+169) tmp = t_0; elseif (KbT <= 2.05e+200) tmp = Float64(NaChar / Float64(exp(Float64(Float64(Float64(EAccept + Float64(Ev + Vef)) - mu) / KbT)) - -1.0)); else tmp = fma(-0.25, Float64(Float64(NdChar / KbT) * EDonor), t_0); end return tmp end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[KbT, -1.25e+169], t$95$0, If[LessEqual[KbT, 2.05e+200], N[(NaChar / N[(N[Exp[N[(N[(N[(EAccept + N[(Ev + Vef), $MachinePrecision]), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], N[(-0.25 * N[(N[(NdChar / KbT), $MachinePrecision] * EDonor), $MachinePrecision] + t$95$0), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
\mathbf{if}\;KbT \leq -1.25 \cdot 10^{+169}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;KbT \leq 2.05 \cdot 10^{+200}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{\left(EAccept + \left(Ev + Vef\right)\right) - mu}{KbT}} - -1}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, \frac{NdChar}{KbT} \cdot EDonor, t\_0\right)\\
\end{array}
\end{array}
if KbT < -1.25000000000000004e169Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6481.7
Applied rewrites81.7%
if -1.25000000000000004e169 < KbT < 2.0500000000000001e200Initial program 100.0%
Taylor expanded in NdChar 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
lower-+.f6464.1
Applied rewrites64.1%
if 2.0500000000000001e200 < KbT Initial program 99.9%
Taylor expanded in KbT around -inf
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
Applied rewrites85.3%
Taylor expanded in EDonor around inf
Applied rewrites85.5%
Final simplification68.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(if (<= EAccept 5e-240)
(/ NaChar (- (exp (/ Ev KbT)) -1.0))
(if (<= EAccept 3.15e+41)
(/ NdChar (+ 1.0 (exp (/ EDonor KbT))))
(if (<= EAccept 3.6e+120)
(/ NdChar (+ 1.0 (exp (/ Vef KbT))))
(/ NaChar (- (exp (/ EAccept 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 (EAccept <= 5e-240) {
tmp = NaChar / (exp((Ev / KbT)) - -1.0);
} else if (EAccept <= 3.15e+41) {
tmp = NdChar / (1.0 + exp((EDonor / KbT)));
} else if (EAccept <= 3.6e+120) {
tmp = NdChar / (1.0 + exp((Vef / KbT)));
} else {
tmp = NaChar / (exp((EAccept / 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 (eaccept <= 5d-240) then
tmp = nachar / (exp((ev / kbt)) - (-1.0d0))
else if (eaccept <= 3.15d+41) then
tmp = ndchar / (1.0d0 + exp((edonor / kbt)))
else if (eaccept <= 3.6d+120) then
tmp = ndchar / (1.0d0 + exp((vef / kbt)))
else
tmp = nachar / (exp((eaccept / 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 (EAccept <= 5e-240) {
tmp = NaChar / (Math.exp((Ev / KbT)) - -1.0);
} else if (EAccept <= 3.15e+41) {
tmp = NdChar / (1.0 + Math.exp((EDonor / KbT)));
} else if (EAccept <= 3.6e+120) {
tmp = NdChar / (1.0 + Math.exp((Vef / KbT)));
} else {
tmp = NaChar / (Math.exp((EAccept / KbT)) - -1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if EAccept <= 5e-240: tmp = NaChar / (math.exp((Ev / KbT)) - -1.0) elif EAccept <= 3.15e+41: tmp = NdChar / (1.0 + math.exp((EDonor / KbT))) elif EAccept <= 3.6e+120: tmp = NdChar / (1.0 + math.exp((Vef / KbT))) else: tmp = NaChar / (math.exp((EAccept / KbT)) - -1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (EAccept <= 5e-240) tmp = Float64(NaChar / Float64(exp(Float64(Ev / KbT)) - -1.0)); elseif (EAccept <= 3.15e+41) tmp = Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT)))); elseif (EAccept <= 3.6e+120) tmp = Float64(NdChar / Float64(1.0 + exp(Float64(Vef / KbT)))); else tmp = Float64(NaChar / Float64(exp(Float64(EAccept / KbT)) - -1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if (EAccept <= 5e-240) tmp = NaChar / (exp((Ev / KbT)) - -1.0); elseif (EAccept <= 3.15e+41) tmp = NdChar / (1.0 + exp((EDonor / KbT))); elseif (EAccept <= 3.6e+120) tmp = NdChar / (1.0 + exp((Vef / KbT))); else tmp = NaChar / (exp((EAccept / KbT)) - -1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[EAccept, 5e-240], N[(NaChar / N[(N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[EAccept, 3.15e+41], N[(NdChar / N[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[EAccept, 3.6e+120], N[(NdChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(NaChar / N[(N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;EAccept \leq 5 \cdot 10^{-240}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} - -1}\\
\mathbf{elif}\;EAccept \leq 3.15 \cdot 10^{+41}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\
\mathbf{elif}\;EAccept \leq 3.6 \cdot 10^{+120}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{Vef}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} - -1}\\
\end{array}
\end{array}
if EAccept < 5.0000000000000004e-240Initial program 100.0%
Taylor expanded in NdChar 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
lower-+.f6463.8
Applied rewrites63.8%
Taylor expanded in Ev around inf
Applied rewrites37.0%
if 5.0000000000000004e-240 < EAccept < 3.1499999999999999e41Initial program 100.0%
Taylor expanded in NaChar around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.6%
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 rewrites83.6%
Taylor expanded in NdChar around inf
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-+.f6463.9
Applied rewrites63.9%
Taylor expanded in EDonor around inf
Applied rewrites43.4%
if 3.1499999999999999e41 < EAccept < 3.60000000000000016e120Initial program 100.0%
Taylor expanded in NaChar around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites89.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 rewrites83.6%
Taylor expanded in NdChar around inf
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-+.f6467.8
Applied rewrites67.8%
Taylor expanded in Vef around inf
Applied rewrites45.4%
if 3.60000000000000016e120 < EAccept Initial program 100.0%
Taylor expanded in NdChar 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
lower-+.f6469.3
Applied rewrites69.3%
Taylor expanded in EAccept around inf
Applied rewrites59.8%
Final simplification42.8%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (* (+ NaChar NdChar) 0.5)))
(if (<= KbT -1.05e+165)
t_0
(if (<= KbT -9.5e-52)
(/ NaChar (- (exp (/ EAccept KbT)) -1.0))
(if (<= KbT 1.22e+101) (/ NaChar (- (exp (/ Ev KbT)) -1.0)) t_0)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar + NdChar) * 0.5;
double tmp;
if (KbT <= -1.05e+165) {
tmp = t_0;
} else if (KbT <= -9.5e-52) {
tmp = NaChar / (exp((EAccept / KbT)) - -1.0);
} else if (KbT <= 1.22e+101) {
tmp = NaChar / (exp((Ev / KbT)) - -1.0);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = (nachar + ndchar) * 0.5d0
if (kbt <= (-1.05d+165)) then
tmp = t_0
else if (kbt <= (-9.5d-52)) then
tmp = nachar / (exp((eaccept / kbt)) - (-1.0d0))
else if (kbt <= 1.22d+101) then
tmp = nachar / (exp((ev / kbt)) - (-1.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar + NdChar) * 0.5;
double tmp;
if (KbT <= -1.05e+165) {
tmp = t_0;
} else if (KbT <= -9.5e-52) {
tmp = NaChar / (Math.exp((EAccept / KbT)) - -1.0);
} else if (KbT <= 1.22e+101) {
tmp = NaChar / (Math.exp((Ev / KbT)) - -1.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NaChar + NdChar) * 0.5 tmp = 0 if KbT <= -1.05e+165: tmp = t_0 elif KbT <= -9.5e-52: tmp = NaChar / (math.exp((EAccept / KbT)) - -1.0) elif KbT <= 1.22e+101: tmp = NaChar / (math.exp((Ev / KbT)) - -1.0) 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) tmp = 0.0 if (KbT <= -1.05e+165) tmp = t_0; elseif (KbT <= -9.5e-52) tmp = Float64(NaChar / Float64(exp(Float64(EAccept / KbT)) - -1.0)); elseif (KbT <= 1.22e+101) tmp = Float64(NaChar / Float64(exp(Float64(Ev / KbT)) - -1.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NaChar + NdChar) * 0.5; tmp = 0.0; if (KbT <= -1.05e+165) tmp = t_0; elseif (KbT <= -9.5e-52) tmp = NaChar / (exp((EAccept / KbT)) - -1.0); elseif (KbT <= 1.22e+101) tmp = NaChar / (exp((Ev / KbT)) - -1.0); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[KbT, -1.05e+165], t$95$0, If[LessEqual[KbT, -9.5e-52], N[(NaChar / N[(N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 1.22e+101], N[(NaChar / N[(N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
\mathbf{if}\;KbT \leq -1.05 \cdot 10^{+165}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;KbT \leq -9.5 \cdot 10^{-52}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} - -1}\\
\mathbf{elif}\;KbT \leq 1.22 \cdot 10^{+101}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} - -1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if KbT < -1.05e165 or 1.22e101 < KbT Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6476.5
Applied rewrites76.5%
if -1.05e165 < KbT < -9.50000000000000007e-52Initial program 100.0%
Taylor expanded in NdChar 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
lower-+.f6475.3
Applied rewrites75.3%
Taylor expanded in EAccept around inf
Applied rewrites44.2%
if -9.50000000000000007e-52 < KbT < 1.22e101Initial program 100.0%
Taylor expanded in NdChar 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
lower-+.f6461.1
Applied rewrites61.1%
Taylor expanded in Ev around inf
Applied rewrites34.8%
Final simplification47.6%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(if (<= EAccept 5e-240)
(/ NaChar (- (exp (/ Ev KbT)) -1.0))
(if (<= EAccept 2e+79)
(/ NdChar (+ 1.0 (exp (/ EDonor KbT))))
(/ NaChar (- (exp (/ EAccept 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 (EAccept <= 5e-240) {
tmp = NaChar / (exp((Ev / KbT)) - -1.0);
} else if (EAccept <= 2e+79) {
tmp = NdChar / (1.0 + exp((EDonor / KbT)));
} else {
tmp = NaChar / (exp((EAccept / 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 (eaccept <= 5d-240) then
tmp = nachar / (exp((ev / kbt)) - (-1.0d0))
else if (eaccept <= 2d+79) then
tmp = ndchar / (1.0d0 + exp((edonor / kbt)))
else
tmp = nachar / (exp((eaccept / 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 (EAccept <= 5e-240) {
tmp = NaChar / (Math.exp((Ev / KbT)) - -1.0);
} else if (EAccept <= 2e+79) {
tmp = NdChar / (1.0 + Math.exp((EDonor / KbT)));
} else {
tmp = NaChar / (Math.exp((EAccept / KbT)) - -1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if EAccept <= 5e-240: tmp = NaChar / (math.exp((Ev / KbT)) - -1.0) elif EAccept <= 2e+79: tmp = NdChar / (1.0 + math.exp((EDonor / KbT))) else: tmp = NaChar / (math.exp((EAccept / KbT)) - -1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (EAccept <= 5e-240) tmp = Float64(NaChar / Float64(exp(Float64(Ev / KbT)) - -1.0)); elseif (EAccept <= 2e+79) tmp = Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT)))); else tmp = Float64(NaChar / Float64(exp(Float64(EAccept / KbT)) - -1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if (EAccept <= 5e-240) tmp = NaChar / (exp((Ev / KbT)) - -1.0); elseif (EAccept <= 2e+79) tmp = NdChar / (1.0 + exp((EDonor / KbT))); else tmp = NaChar / (exp((EAccept / KbT)) - -1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[EAccept, 5e-240], N[(NaChar / N[(N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[EAccept, 2e+79], N[(NdChar / N[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(NaChar / N[(N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;EAccept \leq 5 \cdot 10^{-240}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} - -1}\\
\mathbf{elif}\;EAccept \leq 2 \cdot 10^{+79}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} - -1}\\
\end{array}
\end{array}
if EAccept < 5.0000000000000004e-240Initial program 100.0%
Taylor expanded in NdChar 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
lower-+.f6463.8
Applied rewrites63.8%
Taylor expanded in Ev around inf
Applied rewrites37.0%
if 5.0000000000000004e-240 < EAccept < 1.99999999999999993e79Initial program 100.0%
Taylor expanded in NaChar around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites93.2%
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 rewrites83.5%
Taylor expanded in NdChar around inf
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-+.f6467.0
Applied rewrites67.0%
Taylor expanded in EDonor around inf
Applied rewrites45.5%
if 1.99999999999999993e79 < EAccept Initial program 100.0%
Taylor expanded in NdChar 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
lower-+.f6467.2
Applied rewrites67.2%
Taylor expanded in EAccept around inf
Applied rewrites54.3%
Final simplification42.9%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(if (<= Ev -7.5e+14)
(/ NaChar (- (exp (/ Ev KbT)) -1.0))
(if (<= Ev 1.65e-149)
(/ NaChar (- (exp (/ Vef KbT)) -1.0))
(/ NaChar (- (exp (/ EAccept 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 (Ev <= -7.5e+14) {
tmp = NaChar / (exp((Ev / KbT)) - -1.0);
} else if (Ev <= 1.65e-149) {
tmp = NaChar / (exp((Vef / KbT)) - -1.0);
} else {
tmp = NaChar / (exp((EAccept / 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 (ev <= (-7.5d+14)) then
tmp = nachar / (exp((ev / kbt)) - (-1.0d0))
else if (ev <= 1.65d-149) then
tmp = nachar / (exp((vef / kbt)) - (-1.0d0))
else
tmp = nachar / (exp((eaccept / 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 (Ev <= -7.5e+14) {
tmp = NaChar / (Math.exp((Ev / KbT)) - -1.0);
} else if (Ev <= 1.65e-149) {
tmp = NaChar / (Math.exp((Vef / KbT)) - -1.0);
} else {
tmp = NaChar / (Math.exp((EAccept / KbT)) - -1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if Ev <= -7.5e+14: tmp = NaChar / (math.exp((Ev / KbT)) - -1.0) elif Ev <= 1.65e-149: tmp = NaChar / (math.exp((Vef / KbT)) - -1.0) else: tmp = NaChar / (math.exp((EAccept / KbT)) - -1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (Ev <= -7.5e+14) tmp = Float64(NaChar / Float64(exp(Float64(Ev / KbT)) - -1.0)); elseif (Ev <= 1.65e-149) tmp = Float64(NaChar / Float64(exp(Float64(Vef / KbT)) - -1.0)); else tmp = Float64(NaChar / Float64(exp(Float64(EAccept / KbT)) - -1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if (Ev <= -7.5e+14) tmp = NaChar / (exp((Ev / KbT)) - -1.0); elseif (Ev <= 1.65e-149) tmp = NaChar / (exp((Vef / KbT)) - -1.0); else tmp = NaChar / (exp((EAccept / KbT)) - -1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[Ev, -7.5e+14], N[(NaChar / N[(N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[Ev, 1.65e-149], N[(NaChar / N[(N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], N[(NaChar / N[(N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;Ev \leq -7.5 \cdot 10^{+14}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} - -1}\\
\mathbf{elif}\;Ev \leq 1.65 \cdot 10^{-149}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} - -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} - -1}\\
\end{array}
\end{array}
if Ev < -7.5e14Initial program 100.0%
Taylor expanded in NdChar 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
lower-+.f6455.6
Applied rewrites55.6%
Taylor expanded in Ev around inf
Applied rewrites45.3%
if -7.5e14 < Ev < 1.65000000000000009e-149Initial program 100.0%
Taylor expanded in NdChar 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
lower-+.f6466.0
Applied rewrites66.0%
Taylor expanded in Vef around inf
Applied rewrites45.0%
if 1.65000000000000009e-149 < Ev Initial program 100.0%
Taylor expanded in NdChar 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
lower-+.f6456.9
Applied rewrites56.9%
Taylor expanded in EAccept around inf
Applied rewrites41.8%
Final simplification44.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (* (+ NaChar NdChar) 0.5)))
(if (<= KbT -1.05e+165)
t_0
(if (<= KbT 5.6e+30) (/ NaChar (- (exp (/ EAccept KbT)) -1.0)) t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar + NdChar) * 0.5;
double tmp;
if (KbT <= -1.05e+165) {
tmp = t_0;
} else if (KbT <= 5.6e+30) {
tmp = NaChar / (exp((EAccept / KbT)) - -1.0);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = (nachar + ndchar) * 0.5d0
if (kbt <= (-1.05d+165)) then
tmp = t_0
else if (kbt <= 5.6d+30) then
tmp = nachar / (exp((eaccept / kbt)) - (-1.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar + NdChar) * 0.5;
double tmp;
if (KbT <= -1.05e+165) {
tmp = t_0;
} else if (KbT <= 5.6e+30) {
tmp = NaChar / (Math.exp((EAccept / KbT)) - -1.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NaChar + NdChar) * 0.5 tmp = 0 if KbT <= -1.05e+165: tmp = t_0 elif KbT <= 5.6e+30: tmp = NaChar / (math.exp((EAccept / KbT)) - -1.0) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NaChar + NdChar) * 0.5) tmp = 0.0 if (KbT <= -1.05e+165) tmp = t_0; elseif (KbT <= 5.6e+30) tmp = Float64(NaChar / Float64(exp(Float64(EAccept / KbT)) - -1.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NaChar + NdChar) * 0.5; tmp = 0.0; if (KbT <= -1.05e+165) tmp = t_0; elseif (KbT <= 5.6e+30) tmp = NaChar / (exp((EAccept / KbT)) - -1.0); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[KbT, -1.05e+165], t$95$0, If[LessEqual[KbT, 5.6e+30], N[(NaChar / N[(N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
\mathbf{if}\;KbT \leq -1.05 \cdot 10^{+165}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;KbT \leq 5.6 \cdot 10^{+30}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} - -1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if KbT < -1.05e165 or 5.59999999999999966e30 < KbT Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6466.3
Applied rewrites66.3%
if -1.05e165 < KbT < 5.59999999999999966e30Initial program 100.0%
Taylor expanded in NdChar 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
lower-+.f6466.2
Applied rewrites66.2%
Taylor expanded in EAccept around inf
Applied rewrites39.1%
Final simplification48.1%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (if (<= NaChar -1.45e+57) (* 0.5 NaChar) (if (<= NaChar 1.02e+35) (* 0.5 NdChar) (* 0.5 NaChar))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (NaChar <= -1.45e+57) {
tmp = 0.5 * NaChar;
} else if (NaChar <= 1.02e+35) {
tmp = 0.5 * NdChar;
} else {
tmp = 0.5 * NaChar;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: tmp
if (nachar <= (-1.45d+57)) then
tmp = 0.5d0 * nachar
else if (nachar <= 1.02d+35) then
tmp = 0.5d0 * ndchar
else
tmp = 0.5d0 * nachar
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (NaChar <= -1.45e+57) {
tmp = 0.5 * NaChar;
} else if (NaChar <= 1.02e+35) {
tmp = 0.5 * NdChar;
} else {
tmp = 0.5 * NaChar;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if NaChar <= -1.45e+57: tmp = 0.5 * NaChar elif NaChar <= 1.02e+35: tmp = 0.5 * NdChar else: tmp = 0.5 * NaChar return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (NaChar <= -1.45e+57) tmp = Float64(0.5 * NaChar); elseif (NaChar <= 1.02e+35) tmp = Float64(0.5 * NdChar); else tmp = Float64(0.5 * NaChar); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if (NaChar <= -1.45e+57) tmp = 0.5 * NaChar; elseif (NaChar <= 1.02e+35) tmp = 0.5 * NdChar; else tmp = 0.5 * NaChar; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[NaChar, -1.45e+57], N[(0.5 * NaChar), $MachinePrecision], If[LessEqual[NaChar, 1.02e+35], N[(0.5 * NdChar), $MachinePrecision], N[(0.5 * NaChar), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;NaChar \leq -1.45 \cdot 10^{+57}:\\
\;\;\;\;0.5 \cdot NaChar\\
\mathbf{elif}\;NaChar \leq 1.02 \cdot 10^{+35}:\\
\;\;\;\;0.5 \cdot NdChar\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot NaChar\\
\end{array}
\end{array}
if NaChar < -1.4500000000000001e57 or 1.02000000000000007e35 < NaChar Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6432.5
Applied rewrites32.5%
Taylor expanded in NdChar around 0
Applied rewrites29.1%
if -1.4500000000000001e57 < NaChar < 1.02000000000000007e35Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6430.9
Applied rewrites30.9%
Taylor expanded in NdChar around 0
Applied rewrites12.8%
Taylor expanded in NdChar around inf
Applied rewrites25.0%
(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-+.f6431.6
Applied rewrites31.6%
Final simplification31.6%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (* 0.5 NaChar))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return 0.5 * NaChar;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
code = 0.5d0 * nachar
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return 0.5 * NaChar;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): return 0.5 * NaChar
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) return Float64(0.5 * NaChar) end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.5 * NaChar; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(0.5 * NaChar), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot NaChar
\end{array}
Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6431.6
Applied rewrites31.6%
Taylor expanded in NdChar around 0
Applied rewrites19.5%
herbie shell --seed 2024296
(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))))))