
(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 18 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 (/ (- (- (- (- 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) - 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) - 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 (* 0.5 (+ NdChar NaChar)))
(t_1
(+
(/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT))))
(/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))))))
(if (<= t_1 -5e-263)
t_0
(if (<= t_1 0.0)
(* 0.5 (* (* NdChar NdChar) (pow (- NdChar NaChar) -1.0)))
(if (<= t_1 10.0) (* 0.5 NdChar) t_0)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = 0.5 * (NdChar + NaChar);
double t_1 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
double tmp;
if (t_1 <= -5e-263) {
tmp = t_0;
} else if (t_1 <= 0.0) {
tmp = 0.5 * ((NdChar * NdChar) * pow((NdChar - NaChar), -1.0));
} else if (t_1 <= 10.0) {
tmp = 0.5 * NdChar;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 0.5d0 * (ndchar + nachar)
t_1 = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + (nachar / (1.0d0 + exp(((((ev + vef) + eaccept) - mu) / kbt))))
if (t_1 <= (-5d-263)) then
tmp = t_0
else if (t_1 <= 0.0d0) then
tmp = 0.5d0 * ((ndchar * ndchar) * ((ndchar - nachar) ** (-1.0d0)))
else if (t_1 <= 10.0d0) then
tmp = 0.5d0 * ndchar
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = 0.5 * (NdChar + NaChar);
double t_1 = (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
double tmp;
if (t_1 <= -5e-263) {
tmp = t_0;
} else if (t_1 <= 0.0) {
tmp = 0.5 * ((NdChar * NdChar) * Math.pow((NdChar - NaChar), -1.0));
} else if (t_1 <= 10.0) {
tmp = 0.5 * NdChar;
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = 0.5 * (NdChar + NaChar) t_1 = (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) tmp = 0 if t_1 <= -5e-263: tmp = t_0 elif t_1 <= 0.0: tmp = 0.5 * ((NdChar * NdChar) * math.pow((NdChar - NaChar), -1.0)) elif t_1 <= 10.0: tmp = 0.5 * NdChar else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(0.5 * Float64(NdChar + NaChar)) t_1 = 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) - mu) / KbT))))) tmp = 0.0 if (t_1 <= -5e-263) tmp = t_0; elseif (t_1 <= 0.0) tmp = Float64(0.5 * Float64(Float64(NdChar * NdChar) * (Float64(NdChar - NaChar) ^ -1.0))); elseif (t_1 <= 10.0) tmp = Float64(0.5 * NdChar); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = 0.5 * (NdChar + NaChar); t_1 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)))); tmp = 0.0; if (t_1 <= -5e-263) tmp = t_0; elseif (t_1 <= 0.0) tmp = 0.5 * ((NdChar * NdChar) * ((NdChar - NaChar) ^ -1.0)); elseif (t_1 <= 10.0) tmp = 0.5 * NdChar; else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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]}, If[LessEqual[t$95$1, -5e-263], t$95$0, If[LessEqual[t$95$1, 0.0], N[(0.5 * N[(N[(NdChar * NdChar), $MachinePrecision] * N[Power[N[(NdChar - NaChar), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 10.0], N[(0.5 * NdChar), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
t_1 := \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) - mu}{KbT}}}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-263}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;0.5 \cdot \left(\left(NdChar \cdot NdChar\right) \cdot {\left(NdChar - NaChar\right)}^{-1}\right)\\
\mathbf{elif}\;t\_1 \leq 10:\\
\;\;\;\;0.5 \cdot NdChar\\
\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.00000000000000006e-263 or 10 < (+.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-+.f6436.3
Applied rewrites36.3%
if -5.00000000000000006e-263 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 0.0Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f642.9
Applied rewrites2.9%
Applied rewrites4.8%
Taylor expanded in NdChar around inf
Applied rewrites27.0%
if 0.0 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 10Initial program 99.9%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6418.3
Applied rewrites18.3%
Taylor expanded in NdChar around inf
Applied rewrites34.5%
Final simplification34.3%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))))
(t_1
(+
(/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT))))
t_0)))
(if (or (<= t_1 -5e-177) (not (<= t_1 2e-124)))
(+ (/ NdChar (+ 1.0 (exp (/ EDonor KbT)))) t_0)
(/ NdChar (+ (exp (/ (- (+ (+ mu Vef) EDonor) 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 = NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)));
double t_1 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + t_0;
double tmp;
if ((t_1 <= -5e-177) || !(t_1 <= 2e-124)) {
tmp = (NdChar / (1.0 + exp((EDonor / KbT)))) + t_0;
} else {
tmp = NdChar / (exp(((((mu + Vef) + EDonor) - 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) :: t_1
real(8) :: tmp
t_0 = nachar / (1.0d0 + exp(((((ev + vef) + eaccept) - mu) / kbt)))
t_1 = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + t_0
if ((t_1 <= (-5d-177)) .or. (.not. (t_1 <= 2d-124))) then
tmp = (ndchar / (1.0d0 + exp((edonor / kbt)))) + t_0
else
tmp = ndchar / (exp(((((mu + vef) + edonor) - 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 = NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)));
double t_1 = (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + t_0;
double tmp;
if ((t_1 <= -5e-177) || !(t_1 <= 2e-124)) {
tmp = (NdChar / (1.0 + Math.exp((EDonor / KbT)))) + t_0;
} else {
tmp = NdChar / (Math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) - mu) / KbT))) t_1 = (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + t_0 tmp = 0 if (t_1 <= -5e-177) or not (t_1 <= 2e-124): tmp = (NdChar / (1.0 + math.exp((EDonor / KbT)))) + t_0 else: tmp = NdChar / (math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)))) t_1 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) + t_0) tmp = 0.0 if ((t_1 <= -5e-177) || !(t_1 <= 2e-124)) tmp = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT)))) + t_0); else tmp = Float64(NdChar / Float64(exp(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT)) + 1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT))); t_1 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + t_0; tmp = 0.0; if ((t_1 <= -5e-177) || ~((t_1 <= 2e-124))) tmp = (NdChar / (1.0 + exp((EDonor / KbT)))) + t_0; else tmp = NdChar / (exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(1.0 + N[Exp[N[((-N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision]) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -5e-177], N[Not[LessEqual[t$95$1, 2e-124]], $MachinePrecision]], N[(N[(NdChar / N[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], N[(NdChar / N[(N[Exp[N[(N[(N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}}\\
t_1 := \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + t\_0\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-177} \lor \neg \left(t\_1 \leq 2 \cdot 10^{-124}\right):\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} + t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}} + 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))))) < -5e-177 or 1.99999999999999987e-124 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 99.9%
Taylor expanded in EDonor around inf
lower-/.f6483.9
Applied rewrites83.9%
if -5e-177 < (+.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.99999999999999987e-124Initial program 100.0%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites73.8%
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-+.f6487.5
Applied rewrites87.5%
Final simplification85.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))))
(t_1
(+
(/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT))))
t_0)))
(if (<= t_1 -5e-177)
(+ (/ NdChar (+ 1.0 (exp (/ EDonor KbT)))) t_0)
(if (<= t_1 1e-58)
(/ NdChar (+ (exp (/ (- (+ (+ mu Vef) EDonor) Ec) KbT)) 1.0))
(+ (/ NdChar (+ 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 = NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)));
double t_1 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + t_0;
double tmp;
if (t_1 <= -5e-177) {
tmp = (NdChar / (1.0 + exp((EDonor / KbT)))) + t_0;
} else if (t_1 <= 1e-58) {
tmp = NdChar / (exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0);
} else {
tmp = (NdChar / (1.0 + exp((Vef / KbT)))) + t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = nachar / (1.0d0 + exp(((((ev + vef) + eaccept) - mu) / kbt)))
t_1 = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + t_0
if (t_1 <= (-5d-177)) then
tmp = (ndchar / (1.0d0 + exp((edonor / kbt)))) + t_0
else if (t_1 <= 1d-58) then
tmp = ndchar / (exp(((((mu + vef) + edonor) - ec) / kbt)) + 1.0d0)
else
tmp = (ndchar / (1.0d0 + exp((vef / kbt)))) + 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(((((Ev + Vef) + EAccept) - mu) / KbT)));
double t_1 = (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + t_0;
double tmp;
if (t_1 <= -5e-177) {
tmp = (NdChar / (1.0 + Math.exp((EDonor / KbT)))) + t_0;
} else if (t_1 <= 1e-58) {
tmp = NdChar / (Math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0);
} else {
tmp = (NdChar / (1.0 + Math.exp((Vef / KbT)))) + t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) - mu) / KbT))) t_1 = (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + t_0 tmp = 0 if t_1 <= -5e-177: tmp = (NdChar / (1.0 + math.exp((EDonor / KbT)))) + t_0 elif t_1 <= 1e-58: tmp = NdChar / (math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0) else: tmp = (NdChar / (1.0 + math.exp((Vef / KbT)))) + t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)))) t_1 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) + t_0) tmp = 0.0 if (t_1 <= -5e-177) tmp = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT)))) + t_0); elseif (t_1 <= 1e-58) tmp = Float64(NdChar / Float64(exp(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT)) + 1.0)); else tmp = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Vef / KbT)))) + 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(((((Ev + Vef) + EAccept) - mu) / KbT))); t_1 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + t_0; tmp = 0.0; if (t_1 <= -5e-177) tmp = (NdChar / (1.0 + exp((EDonor / KbT)))) + t_0; elseif (t_1 <= 1e-58) tmp = NdChar / (exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0); else tmp = (NdChar / (1.0 + exp((Vef / KbT)))) + t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(1.0 + N[Exp[N[((-N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision]) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-177], N[(N[(NdChar / N[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision], If[LessEqual[t$95$1, 1e-58], N[(NdChar / N[(N[Exp[N[(N[(N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(NdChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}}\\
t_1 := \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + t\_0\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-177}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} + t\_0\\
\mathbf{elif}\;t\_1 \leq 10^{-58}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}} + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{Vef}{KbT}}} + t\_0\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -5e-177Initial program 100.0%
Taylor expanded in EDonor around inf
lower-/.f6484.5
Applied rewrites84.5%
if -5e-177 < (+.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-58Initial program 100.0%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites73.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-+.f6486.8
Applied rewrites86.8%
if 1e-58 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 99.9%
Taylor expanded in Vef around inf
lower-/.f6485.1
Applied rewrites85.1%
Final simplification85.4%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0
(+
(/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT))))
(/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))))))
(if (or (<= t_0 -2e-275) (not (<= t_0 2e-124)))
(+
(/ NdChar (+ (exp (/ (- EDonor Ec) KbT)) 1.0))
(/ NaChar (+ (exp (/ (+ EAccept Ev) KbT)) 1.0)))
(/ NdChar (+ (exp (/ (- (+ (+ mu Vef) EDonor) 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 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
double tmp;
if ((t_0 <= -2e-275) || !(t_0 <= 2e-124)) {
tmp = (NdChar / (exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (exp(((EAccept + Ev) / KbT)) + 1.0));
} else {
tmp = NdChar / (exp(((((mu + Vef) + EDonor) - 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 = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + (nachar / (1.0d0 + exp(((((ev + vef) + eaccept) - mu) / kbt))))
if ((t_0 <= (-2d-275)) .or. (.not. (t_0 <= 2d-124))) then
tmp = (ndchar / (exp(((edonor - ec) / kbt)) + 1.0d0)) + (nachar / (exp(((eaccept + ev) / kbt)) + 1.0d0))
else
tmp = ndchar / (exp(((((mu + vef) + edonor) - 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 = (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
double tmp;
if ((t_0 <= -2e-275) || !(t_0 <= 2e-124)) {
tmp = (NdChar / (Math.exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (Math.exp(((EAccept + Ev) / KbT)) + 1.0));
} else {
tmp = NdChar / (Math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) tmp = 0 if (t_0 <= -2e-275) or not (t_0 <= 2e-124): tmp = (NdChar / (math.exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (math.exp(((EAccept + Ev) / KbT)) + 1.0)) else: tmp = NdChar / (math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) + Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT))))) tmp = 0.0 if ((t_0 <= -2e-275) || !(t_0 <= 2e-124)) tmp = Float64(Float64(NdChar / Float64(exp(Float64(Float64(EDonor - Ec) / KbT)) + 1.0)) + Float64(NaChar / Float64(exp(Float64(Float64(EAccept + Ev) / KbT)) + 1.0))); else tmp = Float64(NdChar / Float64(exp(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT)) + 1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)))); tmp = 0.0; if ((t_0 <= -2e-275) || ~((t_0 <= 2e-124))) tmp = (NdChar / (exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (exp(((EAccept + Ev) / KbT)) + 1.0)); else tmp = NdChar / (exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NdChar / N[(1.0 + N[Exp[N[((-N[(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]}, If[Or[LessEqual[t$95$0, -2e-275], N[Not[LessEqual[t$95$0, 2e-124]], $MachinePrecision]], N[(N[(NdChar / N[(N[Exp[N[(N[(EDonor - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(N[Exp[N[(N[(EAccept + Ev), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(NdChar / N[(N[Exp[N[(N[(N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-275} \lor \neg \left(t\_0 \leq 2 \cdot 10^{-124}\right):\\
\;\;\;\;\frac{NdChar}{e^{\frac{EDonor - Ec}{KbT}} + 1} + \frac{NaChar}{e^{\frac{EAccept + Ev}{KbT}} + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}} + 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))))) < -1.99999999999999987e-275 or 1.99999999999999987e-124 < (+.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 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
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites89.9%
Taylor expanded in mu around 0
Applied rewrites75.0%
if -1.99999999999999987e-275 < (+.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.99999999999999987e-124Initial program 100.0%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites69.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-+.f6494.5
Applied rewrites94.5%
Final simplification80.2%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0
(+
(/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT))))
(/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))))))
(if (or (<= t_0 -2e-171) (not (<= t_0 1e-58)))
(+
(/ NdChar (+ (exp (/ (- EDonor Ec) KbT)) 1.0))
(/ NaChar (+ 1.0 (exp (/ Ev KbT)))))
(/ NdChar (+ (exp (/ (- (+ (+ mu Vef) EDonor) 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 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
double tmp;
if ((t_0 <= -2e-171) || !(t_0 <= 1e-58)) {
tmp = (NdChar / (exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (1.0 + exp((Ev / KbT))));
} else {
tmp = NdChar / (exp(((((mu + Vef) + EDonor) - 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 = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + (nachar / (1.0d0 + exp(((((ev + vef) + eaccept) - mu) / kbt))))
if ((t_0 <= (-2d-171)) .or. (.not. (t_0 <= 1d-58))) then
tmp = (ndchar / (exp(((edonor - ec) / kbt)) + 1.0d0)) + (nachar / (1.0d0 + exp((ev / kbt))))
else
tmp = ndchar / (exp(((((mu + vef) + edonor) - 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 = (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
double tmp;
if ((t_0 <= -2e-171) || !(t_0 <= 1e-58)) {
tmp = (NdChar / (Math.exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (1.0 + Math.exp((Ev / KbT))));
} else {
tmp = NdChar / (Math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) tmp = 0 if (t_0 <= -2e-171) or not (t_0 <= 1e-58): tmp = (NdChar / (math.exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (1.0 + math.exp((Ev / KbT)))) else: tmp = NdChar / (math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) + Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT))))) tmp = 0.0 if ((t_0 <= -2e-171) || !(t_0 <= 1e-58)) tmp = Float64(Float64(NdChar / Float64(exp(Float64(Float64(EDonor - Ec) / KbT)) + 1.0)) + Float64(NaChar / Float64(1.0 + exp(Float64(Ev / KbT))))); else tmp = Float64(NdChar / Float64(exp(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT)) + 1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)))); tmp = 0.0; if ((t_0 <= -2e-171) || ~((t_0 <= 1e-58))) tmp = (NdChar / (exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (1.0 + exp((Ev / KbT)))); else tmp = NdChar / (exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NdChar / N[(1.0 + N[Exp[N[((-N[(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]}, If[Or[LessEqual[t$95$0, -2e-171], N[Not[LessEqual[t$95$0, 1e-58]], $MachinePrecision]], N[(N[(NdChar / N[(N[Exp[N[(N[(EDonor - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(NdChar / N[(N[Exp[N[(N[(N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-171} \lor \neg \left(t\_0 \leq 10^{-58}\right):\\
\;\;\;\;\frac{NdChar}{e^{\frac{EDonor - Ec}{KbT}} + 1} + \frac{NaChar}{1 + e^{\frac{Ev}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}} + 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))))) < -2e-171 or 1e-58 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 99.9%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites90.4%
Taylor expanded in mu around 0
Applied rewrites77.0%
Taylor expanded in EAccept around 0
Applied rewrites66.3%
if -2e-171 < (+.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-58Initial program 100.0%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites72.8%
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-+.f6485.8
Applied rewrites85.8%
Final simplification72.8%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0
(+
(/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT))))
(/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))))))
(if (or (<= t_0 -1e-82) (not (<= t_0 10.0)))
(* 0.5 (+ NdChar NaChar))
(*
(pow
(+ (+ 1.0 (+ (/ EDonor KbT) (+ (/ Vef KbT) (/ (- mu Ec) KbT)))) 1.0)
-1.0)
NdChar))))
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((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
double tmp;
if ((t_0 <= -1e-82) || !(t_0 <= 10.0)) {
tmp = 0.5 * (NdChar + NaChar);
} else {
tmp = pow(((1.0 + ((EDonor / KbT) + ((Vef / KbT) + ((mu - Ec) / KbT)))) + 1.0), -1.0) * 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) :: t_0
real(8) :: tmp
t_0 = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + (nachar / (1.0d0 + exp(((((ev + vef) + eaccept) - mu) / kbt))))
if ((t_0 <= (-1d-82)) .or. (.not. (t_0 <= 10.0d0))) then
tmp = 0.5d0 * (ndchar + nachar)
else
tmp = (((1.0d0 + ((edonor / kbt) + ((vef / kbt) + ((mu - ec) / kbt)))) + 1.0d0) ** (-1.0d0)) * 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 t_0 = (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
double tmp;
if ((t_0 <= -1e-82) || !(t_0 <= 10.0)) {
tmp = 0.5 * (NdChar + NaChar);
} else {
tmp = Math.pow(((1.0 + ((EDonor / KbT) + ((Vef / KbT) + ((mu - Ec) / KbT)))) + 1.0), -1.0) * NdChar;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) tmp = 0 if (t_0 <= -1e-82) or not (t_0 <= 10.0): tmp = 0.5 * (NdChar + NaChar) else: tmp = math.pow(((1.0 + ((EDonor / KbT) + ((Vef / KbT) + ((mu - Ec) / KbT)))) + 1.0), -1.0) * NdChar return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = 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) - mu) / KbT))))) tmp = 0.0 if ((t_0 <= -1e-82) || !(t_0 <= 10.0)) tmp = Float64(0.5 * Float64(NdChar + NaChar)); else tmp = Float64((Float64(Float64(1.0 + Float64(Float64(EDonor / KbT) + Float64(Float64(Vef / KbT) + Float64(Float64(mu - Ec) / KbT)))) + 1.0) ^ -1.0) * NdChar); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)))); tmp = 0.0; if ((t_0 <= -1e-82) || ~((t_0 <= 10.0))) tmp = 0.5 * (NdChar + NaChar); else tmp = (((1.0 + ((EDonor / KbT) + ((Vef / KbT) + ((mu - Ec) / KbT)))) + 1.0) ^ -1.0) * NdChar; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NdChar / N[(1.0 + N[Exp[N[((-N[(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]}, If[Or[LessEqual[t$95$0, -1e-82], N[Not[LessEqual[t$95$0, 10.0]], $MachinePrecision]], N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision], N[(N[Power[N[(N[(1.0 + N[(N[(EDonor / KbT), $MachinePrecision] + N[(N[(Vef / KbT), $MachinePrecision] + N[(N[(mu - Ec), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + 1.0), $MachinePrecision], -1.0], $MachinePrecision] * NdChar), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}}\\
\mathbf{if}\;t\_0 \leq -1 \cdot 10^{-82} \lor \neg \left(t\_0 \leq 10\right):\\
\;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\left(1 + \left(\frac{EDonor}{KbT} + \left(\frac{Vef}{KbT} + \frac{mu - Ec}{KbT}\right)\right)\right) + 1\right)}^{-1} \cdot NdChar\\
\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-82 or 10 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 99.9%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6439.4
Applied rewrites39.4%
if -1e-82 < (+.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))))) < 10Initial program 100.0%
Taylor expanded in NdChar around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites92.9%
Taylor expanded in NdChar around inf
Applied rewrites79.5%
Taylor expanded in KbT around inf
Applied rewrites35.9%
Final simplification38.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(if (or (<= Vef -5.2e+121) (not (<= Vef 1.55e+139)))
(+
(/ NdChar (+ 1.0 (exp (/ Vef KbT))))
(/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))))
(+
(/ NdChar (+ (exp (/ (- (+ mu EDonor) Ec) KbT)) 1.0))
(/ NaChar (+ (exp (/ (- (+ EAccept Ev) 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 ((Vef <= -5.2e+121) || !(Vef <= 1.55e+139)) {
tmp = (NdChar / (1.0 + exp((Vef / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
} else {
tmp = (NdChar / (exp((((mu + EDonor) - Ec) / KbT)) + 1.0)) + (NaChar / (exp((((EAccept + Ev) - 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 ((vef <= (-5.2d+121)) .or. (.not. (vef <= 1.55d+139))) then
tmp = (ndchar / (1.0d0 + exp((vef / kbt)))) + (nachar / (1.0d0 + exp(((((ev + vef) + eaccept) - mu) / kbt))))
else
tmp = (ndchar / (exp((((mu + edonor) - ec) / kbt)) + 1.0d0)) + (nachar / (exp((((eaccept + ev) - 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 ((Vef <= -5.2e+121) || !(Vef <= 1.55e+139)) {
tmp = (NdChar / (1.0 + Math.exp((Vef / KbT)))) + (NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
} else {
tmp = (NdChar / (Math.exp((((mu + EDonor) - Ec) / KbT)) + 1.0)) + (NaChar / (Math.exp((((EAccept + Ev) - mu) / KbT)) + 1.0));
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if (Vef <= -5.2e+121) or not (Vef <= 1.55e+139): tmp = (NdChar / (1.0 + math.exp((Vef / KbT)))) + (NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) else: tmp = (NdChar / (math.exp((((mu + EDonor) - Ec) / KbT)) + 1.0)) + (NaChar / (math.exp((((EAccept + Ev) - mu) / KbT)) + 1.0)) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if ((Vef <= -5.2e+121) || !(Vef <= 1.55e+139)) tmp = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Vef / KbT)))) + Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT))))); else tmp = Float64(Float64(NdChar / Float64(exp(Float64(Float64(Float64(mu + EDonor) - Ec) / KbT)) + 1.0)) + Float64(NaChar / Float64(exp(Float64(Float64(Float64(EAccept + Ev) - 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 ((Vef <= -5.2e+121) || ~((Vef <= 1.55e+139))) tmp = (NdChar / (1.0 + exp((Vef / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)))); else tmp = (NdChar / (exp((((mu + EDonor) - Ec) / KbT)) + 1.0)) + (NaChar / (exp((((EAccept + Ev) - mu) / KbT)) + 1.0)); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[Or[LessEqual[Vef, -5.2e+121], N[Not[LessEqual[Vef, 1.55e+139]], $MachinePrecision]], N[(N[(NdChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(NdChar / N[(N[Exp[N[(N[(N[(mu + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(N[Exp[N[(N[(N[(EAccept + Ev), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;Vef \leq -5.2 \cdot 10^{+121} \lor \neg \left(Vef \leq 1.55 \cdot 10^{+139}\right):\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{Vef}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{\left(mu + EDonor\right) - Ec}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}} + 1}\\
\end{array}
\end{array}
if Vef < -5.1999999999999998e121 or 1.55e139 < Vef Initial program 99.9%
Taylor expanded in Vef around inf
lower-/.f6492.1
Applied rewrites92.1%
if -5.1999999999999998e121 < Vef < 1.55e139Initial program 100.0%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites95.3%
Final simplification94.4%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (+ 1.0 (exp (/ (- (+ EDonor mu) Ec) KbT)))))
(t_1 (/ NaChar (+ (exp (/ (- (+ Vef Ev) mu) KbT)) 1.0))))
(if (<= NaChar -2.2e+117)
t_1
(if (<= NaChar -1.75e-6)
t_0
(if (<= NaChar -1.8e-212)
(/ NaChar (+ (exp (/ (+ (+ Vef Ev) EAccept) KbT)) 1.0))
(if (<= NaChar 1.16e+21)
t_0
(if (<= NaChar 3.3e+90)
t_1
(if (<= NaChar 8.2e+172)
t_0
(/ NaChar (+ (exp (/ (- (+ EAccept Ev) 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 = NdChar / (1.0 + exp((((EDonor + mu) - Ec) / KbT)));
double t_1 = NaChar / (exp((((Vef + Ev) - mu) / KbT)) + 1.0);
double tmp;
if (NaChar <= -2.2e+117) {
tmp = t_1;
} else if (NaChar <= -1.75e-6) {
tmp = t_0;
} else if (NaChar <= -1.8e-212) {
tmp = NaChar / (exp((((Vef + Ev) + EAccept) / KbT)) + 1.0);
} else if (NaChar <= 1.16e+21) {
tmp = t_0;
} else if (NaChar <= 3.3e+90) {
tmp = t_1;
} else if (NaChar <= 8.2e+172) {
tmp = t_0;
} else {
tmp = NaChar / (exp((((EAccept + Ev) - 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) :: t_1
real(8) :: tmp
t_0 = ndchar / (1.0d0 + exp((((edonor + mu) - ec) / kbt)))
t_1 = nachar / (exp((((vef + ev) - mu) / kbt)) + 1.0d0)
if (nachar <= (-2.2d+117)) then
tmp = t_1
else if (nachar <= (-1.75d-6)) then
tmp = t_0
else if (nachar <= (-1.8d-212)) then
tmp = nachar / (exp((((vef + ev) + eaccept) / kbt)) + 1.0d0)
else if (nachar <= 1.16d+21) then
tmp = t_0
else if (nachar <= 3.3d+90) then
tmp = t_1
else if (nachar <= 8.2d+172) then
tmp = t_0
else
tmp = nachar / (exp((((eaccept + ev) - 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 = NdChar / (1.0 + Math.exp((((EDonor + mu) - Ec) / KbT)));
double t_1 = NaChar / (Math.exp((((Vef + Ev) - mu) / KbT)) + 1.0);
double tmp;
if (NaChar <= -2.2e+117) {
tmp = t_1;
} else if (NaChar <= -1.75e-6) {
tmp = t_0;
} else if (NaChar <= -1.8e-212) {
tmp = NaChar / (Math.exp((((Vef + Ev) + EAccept) / KbT)) + 1.0);
} else if (NaChar <= 1.16e+21) {
tmp = t_0;
} else if (NaChar <= 3.3e+90) {
tmp = t_1;
} else if (NaChar <= 8.2e+172) {
tmp = t_0;
} else {
tmp = NaChar / (Math.exp((((EAccept + Ev) - mu) / KbT)) + 1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NdChar / (1.0 + math.exp((((EDonor + mu) - Ec) / KbT))) t_1 = NaChar / (math.exp((((Vef + Ev) - mu) / KbT)) + 1.0) tmp = 0 if NaChar <= -2.2e+117: tmp = t_1 elif NaChar <= -1.75e-6: tmp = t_0 elif NaChar <= -1.8e-212: tmp = NaChar / (math.exp((((Vef + Ev) + EAccept) / KbT)) + 1.0) elif NaChar <= 1.16e+21: tmp = t_0 elif NaChar <= 3.3e+90: tmp = t_1 elif NaChar <= 8.2e+172: tmp = t_0 else: tmp = NaChar / (math.exp((((EAccept + Ev) - mu) / KbT)) + 1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Float64(EDonor + mu) - Ec) / KbT)))) t_1 = Float64(NaChar / Float64(exp(Float64(Float64(Float64(Vef + Ev) - mu) / KbT)) + 1.0)) tmp = 0.0 if (NaChar <= -2.2e+117) tmp = t_1; elseif (NaChar <= -1.75e-6) tmp = t_0; elseif (NaChar <= -1.8e-212) tmp = Float64(NaChar / Float64(exp(Float64(Float64(Float64(Vef + Ev) + EAccept) / KbT)) + 1.0)); elseif (NaChar <= 1.16e+21) tmp = t_0; elseif (NaChar <= 3.3e+90) tmp = t_1; elseif (NaChar <= 8.2e+172) tmp = t_0; else tmp = Float64(NaChar / Float64(exp(Float64(Float64(Float64(EAccept + Ev) - mu) / KbT)) + 1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NdChar / (1.0 + exp((((EDonor + mu) - Ec) / KbT))); t_1 = NaChar / (exp((((Vef + Ev) - mu) / KbT)) + 1.0); tmp = 0.0; if (NaChar <= -2.2e+117) tmp = t_1; elseif (NaChar <= -1.75e-6) tmp = t_0; elseif (NaChar <= -1.8e-212) tmp = NaChar / (exp((((Vef + Ev) + EAccept) / KbT)) + 1.0); elseif (NaChar <= 1.16e+21) tmp = t_0; elseif (NaChar <= 3.3e+90) tmp = t_1; elseif (NaChar <= 8.2e+172) tmp = t_0; else tmp = NaChar / (exp((((EAccept + Ev) - mu) / KbT)) + 1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(1.0 + N[Exp[N[(N[(N[(EDonor + mu), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(NaChar / N[(N[Exp[N[(N[(N[(Vef + Ev), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NaChar, -2.2e+117], t$95$1, If[LessEqual[NaChar, -1.75e-6], t$95$0, If[LessEqual[NaChar, -1.8e-212], N[(NaChar / N[(N[Exp[N[(N[(N[(Vef + Ev), $MachinePrecision] + EAccept), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[NaChar, 1.16e+21], t$95$0, If[LessEqual[NaChar, 3.3e+90], t$95$1, If[LessEqual[NaChar, 8.2e+172], t$95$0, N[(NaChar / N[(N[Exp[N[(N[(N[(EAccept + Ev), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{\left(EDonor + mu\right) - Ec}{KbT}}}\\
t_1 := \frac{NaChar}{e^{\frac{\left(Vef + Ev\right) - mu}{KbT}} + 1}\\
\mathbf{if}\;NaChar \leq -2.2 \cdot 10^{+117}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;NaChar \leq -1.75 \cdot 10^{-6}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;NaChar \leq -1.8 \cdot 10^{-212}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{\left(Vef + Ev\right) + EAccept}{KbT}} + 1}\\
\mathbf{elif}\;NaChar \leq 1.16 \cdot 10^{+21}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;NaChar \leq 3.3 \cdot 10^{+90}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;NaChar \leq 8.2 \cdot 10^{+172}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}} + 1}\\
\end{array}
\end{array}
if NaChar < -2.20000000000000014e117 or 1.16e21 < NaChar < 3.30000000000000008e90Initial program 99.9%
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-+.f6478.4
Applied rewrites78.4%
Taylor expanded in EAccept around 0
Applied rewrites73.5%
if -2.20000000000000014e117 < NaChar < -1.74999999999999997e-6 or -1.8e-212 < NaChar < 1.16e21 or 3.30000000000000008e90 < NaChar < 8.200000000000001e172Initial program 100.0%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites84.2%
Taylor expanded in mu around 0
Applied rewrites69.0%
Taylor expanded in NdChar around inf
Applied rewrites75.3%
if -1.74999999999999997e-6 < NaChar < -1.8e-212Initial 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-+.f6471.9
Applied rewrites71.9%
Taylor expanded in mu around 0
Applied rewrites69.7%
if 8.200000000000001e172 < NaChar Initial program 99.9%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites95.4%
Taylor expanded in NdChar around 0
Applied rewrites79.1%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NaChar (+ (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)) 1.0)))
(t_1 (/ NdChar (+ (exp (/ (- (+ (+ mu Vef) EDonor) Ec) KbT)) 1.0))))
(if (<= NaChar -2.7e-75)
t_0
(if (<= NaChar 1.16e+21)
t_1
(if (<= NaChar 4.6e+89)
(/ NaChar (+ (exp (/ (- (+ Vef Ev) mu) KbT)) 1.0))
(if (<= NaChar 2.65e+172) t_1 t_0))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) + 1.0);
double t_1 = NdChar / (exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0);
double tmp;
if (NaChar <= -2.7e-75) {
tmp = t_0;
} else if (NaChar <= 1.16e+21) {
tmp = t_1;
} else if (NaChar <= 4.6e+89) {
tmp = NaChar / (exp((((Vef + Ev) - mu) / KbT)) + 1.0);
} else if (NaChar <= 2.65e+172) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = nachar / (exp(((((ev + vef) + eaccept) - mu) / kbt)) + 1.0d0)
t_1 = ndchar / (exp(((((mu + vef) + edonor) - ec) / kbt)) + 1.0d0)
if (nachar <= (-2.7d-75)) then
tmp = t_0
else if (nachar <= 1.16d+21) then
tmp = t_1
else if (nachar <= 4.6d+89) then
tmp = nachar / (exp((((vef + ev) - mu) / kbt)) + 1.0d0)
else if (nachar <= 2.65d+172) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) + 1.0);
double t_1 = NdChar / (Math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0);
double tmp;
if (NaChar <= -2.7e-75) {
tmp = t_0;
} else if (NaChar <= 1.16e+21) {
tmp = t_1;
} else if (NaChar <= 4.6e+89) {
tmp = NaChar / (Math.exp((((Vef + Ev) - mu) / KbT)) + 1.0);
} else if (NaChar <= 2.65e+172) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NaChar / (math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) + 1.0) t_1 = NdChar / (math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0) tmp = 0 if NaChar <= -2.7e-75: tmp = t_0 elif NaChar <= 1.16e+21: tmp = t_1 elif NaChar <= 4.6e+89: tmp = NaChar / (math.exp((((Vef + Ev) - mu) / KbT)) + 1.0) elif NaChar <= 2.65e+172: tmp = t_1 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(Float64(Ev + Vef) + EAccept) - mu) / KbT)) + 1.0)) t_1 = Float64(NdChar / Float64(exp(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT)) + 1.0)) tmp = 0.0 if (NaChar <= -2.7e-75) tmp = t_0; elseif (NaChar <= 1.16e+21) tmp = t_1; elseif (NaChar <= 4.6e+89) tmp = Float64(NaChar / Float64(exp(Float64(Float64(Float64(Vef + Ev) - mu) / KbT)) + 1.0)); elseif (NaChar <= 2.65e+172) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) + 1.0); t_1 = NdChar / (exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0); tmp = 0.0; if (NaChar <= -2.7e-75) tmp = t_0; elseif (NaChar <= 1.16e+21) tmp = t_1; elseif (NaChar <= 4.6e+89) tmp = NaChar / (exp((((Vef + Ev) - mu) / KbT)) + 1.0); elseif (NaChar <= 2.65e+172) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NaChar / N[(N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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[NaChar, -2.7e-75], t$95$0, If[LessEqual[NaChar, 1.16e+21], t$95$1, If[LessEqual[NaChar, 4.6e+89], N[(NaChar / N[(N[Exp[N[(N[(N[(Vef + Ev), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[NaChar, 2.65e+172], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} + 1}\\
t_1 := \frac{NdChar}{e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}} + 1}\\
\mathbf{if}\;NaChar \leq -2.7 \cdot 10^{-75}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;NaChar \leq 1.16 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;NaChar \leq 4.6 \cdot 10^{+89}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{\left(Vef + Ev\right) - mu}{KbT}} + 1}\\
\mathbf{elif}\;NaChar \leq 2.65 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if NaChar < -2.6999999999999998e-75 or 2.65e172 < 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-+.f6473.2
Applied rewrites73.2%
if -2.6999999999999998e-75 < NaChar < 1.16e21 or 4.5999999999999998e89 < NaChar < 2.65e172Initial program 100.0%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites84.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-+.f6480.3
Applied rewrites80.3%
if 1.16e21 < NaChar < 4.5999999999999998e89Initial program 99.9%
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-+.f6483.7
Applied rewrites83.7%
Taylor expanded in EAccept around 0
Applied rewrites79.7%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NaChar (+ (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)) 1.0)))
(t_1 (/ NdChar (+ 1.0 (exp (/ (- (+ EDonor mu) Ec) KbT))))))
(if (<= NaChar -1.8e-212)
t_0
(if (<= NaChar 1.16e+21)
t_1
(if (<= NaChar 3.3e+90)
(/ NaChar (+ (exp (/ (- (+ Vef Ev) mu) KbT)) 1.0))
(if (<= NaChar 2.2e+172) t_1 t_0))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) + 1.0);
double t_1 = NdChar / (1.0 + exp((((EDonor + mu) - Ec) / KbT)));
double tmp;
if (NaChar <= -1.8e-212) {
tmp = t_0;
} else if (NaChar <= 1.16e+21) {
tmp = t_1;
} else if (NaChar <= 3.3e+90) {
tmp = NaChar / (exp((((Vef + Ev) - mu) / KbT)) + 1.0);
} else if (NaChar <= 2.2e+172) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = nachar / (exp(((((ev + vef) + eaccept) - mu) / kbt)) + 1.0d0)
t_1 = ndchar / (1.0d0 + exp((((edonor + mu) - ec) / kbt)))
if (nachar <= (-1.8d-212)) then
tmp = t_0
else if (nachar <= 1.16d+21) then
tmp = t_1
else if (nachar <= 3.3d+90) then
tmp = nachar / (exp((((vef + ev) - mu) / kbt)) + 1.0d0)
else if (nachar <= 2.2d+172) then
tmp = t_1
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) + 1.0);
double t_1 = NdChar / (1.0 + Math.exp((((EDonor + mu) - Ec) / KbT)));
double tmp;
if (NaChar <= -1.8e-212) {
tmp = t_0;
} else if (NaChar <= 1.16e+21) {
tmp = t_1;
} else if (NaChar <= 3.3e+90) {
tmp = NaChar / (Math.exp((((Vef + Ev) - mu) / KbT)) + 1.0);
} else if (NaChar <= 2.2e+172) {
tmp = t_1;
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NaChar / (math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) + 1.0) t_1 = NdChar / (1.0 + math.exp((((EDonor + mu) - Ec) / KbT))) tmp = 0 if NaChar <= -1.8e-212: tmp = t_0 elif NaChar <= 1.16e+21: tmp = t_1 elif NaChar <= 3.3e+90: tmp = NaChar / (math.exp((((Vef + Ev) - mu) / KbT)) + 1.0) elif NaChar <= 2.2e+172: tmp = t_1 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(Float64(Ev + Vef) + EAccept) - mu) / KbT)) + 1.0)) t_1 = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Float64(EDonor + mu) - Ec) / KbT)))) tmp = 0.0 if (NaChar <= -1.8e-212) tmp = t_0; elseif (NaChar <= 1.16e+21) tmp = t_1; elseif (NaChar <= 3.3e+90) tmp = Float64(NaChar / Float64(exp(Float64(Float64(Float64(Vef + Ev) - mu) / KbT)) + 1.0)); elseif (NaChar <= 2.2e+172) tmp = t_1; else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) + 1.0); t_1 = NdChar / (1.0 + exp((((EDonor + mu) - Ec) / KbT))); tmp = 0.0; if (NaChar <= -1.8e-212) tmp = t_0; elseif (NaChar <= 1.16e+21) tmp = t_1; elseif (NaChar <= 3.3e+90) tmp = NaChar / (exp((((Vef + Ev) - mu) / KbT)) + 1.0); elseif (NaChar <= 2.2e+172) tmp = t_1; else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NaChar / N[(N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(NdChar / N[(1.0 + N[Exp[N[(N[(N[(EDonor + mu), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NaChar, -1.8e-212], t$95$0, If[LessEqual[NaChar, 1.16e+21], t$95$1, If[LessEqual[NaChar, 3.3e+90], N[(NaChar / N[(N[Exp[N[(N[(N[(Vef + Ev), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[NaChar, 2.2e+172], t$95$1, t$95$0]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} + 1}\\
t_1 := \frac{NdChar}{1 + e^{\frac{\left(EDonor + mu\right) - Ec}{KbT}}}\\
\mathbf{if}\;NaChar \leq -1.8 \cdot 10^{-212}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;NaChar \leq 1.16 \cdot 10^{+21}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;NaChar \leq 3.3 \cdot 10^{+90}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{\left(Vef + Ev\right) - mu}{KbT}} + 1}\\
\mathbf{elif}\;NaChar \leq 2.2 \cdot 10^{+172}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if NaChar < -1.8e-212 or 2.2000000000000001e172 < 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-+.f6469.7
Applied rewrites69.7%
if -1.8e-212 < NaChar < 1.16e21 or 3.30000000000000008e90 < NaChar < 2.2000000000000001e172Initial program 100.0%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites84.7%
Taylor expanded in mu around 0
Applied rewrites68.6%
Taylor expanded in NdChar around inf
Applied rewrites77.3%
if 1.16e21 < NaChar < 3.30000000000000008e90Initial program 99.9%
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-+.f6483.7
Applied rewrites83.7%
Taylor expanded in EAccept around 0
Applied rewrites79.7%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(if (or (<= NaChar -3.1e-171)
(not
(or (<= NaChar 3.7e+29)
(not (or (<= NaChar 1.6e+91) (not (<= NaChar 8.2e+172)))))))
(/ NaChar (+ (exp (/ (- (+ EAccept Ev) mu) KbT)) 1.0))
(/ NdChar (+ 1.0 (exp (/ (- (+ EDonor mu) Ec) KbT))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if ((NaChar <= -3.1e-171) || !((NaChar <= 3.7e+29) || !((NaChar <= 1.6e+91) || !(NaChar <= 8.2e+172)))) {
tmp = NaChar / (exp((((EAccept + Ev) - mu) / KbT)) + 1.0);
} else {
tmp = NdChar / (1.0 + exp((((EDonor + mu) - Ec) / KbT)));
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: tmp
if ((nachar <= (-3.1d-171)) .or. (.not. (nachar <= 3.7d+29) .or. (.not. (nachar <= 1.6d+91) .or. (.not. (nachar <= 8.2d+172))))) then
tmp = nachar / (exp((((eaccept + ev) - mu) / kbt)) + 1.0d0)
else
tmp = ndchar / (1.0d0 + exp((((edonor + mu) - ec) / kbt)))
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if ((NaChar <= -3.1e-171) || !((NaChar <= 3.7e+29) || !((NaChar <= 1.6e+91) || !(NaChar <= 8.2e+172)))) {
tmp = NaChar / (Math.exp((((EAccept + Ev) - mu) / KbT)) + 1.0);
} else {
tmp = NdChar / (1.0 + Math.exp((((EDonor + mu) - Ec) / KbT)));
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if (NaChar <= -3.1e-171) or not ((NaChar <= 3.7e+29) or not ((NaChar <= 1.6e+91) or not (NaChar <= 8.2e+172))): tmp = NaChar / (math.exp((((EAccept + Ev) - mu) / KbT)) + 1.0) else: tmp = NdChar / (1.0 + math.exp((((EDonor + mu) - Ec) / KbT))) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if ((NaChar <= -3.1e-171) || !((NaChar <= 3.7e+29) || !((NaChar <= 1.6e+91) || !(NaChar <= 8.2e+172)))) tmp = Float64(NaChar / Float64(exp(Float64(Float64(Float64(EAccept + Ev) - mu) / KbT)) + 1.0)); else tmp = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Float64(EDonor + mu) - Ec) / KbT)))); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if ((NaChar <= -3.1e-171) || ~(((NaChar <= 3.7e+29) || ~(((NaChar <= 1.6e+91) || ~((NaChar <= 8.2e+172))))))) tmp = NaChar / (exp((((EAccept + Ev) - mu) / KbT)) + 1.0); else tmp = NdChar / (1.0 + exp((((EDonor + mu) - Ec) / KbT))); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[Or[LessEqual[NaChar, -3.1e-171], N[Not[Or[LessEqual[NaChar, 3.7e+29], N[Not[Or[LessEqual[NaChar, 1.6e+91], N[Not[LessEqual[NaChar, 8.2e+172]], $MachinePrecision]]], $MachinePrecision]]], $MachinePrecision]], 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[(EDonor + mu), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;NaChar \leq -3.1 \cdot 10^{-171} \lor \neg \left(NaChar \leq 3.7 \cdot 10^{+29} \lor \neg \left(NaChar \leq 1.6 \cdot 10^{+91} \lor \neg \left(NaChar \leq 8.2 \cdot 10^{+172}\right)\right)\right):\\
\;\;\;\;\frac{NaChar}{e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}} + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(EDonor + mu\right) - Ec}{KbT}}}\\
\end{array}
\end{array}
if NaChar < -3.1e-171 or 3.69999999999999974e29 < NaChar < 1.59999999999999995e91 or 8.200000000000001e172 < NaChar Initial program 99.9%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites85.1%
Taylor expanded in NdChar around 0
Applied rewrites63.1%
if -3.1e-171 < NaChar < 3.69999999999999974e29 or 1.59999999999999995e91 < NaChar < 8.200000000000001e172Initial program 100.0%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites83.7%
Taylor expanded in mu around 0
Applied rewrites68.5%
Taylor expanded in NdChar around inf
Applied rewrites74.6%
Final simplification68.3%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (+ 1.0 (exp (/ (- (+ EDonor mu) Ec) KbT)))))
(t_1 (/ NaChar (+ (exp (/ (+ (+ Vef Ev) EAccept) KbT)) 1.0))))
(if (<= NaChar -1.8e-212)
t_1
(if (<= NaChar 1.16e+21)
t_0
(if (<= NaChar 1.65e+91)
t_1
(if (<= NaChar 8.2e+172)
t_0
(/ NaChar (+ (exp (/ (- (+ EAccept Ev) 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 = NdChar / (1.0 + exp((((EDonor + mu) - Ec) / KbT)));
double t_1 = NaChar / (exp((((Vef + Ev) + EAccept) / KbT)) + 1.0);
double tmp;
if (NaChar <= -1.8e-212) {
tmp = t_1;
} else if (NaChar <= 1.16e+21) {
tmp = t_0;
} else if (NaChar <= 1.65e+91) {
tmp = t_1;
} else if (NaChar <= 8.2e+172) {
tmp = t_0;
} else {
tmp = NaChar / (exp((((EAccept + Ev) - 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) :: t_1
real(8) :: tmp
t_0 = ndchar / (1.0d0 + exp((((edonor + mu) - ec) / kbt)))
t_1 = nachar / (exp((((vef + ev) + eaccept) / kbt)) + 1.0d0)
if (nachar <= (-1.8d-212)) then
tmp = t_1
else if (nachar <= 1.16d+21) then
tmp = t_0
else if (nachar <= 1.65d+91) then
tmp = t_1
else if (nachar <= 8.2d+172) then
tmp = t_0
else
tmp = nachar / (exp((((eaccept + ev) - 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 = NdChar / (1.0 + Math.exp((((EDonor + mu) - Ec) / KbT)));
double t_1 = NaChar / (Math.exp((((Vef + Ev) + EAccept) / KbT)) + 1.0);
double tmp;
if (NaChar <= -1.8e-212) {
tmp = t_1;
} else if (NaChar <= 1.16e+21) {
tmp = t_0;
} else if (NaChar <= 1.65e+91) {
tmp = t_1;
} else if (NaChar <= 8.2e+172) {
tmp = t_0;
} else {
tmp = NaChar / (Math.exp((((EAccept + Ev) - mu) / KbT)) + 1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NdChar / (1.0 + math.exp((((EDonor + mu) - Ec) / KbT))) t_1 = NaChar / (math.exp((((Vef + Ev) + EAccept) / KbT)) + 1.0) tmp = 0 if NaChar <= -1.8e-212: tmp = t_1 elif NaChar <= 1.16e+21: tmp = t_0 elif NaChar <= 1.65e+91: tmp = t_1 elif NaChar <= 8.2e+172: tmp = t_0 else: tmp = NaChar / (math.exp((((EAccept + Ev) - mu) / KbT)) + 1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Float64(EDonor + mu) - Ec) / KbT)))) t_1 = Float64(NaChar / Float64(exp(Float64(Float64(Float64(Vef + Ev) + EAccept) / KbT)) + 1.0)) tmp = 0.0 if (NaChar <= -1.8e-212) tmp = t_1; elseif (NaChar <= 1.16e+21) tmp = t_0; elseif (NaChar <= 1.65e+91) tmp = t_1; elseif (NaChar <= 8.2e+172) tmp = t_0; else tmp = Float64(NaChar / Float64(exp(Float64(Float64(Float64(EAccept + Ev) - mu) / KbT)) + 1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NdChar / (1.0 + exp((((EDonor + mu) - Ec) / KbT))); t_1 = NaChar / (exp((((Vef + Ev) + EAccept) / KbT)) + 1.0); tmp = 0.0; if (NaChar <= -1.8e-212) tmp = t_1; elseif (NaChar <= 1.16e+21) tmp = t_0; elseif (NaChar <= 1.65e+91) tmp = t_1; elseif (NaChar <= 8.2e+172) tmp = t_0; else tmp = NaChar / (exp((((EAccept + Ev) - mu) / KbT)) + 1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(1.0 + N[Exp[N[(N[(N[(EDonor + mu), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(NaChar / N[(N[Exp[N[(N[(N[(Vef + Ev), $MachinePrecision] + EAccept), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NaChar, -1.8e-212], t$95$1, If[LessEqual[NaChar, 1.16e+21], t$95$0, If[LessEqual[NaChar, 1.65e+91], t$95$1, If[LessEqual[NaChar, 8.2e+172], t$95$0, N[(NaChar / N[(N[Exp[N[(N[(N[(EAccept + Ev), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{\left(EDonor + mu\right) - Ec}{KbT}}}\\
t_1 := \frac{NaChar}{e^{\frac{\left(Vef + Ev\right) + EAccept}{KbT}} + 1}\\
\mathbf{if}\;NaChar \leq -1.8 \cdot 10^{-212}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;NaChar \leq 1.16 \cdot 10^{+21}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;NaChar \leq 1.65 \cdot 10^{+91}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;NaChar \leq 8.2 \cdot 10^{+172}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}} + 1}\\
\end{array}
\end{array}
if NaChar < -1.8e-212 or 1.16e21 < NaChar < 1.65000000000000009e91Initial program 99.9%
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-+.f6470.0
Applied rewrites70.0%
Taylor expanded in mu around 0
Applied rewrites65.6%
if -1.8e-212 < NaChar < 1.16e21 or 1.65000000000000009e91 < NaChar < 8.200000000000001e172Initial program 100.0%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites84.7%
Taylor expanded in mu around 0
Applied rewrites68.6%
Taylor expanded in NdChar around inf
Applied rewrites77.3%
if 8.200000000000001e172 < NaChar Initial program 99.9%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites95.4%
Taylor expanded in NdChar around 0
Applied rewrites79.1%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(if (<= KbT -9.2e+167)
(fma
NdChar
0.5
(fma
0.5
NaChar
(*
(fma
(/ (- (+ (+ Ev Vef) EAccept) mu) KbT)
NaChar
(* (/ (- (+ (+ mu Vef) EDonor) Ec) KbT) NdChar))
-0.25)))
(if (<= KbT 1.9e+201)
(/ NaChar (+ (exp (/ (- (+ EAccept Ev) mu) KbT)) 1.0))
(fma
(+ NaChar NdChar)
0.5
(* (* (- (/ NdChar KbT) (/ NaChar KbT)) mu) -0.25)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (KbT <= -9.2e+167) {
tmp = fma(NdChar, 0.5, fma(0.5, NaChar, (fma(((((Ev + Vef) + EAccept) - mu) / KbT), NaChar, (((((mu + Vef) + EDonor) - Ec) / KbT) * NdChar)) * -0.25)));
} else if (KbT <= 1.9e+201) {
tmp = NaChar / (exp((((EAccept + Ev) - mu) / KbT)) + 1.0);
} else {
tmp = fma((NaChar + NdChar), 0.5, ((((NdChar / KbT) - (NaChar / KbT)) * mu) * -0.25));
}
return tmp;
}
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (KbT <= -9.2e+167) tmp = fma(NdChar, 0.5, fma(0.5, NaChar, Float64(fma(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT), NaChar, Float64(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT) * NdChar)) * -0.25))); elseif (KbT <= 1.9e+201) tmp = Float64(NaChar / Float64(exp(Float64(Float64(Float64(EAccept + Ev) - mu) / KbT)) + 1.0)); else tmp = fma(Float64(NaChar + NdChar), 0.5, Float64(Float64(Float64(Float64(NdChar / KbT) - Float64(NaChar / KbT)) * mu) * -0.25)); end return tmp end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[KbT, -9.2e+167], N[(NdChar * 0.5 + N[(0.5 * NaChar + N[(N[(N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision] * NaChar + N[(N[(N[(N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision] * NdChar), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 1.9e+201], N[(NaChar / N[(N[Exp[N[(N[(N[(EAccept + Ev), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5 + N[(N[(N[(N[(NdChar / KbT), $MachinePrecision] - N[(NaChar / KbT), $MachinePrecision]), $MachinePrecision] * mu), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;KbT \leq -9.2 \cdot 10^{+167}:\\
\;\;\;\;\mathsf{fma}\left(NdChar, 0.5, \mathsf{fma}\left(0.5, NaChar, \mathsf{fma}\left(\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}, NaChar, \frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT} \cdot NdChar\right) \cdot -0.25\right)\right)\\
\mathbf{elif}\;KbT \leq 1.9 \cdot 10^{+201}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}} + 1}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(NaChar + NdChar, 0.5, \left(\left(\frac{NdChar}{KbT} - \frac{NaChar}{KbT}\right) \cdot mu\right) \cdot -0.25\right)\\
\end{array}
\end{array}
if KbT < -9.19999999999999952e167Initial program 99.9%
Taylor expanded in KbT around -inf
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
Applied rewrites69.1%
Applied rewrites69.1%
if -9.19999999999999952e167 < KbT < 1.89999999999999998e201Initial program 100.0%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites83.3%
Taylor expanded in NdChar around 0
Applied rewrites51.8%
if 1.89999999999999998e201 < KbT Initial program 100.0%
Taylor expanded in KbT around -inf
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
Applied rewrites79.0%
Taylor expanded in mu around inf
Applied rewrites80.4%
Applied rewrites80.4%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(if (<= KbT -8.4e+167)
(fma
NdChar
0.5
(fma
0.5
NaChar
(*
(fma
(/ (- (+ (+ Ev Vef) EAccept) mu) KbT)
NaChar
(* (/ (- (+ (+ mu Vef) EDonor) Ec) KbT) NdChar))
-0.25)))
(if (<= KbT 1.6e+178)
(/ NaChar (+ 1.0 (exp (/ (+ EAccept Ev) KbT))))
(fma -0.25 (* mu (/ (- NdChar NaChar) KbT)) (* 0.5 (+ NdChar NaChar))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (KbT <= -8.4e+167) {
tmp = fma(NdChar, 0.5, fma(0.5, NaChar, (fma(((((Ev + Vef) + EAccept) - mu) / KbT), NaChar, (((((mu + Vef) + EDonor) - Ec) / KbT) * NdChar)) * -0.25)));
} else if (KbT <= 1.6e+178) {
tmp = NaChar / (1.0 + exp(((EAccept + Ev) / KbT)));
} else {
tmp = fma(-0.25, (mu * ((NdChar - NaChar) / KbT)), (0.5 * (NdChar + NaChar)));
}
return tmp;
}
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (KbT <= -8.4e+167) tmp = fma(NdChar, 0.5, fma(0.5, NaChar, Float64(fma(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT), NaChar, Float64(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT) * NdChar)) * -0.25))); elseif (KbT <= 1.6e+178) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(Float64(EAccept + Ev) / KbT)))); else tmp = fma(-0.25, Float64(mu * Float64(Float64(NdChar - NaChar) / KbT)), Float64(0.5 * Float64(NdChar + NaChar))); end return tmp end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[KbT, -8.4e+167], N[(NdChar * 0.5 + N[(0.5 * NaChar + N[(N[(N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision] * NaChar + N[(N[(N[(N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision] * NdChar), $MachinePrecision]), $MachinePrecision] * -0.25), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 1.6e+178], N[(NaChar / N[(1.0 + N[Exp[N[(N[(EAccept + Ev), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-0.25 * N[(mu * N[(N[(NdChar - NaChar), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision] + N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;KbT \leq -8.4 \cdot 10^{+167}:\\
\;\;\;\;\mathsf{fma}\left(NdChar, 0.5, \mathsf{fma}\left(0.5, NaChar, \mathsf{fma}\left(\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}, NaChar, \frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT} \cdot NdChar\right) \cdot -0.25\right)\right)\\
\mathbf{elif}\;KbT \leq 1.6 \cdot 10^{+178}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept + Ev}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, mu \cdot \frac{NdChar - NaChar}{KbT}, 0.5 \cdot \left(NdChar + NaChar\right)\right)\\
\end{array}
\end{array}
if KbT < -8.3999999999999997e167Initial program 99.9%
Taylor expanded in KbT around -inf
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
Applied rewrites69.1%
Applied rewrites69.1%
if -8.3999999999999997e167 < KbT < 1.6e178Initial program 100.0%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites83.1%
Taylor expanded in mu around 0
Applied rewrites65.6%
Taylor expanded in NdChar around 0
Applied rewrites43.0%
if 1.6e178 < KbT Initial program 99.9%
Taylor expanded in KbT around -inf
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
Applied rewrites72.3%
Taylor expanded in mu around inf
Applied rewrites73.1%
Taylor expanded in KbT around 0
Applied rewrites73.1%
Final simplification49.2%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (if (or (<= NaChar -2.6e+109) (not (<= NaChar 1.35e+171))) (* 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 ((NaChar <= -2.6e+109) || !(NaChar <= 1.35e+171)) {
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 ((nachar <= (-2.6d+109)) .or. (.not. (nachar <= 1.35d+171))) 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 ((NaChar <= -2.6e+109) || !(NaChar <= 1.35e+171)) {
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 (NaChar <= -2.6e+109) or not (NaChar <= 1.35e+171): 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 ((NaChar <= -2.6e+109) || !(NaChar <= 1.35e+171)) 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 ((NaChar <= -2.6e+109) || ~((NaChar <= 1.35e+171))) 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[Or[LessEqual[NaChar, -2.6e+109], N[Not[LessEqual[NaChar, 1.35e+171]], $MachinePrecision]], N[(0.5 * NaChar), $MachinePrecision], N[(0.5 * NdChar), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;NaChar \leq -2.6 \cdot 10^{+109} \lor \neg \left(NaChar \leq 1.35 \cdot 10^{+171}\right):\\
\;\;\;\;0.5 \cdot NaChar\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot NdChar\\
\end{array}
\end{array}
if NaChar < -2.5999999999999998e109 or 1.3499999999999999e171 < NaChar Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6431.2
Applied rewrites31.2%
Taylor expanded in NdChar around 0
Applied rewrites27.5%
if -2.5999999999999998e109 < NaChar < 1.3499999999999999e171Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6427.0
Applied rewrites27.0%
Taylor expanded in NdChar around inf
Applied rewrites24.5%
Final simplification25.2%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (if (<= Ev -7.8e+209) (* 0.5 NdChar) (* 0.5 (+ NdChar NaChar))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (Ev <= -7.8e+209) {
tmp = 0.5 * NdChar;
} else {
tmp = 0.5 * (NdChar + NaChar);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: tmp
if (ev <= (-7.8d+209)) then
tmp = 0.5d0 * ndchar
else
tmp = 0.5d0 * (ndchar + nachar)
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (Ev <= -7.8e+209) {
tmp = 0.5 * NdChar;
} else {
tmp = 0.5 * (NdChar + NaChar);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if Ev <= -7.8e+209: tmp = 0.5 * NdChar else: tmp = 0.5 * (NdChar + NaChar) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (Ev <= -7.8e+209) tmp = Float64(0.5 * NdChar); else tmp = Float64(0.5 * Float64(NdChar + NaChar)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if (Ev <= -7.8e+209) tmp = 0.5 * NdChar; else tmp = 0.5 * (NdChar + NaChar); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[Ev, -7.8e+209], N[(0.5 * NdChar), $MachinePrecision], N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;Ev \leq -7.8 \cdot 10^{+209}:\\
\;\;\;\;0.5 \cdot NdChar\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\
\end{array}
\end{array}
if Ev < -7.7999999999999994e209Initial program 99.8%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6418.5
Applied rewrites18.5%
Taylor expanded in NdChar around inf
Applied rewrites24.6%
if -7.7999999999999994e209 < Ev Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6428.9
Applied rewrites28.9%
(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-+.f6428.1
Applied rewrites28.1%
Taylor expanded in NdChar around 0
Applied rewrites16.0%
herbie shell --seed 2024321
(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))))))