
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (+ (/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT)))) (/ NaChar (+ 1.0 (exp (/ (+ (+ (+ Ev Vef) EAccept) (- mu)) KbT))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) + -mu) / KbT))));
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
code = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + (nachar / (1.0d0 + exp(((((ev + vef) + eaccept) + -mu) / kbt))))
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) + -mu) / KbT))));
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): return (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) + -mu) / KbT))))
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) return Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) + Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) + Float64(-mu)) / KbT))))) end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) + -mu) / KbT)))); end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(N[(NdChar / N[(1.0 + N[Exp[N[((-N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision]) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] + (-mu)), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 20 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (+ (/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT)))) (/ NaChar (+ 1.0 (exp (/ (+ (+ (+ Ev Vef) EAccept) (- mu)) KbT))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) + -mu) / KbT))));
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
code = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + (nachar / (1.0d0 + exp(((((ev + vef) + eaccept) + -mu) / kbt))))
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) + -mu) / KbT))));
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): return (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) + -mu) / KbT))))
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) return Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) + Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) + Float64(-mu)) / KbT))))) end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) + -mu) / KbT)))); end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(N[(NdChar / N[(1.0 + N[Exp[N[((-N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision]) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] + (-mu)), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}}
\end{array}
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (- (/ NaChar (- (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)) -1.0)) (/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return (NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
code = (nachar / (exp(((((ev + vef) + eaccept) - mu) / kbt)) - (-1.0d0))) - (ndchar / ((-1.0d0) - exp(((mu - ((ec - vef) - edonor)) / kbt))))
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return (NaChar / (Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): return (NaChar / (math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))))
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) return Float64(Float64(NaChar / Float64(exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT))))) end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = (NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))); end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(N[(NaChar / N[(N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} - -1} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))))
(t_1 (/ NaChar (- (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)) -1.0)))
(t_2 (- t_1 t_0)))
(if (<= t_2 -5e-256)
(- (/ NaChar (- (exp (/ Vef KbT)) -1.0)) t_0)
(if (<= t_2 1e-174)
t_1
(- (/ NaChar (- (exp (/ EAccept KbT)) -1.0)) t_0)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT)));
double t_1 = NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0);
double t_2 = t_1 - t_0;
double tmp;
if (t_2 <= -5e-256) {
tmp = (NaChar / (exp((Vef / KbT)) - -1.0)) - t_0;
} else if (t_2 <= 1e-174) {
tmp = t_1;
} else {
tmp = (NaChar / (exp((EAccept / KbT)) - -1.0)) - t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = ndchar / ((-1.0d0) - exp(((mu - ((ec - vef) - edonor)) / kbt)))
t_1 = nachar / (exp(((((ev + vef) + eaccept) - mu) / kbt)) - (-1.0d0))
t_2 = t_1 - t_0
if (t_2 <= (-5d-256)) then
tmp = (nachar / (exp((vef / kbt)) - (-1.0d0))) - t_0
else if (t_2 <= 1d-174) then
tmp = t_1
else
tmp = (nachar / (exp((eaccept / kbt)) - (-1.0d0))) - t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (-1.0 - Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)));
double t_1 = NaChar / (Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0);
double t_2 = t_1 - t_0;
double tmp;
if (t_2 <= -5e-256) {
tmp = (NaChar / (Math.exp((Vef / KbT)) - -1.0)) - t_0;
} else if (t_2 <= 1e-174) {
tmp = t_1;
} else {
tmp = (NaChar / (Math.exp((EAccept / KbT)) - -1.0)) - t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NdChar / (-1.0 - math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))) t_1 = NaChar / (math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0) t_2 = t_1 - t_0 tmp = 0 if t_2 <= -5e-256: tmp = (NaChar / (math.exp((Vef / KbT)) - -1.0)) - t_0 elif t_2 <= 1e-174: tmp = t_1 else: tmp = (NaChar / (math.exp((EAccept / KbT)) - -1.0)) - t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) t_1 = Float64(NaChar / Float64(exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) t_2 = Float64(t_1 - t_0) tmp = 0.0 if (t_2 <= -5e-256) tmp = Float64(Float64(NaChar / Float64(exp(Float64(Vef / KbT)) - -1.0)) - t_0); elseif (t_2 <= 1e-174) tmp = t_1; else tmp = Float64(Float64(NaChar / Float64(exp(Float64(EAccept / KbT)) - -1.0)) - t_0); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))); t_1 = NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0); t_2 = t_1 - t_0; tmp = 0.0; if (t_2 <= -5e-256) tmp = (NaChar / (exp((Vef / KbT)) - -1.0)) - t_0; elseif (t_2 <= 1e-174) tmp = t_1; else tmp = (NaChar / (exp((EAccept / KbT)) - -1.0)) - t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(-1.0 - N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = 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$2 = N[(t$95$1 - t$95$0), $MachinePrecision]}, If[LessEqual[t$95$2, -5e-256], N[(N[(NaChar / N[(N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision], If[LessEqual[t$95$2, 1e-174], t$95$1, N[(N[(NaChar / N[(N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\
t_1 := \frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} - -1}\\
t_2 := t\_1 - t\_0\\
\mathbf{if}\;t\_2 \leq -5 \cdot 10^{-256}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} - -1} - t\_0\\
\mathbf{elif}\;t\_2 \leq 10^{-174}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} - -1} - 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-256Initial program 100.0%
Taylor expanded in Vef around inf
lower-/.f6482.3
Applied rewrites82.3%
if -5e-256 < (+.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-174Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6490.4
Applied rewrites90.4%
if 1e-174 < (+.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 EAccept around inf
lower-/.f6477.0
Applied rewrites77.0%
Final simplification83.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))))
(t_1 (- (/ NaChar (- (exp (/ EAccept KbT)) -1.0)) t_0))
(t_2 (/ NaChar (- (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)) -1.0)))
(t_3 (- t_2 t_0)))
(if (<= t_3 -1e-59) t_1 (if (<= t_3 1e-174) t_2 t_1))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT)));
double t_1 = (NaChar / (exp((EAccept / KbT)) - -1.0)) - t_0;
double t_2 = NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0);
double t_3 = t_2 - t_0;
double tmp;
if (t_3 <= -1e-59) {
tmp = t_1;
} else if (t_3 <= 1e-174) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = ndchar / ((-1.0d0) - exp(((mu - ((ec - vef) - edonor)) / kbt)))
t_1 = (nachar / (exp((eaccept / kbt)) - (-1.0d0))) - t_0
t_2 = nachar / (exp(((((ev + vef) + eaccept) - mu) / kbt)) - (-1.0d0))
t_3 = t_2 - t_0
if (t_3 <= (-1d-59)) then
tmp = t_1
else if (t_3 <= 1d-174) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (-1.0 - Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)));
double t_1 = (NaChar / (Math.exp((EAccept / KbT)) - -1.0)) - t_0;
double t_2 = NaChar / (Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0);
double t_3 = t_2 - t_0;
double tmp;
if (t_3 <= -1e-59) {
tmp = t_1;
} else if (t_3 <= 1e-174) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NdChar / (-1.0 - math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))) t_1 = (NaChar / (math.exp((EAccept / KbT)) - -1.0)) - t_0 t_2 = NaChar / (math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0) t_3 = t_2 - t_0 tmp = 0 if t_3 <= -1e-59: tmp = t_1 elif t_3 <= 1e-174: tmp = t_2 else: tmp = t_1 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) t_1 = Float64(Float64(NaChar / Float64(exp(Float64(EAccept / KbT)) - -1.0)) - t_0) t_2 = Float64(NaChar / Float64(exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) t_3 = Float64(t_2 - t_0) tmp = 0.0 if (t_3 <= -1e-59) tmp = t_1; elseif (t_3 <= 1e-174) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))); t_1 = (NaChar / (exp((EAccept / KbT)) - -1.0)) - t_0; t_2 = NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0); t_3 = t_2 - t_0; tmp = 0.0; if (t_3 <= -1e-59) tmp = t_1; elseif (t_3 <= 1e-174) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(-1.0 - N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NaChar / N[(N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] - t$95$0), $MachinePrecision]}, Block[{t$95$2 = 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$3 = N[(t$95$2 - t$95$0), $MachinePrecision]}, If[LessEqual[t$95$3, -1e-59], t$95$1, If[LessEqual[t$95$3, 1e-174], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\
t_1 := \frac{NaChar}{e^{\frac{EAccept}{KbT}} - -1} - t\_0\\
t_2 := \frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} - -1}\\
t_3 := t\_2 - t\_0\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{-59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 10^{-174}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -1e-59 or 1e-174 < (+.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 EAccept around inf
lower-/.f6478.2
Applied rewrites78.2%
if -1e-59 < (+.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-174Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6484.9
Applied rewrites84.9%
Final simplification80.8%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))))
(t_1 (- (* 0.5 NaChar) t_0))
(t_2 (/ NaChar (- (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)) -1.0)))
(t_3 (- t_2 t_0)))
(if (<= t_3 -1e-59) t_1 (if (<= t_3 2e-37) t_2 t_1))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT)));
double t_1 = (0.5 * NaChar) - t_0;
double t_2 = NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0);
double t_3 = t_2 - t_0;
double tmp;
if (t_3 <= -1e-59) {
tmp = t_1;
} else if (t_3 <= 2e-37) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = ndchar / ((-1.0d0) - exp(((mu - ((ec - vef) - edonor)) / kbt)))
t_1 = (0.5d0 * nachar) - t_0
t_2 = nachar / (exp(((((ev + vef) + eaccept) - mu) / kbt)) - (-1.0d0))
t_3 = t_2 - t_0
if (t_3 <= (-1d-59)) then
tmp = t_1
else if (t_3 <= 2d-37) then
tmp = t_2
else
tmp = t_1
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (-1.0 - Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)));
double t_1 = (0.5 * NaChar) - t_0;
double t_2 = NaChar / (Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0);
double t_3 = t_2 - t_0;
double tmp;
if (t_3 <= -1e-59) {
tmp = t_1;
} else if (t_3 <= 2e-37) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NdChar / (-1.0 - math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))) t_1 = (0.5 * NaChar) - t_0 t_2 = NaChar / (math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0) t_3 = t_2 - t_0 tmp = 0 if t_3 <= -1e-59: tmp = t_1 elif t_3 <= 2e-37: tmp = t_2 else: tmp = t_1 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT)))) t_1 = Float64(Float64(0.5 * NaChar) - t_0) t_2 = Float64(NaChar / Float64(exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) t_3 = Float64(t_2 - t_0) tmp = 0.0 if (t_3 <= -1e-59) tmp = t_1; elseif (t_3 <= 2e-37) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))); t_1 = (0.5 * NaChar) - t_0; t_2 = NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0); t_3 = t_2 - t_0; tmp = 0.0; if (t_3 <= -1e-59) tmp = t_1; elseif (t_3 <= 2e-37) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(-1.0 - N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(0.5 * NaChar), $MachinePrecision] - t$95$0), $MachinePrecision]}, Block[{t$95$2 = 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$3 = N[(t$95$2 - t$95$0), $MachinePrecision]}, If[LessEqual[t$95$3, -1e-59], t$95$1, If[LessEqual[t$95$3, 2e-37], t$95$2, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\
t_1 := 0.5 \cdot NaChar - t\_0\\
t_2 := \frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} - -1}\\
t_3 := t\_2 - t\_0\\
\mathbf{if}\;t\_3 \leq -1 \cdot 10^{-59}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_3 \leq 2 \cdot 10^{-37}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -1e-59 or 2.00000000000000013e-37 < (+.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 EAccept around inf
lower-/.f6480.0
Applied rewrites80.0%
Taylor expanded in KbT around inf
lower-*.f6470.5
Applied rewrites70.5%
if -1e-59 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 2.00000000000000013e-37Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6481.2
Applied rewrites81.2%
Final simplification75.6%
(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
(-
t_0
(/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))))))
(if (<= t_1 -1e-59)
(- (* 0.5 NdChar) (/ NaChar (- -1.0 (exp (/ Vef KbT)))))
(if (<= t_1 1e+185) t_0 (/ NdChar (+ 1.0 (exp (/ (- Ec) KbT))))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0);
double t_1 = t_0 - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (t_1 <= -1e-59) {
tmp = (0.5 * NdChar) - (NaChar / (-1.0 - exp((Vef / KbT))));
} else if (t_1 <= 1e+185) {
tmp = t_0;
} else {
tmp = NdChar / (1.0 + exp((-Ec / KbT)));
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = nachar / (exp(((((ev + vef) + eaccept) - mu) / kbt)) - (-1.0d0))
t_1 = t_0 - (ndchar / ((-1.0d0) - exp(((mu - ((ec - vef) - edonor)) / kbt))))
if (t_1 <= (-1d-59)) then
tmp = (0.5d0 * ndchar) - (nachar / ((-1.0d0) - exp((vef / kbt))))
else if (t_1 <= 1d+185) then
tmp = t_0
else
tmp = ndchar / (1.0d0 + exp((-ec / kbt)))
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0);
double t_1 = t_0 - (NdChar / (-1.0 - Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (t_1 <= -1e-59) {
tmp = (0.5 * NdChar) - (NaChar / (-1.0 - Math.exp((Vef / KbT))));
} else if (t_1 <= 1e+185) {
tmp = t_0;
} else {
tmp = NdChar / (1.0 + Math.exp((-Ec / KbT)));
}
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 = t_0 - (NdChar / (-1.0 - math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) tmp = 0 if t_1 <= -1e-59: tmp = (0.5 * NdChar) - (NaChar / (-1.0 - math.exp((Vef / KbT)))) elif t_1 <= 1e+185: tmp = t_0 else: tmp = NdChar / (1.0 + math.exp((-Ec / KbT))) 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(t_0 - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT))))) tmp = 0.0 if (t_1 <= -1e-59) tmp = Float64(Float64(0.5 * NdChar) - Float64(NaChar / Float64(-1.0 - exp(Float64(Vef / KbT))))); elseif (t_1 <= 1e+185) tmp = t_0; else tmp = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Ec) / KbT)))); 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 = t_0 - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))); tmp = 0.0; if (t_1 <= -1e-59) tmp = (0.5 * NdChar) - (NaChar / (-1.0 - exp((Vef / KbT)))); elseif (t_1 <= 1e+185) tmp = t_0; else tmp = NdChar / (1.0 + exp((-Ec / KbT))); 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[(t$95$0 - N[(NdChar / N[(-1.0 - N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-59], N[(N[(0.5 * NdChar), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+185], t$95$0, N[(NdChar / N[(1.0 + N[Exp[N[((-Ec) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} - -1}\\
t_1 := t\_0 - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-59}:\\
\;\;\;\;0.5 \cdot NdChar - \frac{NaChar}{-1 - e^{\frac{Vef}{KbT}}}\\
\mathbf{elif}\;t\_1 \leq 10^{+185}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{-Ec}{KbT}}}\\
\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-59Initial program 100.0%
Taylor expanded in Vef around inf
lower-/.f6485.2
Applied rewrites85.2%
Taylor expanded in KbT around inf
lower-*.f6454.8
Applied rewrites54.8%
if -1e-59 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 9.9999999999999998e184Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6474.3
Applied rewrites74.3%
if 9.9999999999999998e184 < (+.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 NaChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6474.4
Applied rewrites74.4%
Taylor expanded in Ec around inf
Applied rewrites64.7%
Final simplification67.8%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (* (+ NaChar NdChar) 0.5))
(t_1
(-
(/ NaChar (- (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)) -1.0))
(/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))))))
(if (<= t_1 -5e-65)
t_0
(if (<= t_1 1e+185) (/ NaChar (- (exp (/ EAccept KbT)) -1.0)) t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar + NdChar) * 0.5;
double t_1 = (NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (t_1 <= -5e-65) {
tmp = t_0;
} else if (t_1 <= 1e+185) {
tmp = NaChar / (exp((EAccept / KbT)) - -1.0);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (nachar + ndchar) * 0.5d0
t_1 = (nachar / (exp(((((ev + vef) + eaccept) - mu) / kbt)) - (-1.0d0))) - (ndchar / ((-1.0d0) - exp(((mu - ((ec - vef) - edonor)) / kbt))))
if (t_1 <= (-5d-65)) then
tmp = t_0
else if (t_1 <= 1d+185) then
tmp = nachar / (exp((eaccept / kbt)) - (-1.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar + NdChar) * 0.5;
double t_1 = (NaChar / (Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (t_1 <= -5e-65) {
tmp = t_0;
} else if (t_1 <= 1e+185) {
tmp = NaChar / (Math.exp((EAccept / KbT)) - -1.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NaChar + NdChar) * 0.5 t_1 = (NaChar / (math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) tmp = 0 if t_1 <= -5e-65: tmp = t_0 elif t_1 <= 1e+185: tmp = NaChar / (math.exp((EAccept / KbT)) - -1.0) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NaChar + NdChar) * 0.5) t_1 = Float64(Float64(NaChar / Float64(exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT))))) tmp = 0.0 if (t_1 <= -5e-65) tmp = t_0; elseif (t_1 <= 1e+185) tmp = Float64(NaChar / Float64(exp(Float64(EAccept / KbT)) - -1.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NaChar + NdChar) * 0.5; t_1 = (NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))); tmp = 0.0; if (t_1 <= -5e-65) tmp = t_0; elseif (t_1 <= 1e+185) tmp = NaChar / (exp((EAccept / KbT)) - -1.0); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NaChar / N[(N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-65], t$95$0, If[LessEqual[t$95$1, 1e+185], N[(NaChar / N[(N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
t_1 := \frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} - -1} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-65}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 10^{+185}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} - -1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -4.99999999999999983e-65 or 9.9999999999999998e184 < (+.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-+.f6444.3
Applied rewrites44.3%
if -4.99999999999999983e-65 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 9.9999999999999998e184Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6474.2
Applied rewrites74.2%
Taylor expanded in EAccept around inf
Applied rewrites40.9%
Final simplification42.2%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (* (+ NaChar NdChar) 0.5))
(t_1
(-
(/ NaChar (- (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)) -1.0))
(/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))))))
(if (<= t_1 -1e-294)
t_0
(if (<= t_1 5e-238)
(/
NdChar
(- (+ (+ (/ mu KbT) (/ Vef KbT)) (+ 2.0 (/ EDonor KbT))) (/ Ec KbT)))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar + NdChar) * 0.5;
double t_1 = (NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (t_1 <= -1e-294) {
tmp = t_0;
} else if (t_1 <= 5e-238) {
tmp = NdChar / ((((mu / KbT) + (Vef / KbT)) + (2.0 + (EDonor / KbT))) - (Ec / KbT));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (nachar + ndchar) * 0.5d0
t_1 = (nachar / (exp(((((ev + vef) + eaccept) - mu) / kbt)) - (-1.0d0))) - (ndchar / ((-1.0d0) - exp(((mu - ((ec - vef) - edonor)) / kbt))))
if (t_1 <= (-1d-294)) then
tmp = t_0
else if (t_1 <= 5d-238) then
tmp = ndchar / ((((mu / kbt) + (vef / kbt)) + (2.0d0 + (edonor / kbt))) - (ec / kbt))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar + NdChar) * 0.5;
double t_1 = (NaChar / (Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (t_1 <= -1e-294) {
tmp = t_0;
} else if (t_1 <= 5e-238) {
tmp = NdChar / ((((mu / KbT) + (Vef / KbT)) + (2.0 + (EDonor / KbT))) - (Ec / KbT));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NaChar + NdChar) * 0.5 t_1 = (NaChar / (math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) tmp = 0 if t_1 <= -1e-294: tmp = t_0 elif t_1 <= 5e-238: tmp = NdChar / ((((mu / KbT) + (Vef / KbT)) + (2.0 + (EDonor / KbT))) - (Ec / KbT)) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NaChar + NdChar) * 0.5) t_1 = Float64(Float64(NaChar / Float64(exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT))))) tmp = 0.0 if (t_1 <= -1e-294) tmp = t_0; elseif (t_1 <= 5e-238) tmp = Float64(NdChar / Float64(Float64(Float64(Float64(mu / KbT) + Float64(Vef / KbT)) + Float64(2.0 + Float64(EDonor / KbT))) - Float64(Ec / KbT))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NaChar + NdChar) * 0.5; t_1 = (NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))); tmp = 0.0; if (t_1 <= -1e-294) tmp = t_0; elseif (t_1 <= 5e-238) tmp = NdChar / ((((mu / KbT) + (Vef / KbT)) + (2.0 + (EDonor / KbT))) - (Ec / KbT)); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NaChar / N[(N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-294], t$95$0, If[LessEqual[t$95$1, 5e-238], N[(NdChar / N[(N[(N[(N[(mu / KbT), $MachinePrecision] + N[(Vef / KbT), $MachinePrecision]), $MachinePrecision] + N[(2.0 + N[(EDonor / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(Ec / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
t_1 := \frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} - -1} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-294}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-238}:\\
\;\;\;\;\frac{NdChar}{\left(\left(\frac{mu}{KbT} + \frac{Vef}{KbT}\right) + \left(2 + \frac{EDonor}{KbT}\right)\right) - \frac{Ec}{KbT}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -1.00000000000000002e-294 or 5e-238 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6437.0
Applied rewrites37.0%
if -1.00000000000000002e-294 < (+.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-238Initial program 100.0%
Taylor expanded in NaChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6488.9
Applied rewrites88.9%
Taylor expanded in KbT around inf
Applied rewrites37.6%
Final simplification37.2%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (* (+ NaChar NdChar) 0.5))
(t_1
(-
(/ NaChar (- (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)) -1.0))
(/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))))))
(if (<= t_1 -2e-74)
t_0
(if (<= t_1 5e-178)
(/
NaChar
(- (+ (+ (/ Ev KbT) (/ Vef KbT)) (+ 2.0 (/ EAccept KbT))) (/ mu KbT)))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar + NdChar) * 0.5;
double t_1 = (NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (t_1 <= -2e-74) {
tmp = t_0;
} else if (t_1 <= 5e-178) {
tmp = NaChar / ((((Ev / KbT) + (Vef / KbT)) + (2.0 + (EAccept / KbT))) - (mu / KbT));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (nachar + ndchar) * 0.5d0
t_1 = (nachar / (exp(((((ev + vef) + eaccept) - mu) / kbt)) - (-1.0d0))) - (ndchar / ((-1.0d0) - exp(((mu - ((ec - vef) - edonor)) / kbt))))
if (t_1 <= (-2d-74)) then
tmp = t_0
else if (t_1 <= 5d-178) then
tmp = nachar / ((((ev / kbt) + (vef / kbt)) + (2.0d0 + (eaccept / kbt))) - (mu / kbt))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar + NdChar) * 0.5;
double t_1 = (NaChar / (Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (t_1 <= -2e-74) {
tmp = t_0;
} else if (t_1 <= 5e-178) {
tmp = NaChar / ((((Ev / KbT) + (Vef / KbT)) + (2.0 + (EAccept / KbT))) - (mu / KbT));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NaChar + NdChar) * 0.5 t_1 = (NaChar / (math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) tmp = 0 if t_1 <= -2e-74: tmp = t_0 elif t_1 <= 5e-178: tmp = NaChar / ((((Ev / KbT) + (Vef / KbT)) + (2.0 + (EAccept / KbT))) - (mu / KbT)) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NaChar + NdChar) * 0.5) t_1 = Float64(Float64(NaChar / Float64(exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT))))) tmp = 0.0 if (t_1 <= -2e-74) tmp = t_0; elseif (t_1 <= 5e-178) tmp = Float64(NaChar / Float64(Float64(Float64(Float64(Ev / KbT) + Float64(Vef / KbT)) + Float64(2.0 + Float64(EAccept / KbT))) - Float64(mu / KbT))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NaChar + NdChar) * 0.5; t_1 = (NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))); tmp = 0.0; if (t_1 <= -2e-74) tmp = t_0; elseif (t_1 <= 5e-178) tmp = NaChar / ((((Ev / KbT) + (Vef / KbT)) + (2.0 + (EAccept / KbT))) - (mu / KbT)); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NaChar / N[(N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-74], t$95$0, If[LessEqual[t$95$1, 5e-178], N[(NaChar / N[(N[(N[(N[(Ev / KbT), $MachinePrecision] + N[(Vef / KbT), $MachinePrecision]), $MachinePrecision] + N[(2.0 + N[(EAccept / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(mu / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
t_1 := \frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} - -1} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-74}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-178}:\\
\;\;\;\;\frac{NaChar}{\left(\left(\frac{Ev}{KbT} + \frac{Vef}{KbT}\right) + \left(2 + \frac{EAccept}{KbT}\right)\right) - \frac{mu}{KbT}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -1.99999999999999992e-74 or 4.99999999999999976e-178 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6440.5
Applied rewrites40.5%
if -1.99999999999999992e-74 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.99999999999999976e-178Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6484.1
Applied rewrites84.1%
Taylor expanded in KbT around inf
Applied rewrites31.0%
Final simplification37.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (* (+ NaChar NdChar) 0.5))
(t_1
(-
(/ NaChar (- (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)) -1.0))
(/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))))))
(if (<= t_1 -2e-286)
t_0
(if (<= t_1 0.0)
(*
(/ (* (* NdChar NdChar) 0.5) (* (- NdChar NaChar) (+ NaChar NdChar)))
(+ NaChar NdChar))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar + NdChar) * 0.5;
double t_1 = (NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (t_1 <= -2e-286) {
tmp = t_0;
} else if (t_1 <= 0.0) {
tmp = (((NdChar * NdChar) * 0.5) / ((NdChar - NaChar) * (NaChar + NdChar))) * (NaChar + 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 = (nachar + ndchar) * 0.5d0
t_1 = (nachar / (exp(((((ev + vef) + eaccept) - mu) / kbt)) - (-1.0d0))) - (ndchar / ((-1.0d0) - exp(((mu - ((ec - vef) - edonor)) / kbt))))
if (t_1 <= (-2d-286)) then
tmp = t_0
else if (t_1 <= 0.0d0) then
tmp = (((ndchar * ndchar) * 0.5d0) / ((ndchar - nachar) * (nachar + ndchar))) * (nachar + 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 = (NaChar + NdChar) * 0.5;
double t_1 = (NaChar / (Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (t_1 <= -2e-286) {
tmp = t_0;
} else if (t_1 <= 0.0) {
tmp = (((NdChar * NdChar) * 0.5) / ((NdChar - NaChar) * (NaChar + NdChar))) * (NaChar + NdChar);
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NaChar + NdChar) * 0.5 t_1 = (NaChar / (math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) tmp = 0 if t_1 <= -2e-286: tmp = t_0 elif t_1 <= 0.0: tmp = (((NdChar * NdChar) * 0.5) / ((NdChar - NaChar) * (NaChar + NdChar))) * (NaChar + NdChar) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NaChar + NdChar) * 0.5) t_1 = Float64(Float64(NaChar / Float64(exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT))))) tmp = 0.0 if (t_1 <= -2e-286) tmp = t_0; elseif (t_1 <= 0.0) tmp = Float64(Float64(Float64(Float64(NdChar * NdChar) * 0.5) / Float64(Float64(NdChar - NaChar) * Float64(NaChar + NdChar))) * Float64(NaChar + NdChar)); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NaChar + NdChar) * 0.5; t_1 = (NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))); tmp = 0.0; if (t_1 <= -2e-286) tmp = t_0; elseif (t_1 <= 0.0) tmp = (((NdChar * NdChar) * 0.5) / ((NdChar - NaChar) * (NaChar + NdChar))) * (NaChar + 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[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NaChar / N[(N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-286], t$95$0, If[LessEqual[t$95$1, 0.0], N[(N[(N[(N[(NdChar * NdChar), $MachinePrecision] * 0.5), $MachinePrecision] / N[(N[(NdChar - NaChar), $MachinePrecision] * N[(NaChar + NdChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(NaChar + NdChar), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
t_1 := \frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} - -1} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-286}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{\left(NdChar \cdot NdChar\right) \cdot 0.5}{\left(NdChar - NaChar\right) \cdot \left(NaChar + NdChar\right)} \cdot \left(NaChar + NdChar\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -2.0000000000000001e-286 or 0.0 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6435.8
Applied rewrites35.8%
if -2.0000000000000001e-286 < (+.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.6
Applied rewrites2.6%
Applied rewrites5.7%
Taylor expanded in NaChar around 0
Applied rewrites31.1%
Applied rewrites34.1%
Final simplification35.4%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (* (+ NaChar NdChar) 0.5))
(t_1
(-
(/ NaChar (- (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)) -1.0))
(/ NdChar (- -1.0 (exp (/ (- mu (- (- Ec Vef) EDonor)) KbT)))))))
(if (<= t_1 -5e-239)
t_0
(if (<= t_1 5e-238)
(* (/ (* NdChar NdChar) (- NdChar NaChar)) 0.5)
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar + NdChar) * 0.5;
double t_1 = (NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (t_1 <= -5e-239) {
tmp = t_0;
} else if (t_1 <= 5e-238) {
tmp = ((NdChar * NdChar) / (NdChar - NaChar)) * 0.5;
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = (nachar + ndchar) * 0.5d0
t_1 = (nachar / (exp(((((ev + vef) + eaccept) - mu) / kbt)) - (-1.0d0))) - (ndchar / ((-1.0d0) - exp(((mu - ((ec - vef) - edonor)) / kbt))))
if (t_1 <= (-5d-239)) then
tmp = t_0
else if (t_1 <= 5d-238) then
tmp = ((ndchar * ndchar) / (ndchar - nachar)) * 0.5d0
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar + NdChar) * 0.5;
double t_1 = (NaChar / (Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - Math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT))));
double tmp;
if (t_1 <= -5e-239) {
tmp = t_0;
} else if (t_1 <= 5e-238) {
tmp = ((NdChar * NdChar) / (NdChar - NaChar)) * 0.5;
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NaChar + NdChar) * 0.5 t_1 = (NaChar / (math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - math.exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))) tmp = 0 if t_1 <= -5e-239: tmp = t_0 elif t_1 <= 5e-238: tmp = ((NdChar * NdChar) / (NdChar - NaChar)) * 0.5 else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NaChar + NdChar) * 0.5) t_1 = Float64(Float64(NaChar / Float64(exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(mu - Float64(Float64(Ec - Vef) - EDonor)) / KbT))))) tmp = 0.0 if (t_1 <= -5e-239) tmp = t_0; elseif (t_1 <= 5e-238) tmp = Float64(Float64(Float64(NdChar * NdChar) / Float64(NdChar - NaChar)) * 0.5); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NaChar + NdChar) * 0.5; t_1 = (NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)) - (NdChar / (-1.0 - exp(((mu - ((Ec - Vef) - EDonor)) / KbT)))); tmp = 0.0; if (t_1 <= -5e-239) tmp = t_0; elseif (t_1 <= 5e-238) tmp = ((NdChar * NdChar) / (NdChar - NaChar)) * 0.5; else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NaChar / N[(N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - N[Exp[N[(N[(mu - N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e-239], t$95$0, If[LessEqual[t$95$1, 5e-238], N[(N[(N[(NdChar * NdChar), $MachinePrecision] / N[(NdChar - NaChar), $MachinePrecision]), $MachinePrecision] * 0.5), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \left(NaChar + NdChar\right) \cdot 0.5\\
t_1 := \frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} - -1} - \frac{NdChar}{-1 - e^{\frac{mu - \left(\left(Ec - Vef\right) - EDonor\right)}{KbT}}}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{-239}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-238}:\\
\;\;\;\;\frac{NdChar \cdot NdChar}{NdChar - NaChar} \cdot 0.5\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -5e-239 or 5e-238 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6437.9
Applied rewrites37.9%
if -5e-239 < (+.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-238Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f643.2
Applied rewrites3.2%
Applied rewrites5.5%
Taylor expanded in NaChar around 0
Applied rewrites26.6%
Applied rewrites26.6%
Final simplification34.7%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NaChar (- (exp (/ Vef KbT)) -1.0)))
(t_1 (/ NdChar (+ 1.0 (exp (/ (- Ec) KbT)))))
(t_2 (- (* 0.5 NdChar) (/ NaChar (- -1.0 (exp (/ EAccept KbT)))))))
(if (<= KbT -8.5e+85)
t_2
(if (<= KbT 1.9e-306)
t_1
(if (<= KbT 1.35e-42)
t_0
(if (<= KbT 3.2e+75) t_1 (if (<= KbT 2.1e+189) t_0 t_2)))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (exp((Vef / KbT)) - -1.0);
double t_1 = NdChar / (1.0 + exp((-Ec / KbT)));
double t_2 = (0.5 * NdChar) - (NaChar / (-1.0 - exp((EAccept / KbT))));
double tmp;
if (KbT <= -8.5e+85) {
tmp = t_2;
} else if (KbT <= 1.9e-306) {
tmp = t_1;
} else if (KbT <= 1.35e-42) {
tmp = t_0;
} else if (KbT <= 3.2e+75) {
tmp = t_1;
} else if (KbT <= 2.1e+189) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = nachar / (exp((vef / kbt)) - (-1.0d0))
t_1 = ndchar / (1.0d0 + exp((-ec / kbt)))
t_2 = (0.5d0 * ndchar) - (nachar / ((-1.0d0) - exp((eaccept / kbt))))
if (kbt <= (-8.5d+85)) then
tmp = t_2
else if (kbt <= 1.9d-306) then
tmp = t_1
else if (kbt <= 1.35d-42) then
tmp = t_0
else if (kbt <= 3.2d+75) then
tmp = t_1
else if (kbt <= 2.1d+189) then
tmp = t_0
else
tmp = t_2
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (Math.exp((Vef / KbT)) - -1.0);
double t_1 = NdChar / (1.0 + Math.exp((-Ec / KbT)));
double t_2 = (0.5 * NdChar) - (NaChar / (-1.0 - Math.exp((EAccept / KbT))));
double tmp;
if (KbT <= -8.5e+85) {
tmp = t_2;
} else if (KbT <= 1.9e-306) {
tmp = t_1;
} else if (KbT <= 1.35e-42) {
tmp = t_0;
} else if (KbT <= 3.2e+75) {
tmp = t_1;
} else if (KbT <= 2.1e+189) {
tmp = t_0;
} else {
tmp = t_2;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NaChar / (math.exp((Vef / KbT)) - -1.0) t_1 = NdChar / (1.0 + math.exp((-Ec / KbT))) t_2 = (0.5 * NdChar) - (NaChar / (-1.0 - math.exp((EAccept / KbT)))) tmp = 0 if KbT <= -8.5e+85: tmp = t_2 elif KbT <= 1.9e-306: tmp = t_1 elif KbT <= 1.35e-42: tmp = t_0 elif KbT <= 3.2e+75: tmp = t_1 elif KbT <= 2.1e+189: tmp = t_0 else: tmp = t_2 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NaChar / Float64(exp(Float64(Vef / KbT)) - -1.0)) t_1 = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Ec) / KbT)))) t_2 = Float64(Float64(0.5 * NdChar) - Float64(NaChar / Float64(-1.0 - exp(Float64(EAccept / KbT))))) tmp = 0.0 if (KbT <= -8.5e+85) tmp = t_2; elseif (KbT <= 1.9e-306) tmp = t_1; elseif (KbT <= 1.35e-42) tmp = t_0; elseif (KbT <= 3.2e+75) tmp = t_1; elseif (KbT <= 2.1e+189) tmp = t_0; else tmp = t_2; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NaChar / (exp((Vef / KbT)) - -1.0); t_1 = NdChar / (1.0 + exp((-Ec / KbT))); t_2 = (0.5 * NdChar) - (NaChar / (-1.0 - exp((EAccept / KbT)))); tmp = 0.0; if (KbT <= -8.5e+85) tmp = t_2; elseif (KbT <= 1.9e-306) tmp = t_1; elseif (KbT <= 1.35e-42) tmp = t_0; elseif (KbT <= 3.2e+75) tmp = t_1; elseif (KbT <= 2.1e+189) tmp = t_0; else tmp = t_2; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NaChar / N[(N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(NdChar / N[(1.0 + N[Exp[N[((-Ec) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(0.5 * NdChar), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -8.5e+85], t$95$2, If[LessEqual[KbT, 1.9e-306], t$95$1, If[LessEqual[KbT, 1.35e-42], t$95$0, If[LessEqual[KbT, 3.2e+75], t$95$1, If[LessEqual[KbT, 2.1e+189], t$95$0, t$95$2]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{e^{\frac{Vef}{KbT}} - -1}\\
t_1 := \frac{NdChar}{1 + e^{\frac{-Ec}{KbT}}}\\
t_2 := 0.5 \cdot NdChar - \frac{NaChar}{-1 - e^{\frac{EAccept}{KbT}}}\\
\mathbf{if}\;KbT \leq -8.5 \cdot 10^{+85}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;KbT \leq 1.9 \cdot 10^{-306}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;KbT \leq 1.35 \cdot 10^{-42}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;KbT \leq 3.2 \cdot 10^{+75}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;KbT \leq 2.1 \cdot 10^{+189}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if KbT < -8.4999999999999994e85 or 2.09999999999999992e189 < KbT Initial program 100.0%
Taylor expanded in EAccept around inf
lower-/.f6484.7
Applied rewrites84.7%
Taylor expanded in KbT around inf
lower-*.f6472.5
Applied rewrites72.5%
if -8.4999999999999994e85 < KbT < 1.9e-306 or 1.35e-42 < KbT < 3.19999999999999985e75Initial program 100.0%
Taylor expanded in NaChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6473.3
Applied rewrites73.3%
Taylor expanded in Ec around inf
Applied rewrites48.8%
if 1.9e-306 < KbT < 1.35e-42 or 3.19999999999999985e75 < KbT < 2.09999999999999992e189Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6474.7
Applied rewrites74.7%
Taylor expanded in Vef around inf
Applied rewrites59.8%
Final simplification58.2%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (+ 1.0 (exp (/ (- Ec) KbT)))))
(t_1 (* (+ NaChar NdChar) 0.5))
(t_2 (/ NaChar (- (exp (/ Vef KbT)) -1.0))))
(if (<= KbT -7e+87)
t_1
(if (<= KbT 1.9e-306)
t_0
(if (<= KbT 1.35e-42)
t_2
(if (<= KbT 3.2e+75)
t_0
(if (<= KbT 2.7e+189)
t_2
(fma -0.25 (* (+ (/ NaChar KbT) (/ NdChar KbT)) Vef) t_1))))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + exp((-Ec / KbT)));
double t_1 = (NaChar + NdChar) * 0.5;
double t_2 = NaChar / (exp((Vef / KbT)) - -1.0);
double tmp;
if (KbT <= -7e+87) {
tmp = t_1;
} else if (KbT <= 1.9e-306) {
tmp = t_0;
} else if (KbT <= 1.35e-42) {
tmp = t_2;
} else if (KbT <= 3.2e+75) {
tmp = t_0;
} else if (KbT <= 2.7e+189) {
tmp = t_2;
} else {
tmp = fma(-0.25, (((NaChar / KbT) + (NdChar / KbT)) * Vef), t_1);
}
return tmp;
}
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Ec) / KbT)))) t_1 = Float64(Float64(NaChar + NdChar) * 0.5) t_2 = Float64(NaChar / Float64(exp(Float64(Vef / KbT)) - -1.0)) tmp = 0.0 if (KbT <= -7e+87) tmp = t_1; elseif (KbT <= 1.9e-306) tmp = t_0; elseif (KbT <= 1.35e-42) tmp = t_2; elseif (KbT <= 3.2e+75) tmp = t_0; elseif (KbT <= 2.7e+189) tmp = t_2; else tmp = fma(-0.25, Float64(Float64(Float64(NaChar / KbT) + Float64(NdChar / KbT)) * Vef), t_1); end return tmp end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(1.0 + N[Exp[N[((-Ec) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]}, Block[{t$95$2 = N[(NaChar / N[(N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -7e+87], t$95$1, If[LessEqual[KbT, 1.9e-306], t$95$0, If[LessEqual[KbT, 1.35e-42], t$95$2, If[LessEqual[KbT, 3.2e+75], t$95$0, If[LessEqual[KbT, 2.7e+189], t$95$2, N[(-0.25 * N[(N[(N[(NaChar / KbT), $MachinePrecision] + N[(NdChar / KbT), $MachinePrecision]), $MachinePrecision] * Vef), $MachinePrecision] + t$95$1), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{-Ec}{KbT}}}\\
t_1 := \left(NaChar + NdChar\right) \cdot 0.5\\
t_2 := \frac{NaChar}{e^{\frac{Vef}{KbT}} - -1}\\
\mathbf{if}\;KbT \leq -7 \cdot 10^{+87}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;KbT \leq 1.9 \cdot 10^{-306}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;KbT \leq 1.35 \cdot 10^{-42}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;KbT \leq 3.2 \cdot 10^{+75}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;KbT \leq 2.7 \cdot 10^{+189}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.25, \left(\frac{NaChar}{KbT} + \frac{NdChar}{KbT}\right) \cdot Vef, t\_1\right)\\
\end{array}
\end{array}
if KbT < -6.99999999999999972e87Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6470.5
Applied rewrites70.5%
if -6.99999999999999972e87 < KbT < 1.9e-306 or 1.35e-42 < KbT < 3.19999999999999985e75Initial program 100.0%
Taylor expanded in NaChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6473.3
Applied rewrites73.3%
Taylor expanded in Ec around inf
Applied rewrites48.8%
if 1.9e-306 < KbT < 1.35e-42 or 3.19999999999999985e75 < KbT < 2.69999999999999994e189Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6474.7
Applied rewrites74.7%
Taylor expanded in Vef around inf
Applied rewrites59.8%
if 2.69999999999999994e189 < KbT Initial program 100.0%
Taylor expanded in KbT around -inf
associate-+r+N/A
distribute-lft-outN/A
lower-fma.f64N/A
Applied rewrites69.2%
Taylor expanded in Vef around inf
Applied rewrites69.2%
Final simplification57.6%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (exp (/ Vef KbT))))
(if (<= Ev -6.8e+226)
(/ NaChar (- (exp (/ Ev KbT)) -1.0))
(if (<= Ev -5.4e+178)
(/ NdChar (+ 1.0 (exp (/ mu KbT))))
(if (<= Ev -3.2e-114)
(/ NaChar (- (exp (/ (- mu) KbT)) -1.0))
(if (<= Ev -1.32e-245)
(/ NdChar (+ 1.0 t_0))
(if (<= Ev 1.45e-178)
(/ NaChar (- t_0 -1.0))
(/ NdChar (+ 1.0 (exp (/ EDonor KbT)))))))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = exp((Vef / KbT));
double tmp;
if (Ev <= -6.8e+226) {
tmp = NaChar / (exp((Ev / KbT)) - -1.0);
} else if (Ev <= -5.4e+178) {
tmp = NdChar / (1.0 + exp((mu / KbT)));
} else if (Ev <= -3.2e-114) {
tmp = NaChar / (exp((-mu / KbT)) - -1.0);
} else if (Ev <= -1.32e-245) {
tmp = NdChar / (1.0 + t_0);
} else if (Ev <= 1.45e-178) {
tmp = NaChar / (t_0 - -1.0);
} else {
tmp = NdChar / (1.0 + exp((EDonor / KbT)));
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = exp((vef / kbt))
if (ev <= (-6.8d+226)) then
tmp = nachar / (exp((ev / kbt)) - (-1.0d0))
else if (ev <= (-5.4d+178)) then
tmp = ndchar / (1.0d0 + exp((mu / kbt)))
else if (ev <= (-3.2d-114)) then
tmp = nachar / (exp((-mu / kbt)) - (-1.0d0))
else if (ev <= (-1.32d-245)) then
tmp = ndchar / (1.0d0 + t_0)
else if (ev <= 1.45d-178) then
tmp = nachar / (t_0 - (-1.0d0))
else
tmp = ndchar / (1.0d0 + exp((edonor / kbt)))
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = Math.exp((Vef / KbT));
double tmp;
if (Ev <= -6.8e+226) {
tmp = NaChar / (Math.exp((Ev / KbT)) - -1.0);
} else if (Ev <= -5.4e+178) {
tmp = NdChar / (1.0 + Math.exp((mu / KbT)));
} else if (Ev <= -3.2e-114) {
tmp = NaChar / (Math.exp((-mu / KbT)) - -1.0);
} else if (Ev <= -1.32e-245) {
tmp = NdChar / (1.0 + t_0);
} else if (Ev <= 1.45e-178) {
tmp = NaChar / (t_0 - -1.0);
} else {
tmp = NdChar / (1.0 + Math.exp((EDonor / KbT)));
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = math.exp((Vef / KbT)) tmp = 0 if Ev <= -6.8e+226: tmp = NaChar / (math.exp((Ev / KbT)) - -1.0) elif Ev <= -5.4e+178: tmp = NdChar / (1.0 + math.exp((mu / KbT))) elif Ev <= -3.2e-114: tmp = NaChar / (math.exp((-mu / KbT)) - -1.0) elif Ev <= -1.32e-245: tmp = NdChar / (1.0 + t_0) elif Ev <= 1.45e-178: tmp = NaChar / (t_0 - -1.0) else: tmp = NdChar / (1.0 + math.exp((EDonor / KbT))) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = exp(Float64(Vef / KbT)) tmp = 0.0 if (Ev <= -6.8e+226) tmp = Float64(NaChar / Float64(exp(Float64(Ev / KbT)) - -1.0)); elseif (Ev <= -5.4e+178) tmp = Float64(NdChar / Float64(1.0 + exp(Float64(mu / KbT)))); elseif (Ev <= -3.2e-114) tmp = Float64(NaChar / Float64(exp(Float64(Float64(-mu) / KbT)) - -1.0)); elseif (Ev <= -1.32e-245) tmp = Float64(NdChar / Float64(1.0 + t_0)); elseif (Ev <= 1.45e-178) tmp = Float64(NaChar / Float64(t_0 - -1.0)); else tmp = Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT)))); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = exp((Vef / KbT)); tmp = 0.0; if (Ev <= -6.8e+226) tmp = NaChar / (exp((Ev / KbT)) - -1.0); elseif (Ev <= -5.4e+178) tmp = NdChar / (1.0 + exp((mu / KbT))); elseif (Ev <= -3.2e-114) tmp = NaChar / (exp((-mu / KbT)) - -1.0); elseif (Ev <= -1.32e-245) tmp = NdChar / (1.0 + t_0); elseif (Ev <= 1.45e-178) tmp = NaChar / (t_0 - -1.0); else tmp = NdChar / (1.0 + exp((EDonor / KbT))); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[Ev, -6.8e+226], N[(NaChar / N[(N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[Ev, -5.4e+178], N[(NdChar / N[(1.0 + N[Exp[N[(mu / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[Ev, -3.2e-114], N[(NaChar / N[(N[Exp[N[((-mu) / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[Ev, -1.32e-245], N[(NdChar / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision], If[LessEqual[Ev, 1.45e-178], N[(NaChar / N[(t$95$0 - -1.0), $MachinePrecision]), $MachinePrecision], N[(NdChar / N[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\frac{Vef}{KbT}}\\
\mathbf{if}\;Ev \leq -6.8 \cdot 10^{+226}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} - -1}\\
\mathbf{elif}\;Ev \leq -5.4 \cdot 10^{+178}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{mu}{KbT}}}\\
\mathbf{elif}\;Ev \leq -3.2 \cdot 10^{-114}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{-mu}{KbT}} - -1}\\
\mathbf{elif}\;Ev \leq -1.32 \cdot 10^{-245}:\\
\;\;\;\;\frac{NdChar}{1 + t\_0}\\
\mathbf{elif}\;Ev \leq 1.45 \cdot 10^{-178}:\\
\;\;\;\;\frac{NaChar}{t\_0 - -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\
\end{array}
\end{array}
if Ev < -6.79999999999999958e226Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6461.0
Applied rewrites61.0%
Taylor expanded in Ev around inf
Applied rewrites61.0%
if -6.79999999999999958e226 < Ev < -5.40000000000000036e178Initial program 100.0%
Taylor expanded in NaChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6472.1
Applied rewrites72.1%
Taylor expanded in mu around inf
Applied rewrites47.3%
if -5.40000000000000036e178 < Ev < -3.2000000000000002e-114Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6467.0
Applied rewrites67.0%
Taylor expanded in mu around inf
Applied rewrites45.1%
if -3.2000000000000002e-114 < Ev < -1.32e-245Initial program 100.0%
Taylor expanded in NaChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6457.6
Applied rewrites57.6%
Taylor expanded in Vef around inf
Applied rewrites42.3%
if -1.32e-245 < Ev < 1.4499999999999999e-178Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6456.1
Applied rewrites56.1%
Taylor expanded in Vef around inf
Applied rewrites41.6%
if 1.4499999999999999e-178 < Ev Initial program 100.0%
Taylor expanded in NaChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6468.5
Applied rewrites68.5%
Taylor expanded in EDonor around inf
Applied rewrites43.9%
Final simplification44.9%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (+ 1.0 (exp (/ (- (+ (+ mu Vef) EDonor) Ec) KbT))))))
(if (<= NdChar -1.6e-42)
t_0
(if (<= NdChar 8.8e-198)
(/ NaChar (- (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)) -1.0))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
double tmp;
if (NdChar <= -1.6e-42) {
tmp = t_0;
} else if (NdChar <= 8.8e-198) {
tmp = NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = ndchar / (1.0d0 + exp(((((mu + vef) + edonor) - ec) / kbt)))
if (ndchar <= (-1.6d-42)) then
tmp = t_0
else if (ndchar <= 8.8d-198) then
tmp = nachar / (exp(((((ev + vef) + eaccept) - mu) / kbt)) - (-1.0d0))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + Math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)));
double tmp;
if (NdChar <= -1.6e-42) {
tmp = t_0;
} else if (NdChar <= 8.8e-198) {
tmp = NaChar / (Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NdChar / (1.0 + math.exp(((((mu + Vef) + EDonor) - Ec) / KbT))) tmp = 0 if NdChar <= -1.6e-42: tmp = t_0 elif NdChar <= 8.8e-198: tmp = NaChar / (math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT)))) tmp = 0.0 if (NdChar <= -1.6e-42) tmp = t_0; elseif (NdChar <= 8.8e-198) tmp = Float64(NaChar / Float64(exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)) - -1.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NdChar / (1.0 + exp(((((mu + Vef) + EDonor) - Ec) / KbT))); tmp = 0.0; if (NdChar <= -1.6e-42) tmp = t_0; elseif (NdChar <= 8.8e-198) tmp = NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) - -1.0); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(1.0 + N[Exp[N[(N[(N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NdChar, -1.6e-42], t$95$0, If[LessEqual[NdChar, 8.8e-198], N[(NaChar / N[(N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}}}\\
\mathbf{if}\;NdChar \leq -1.6 \cdot 10^{-42}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;NdChar \leq 8.8 \cdot 10^{-198}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} - -1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if NdChar < -1.60000000000000012e-42 or 8.8000000000000001e-198 < NdChar Initial program 100.0%
Taylor expanded in NaChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6472.2
Applied rewrites72.2%
if -1.60000000000000012e-42 < NdChar < 8.8000000000000001e-198Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6479.7
Applied rewrites79.7%
Final simplification74.4%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(if (<= Ev -3.3e+88)
(/ NaChar (- (exp (/ Ev KbT)) -1.0))
(if (<= Ev 1.45e-178)
(/ NaChar (- (exp (/ Vef KbT)) -1.0))
(/ NdChar (+ 1.0 (exp (/ EDonor KbT)))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (Ev <= -3.3e+88) {
tmp = NaChar / (exp((Ev / KbT)) - -1.0);
} else if (Ev <= 1.45e-178) {
tmp = NaChar / (exp((Vef / KbT)) - -1.0);
} else {
tmp = NdChar / (1.0 + exp((EDonor / 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 (ev <= (-3.3d+88)) then
tmp = nachar / (exp((ev / kbt)) - (-1.0d0))
else if (ev <= 1.45d-178) then
tmp = nachar / (exp((vef / kbt)) - (-1.0d0))
else
tmp = ndchar / (1.0d0 + exp((edonor / 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 (Ev <= -3.3e+88) {
tmp = NaChar / (Math.exp((Ev / KbT)) - -1.0);
} else if (Ev <= 1.45e-178) {
tmp = NaChar / (Math.exp((Vef / KbT)) - -1.0);
} else {
tmp = NdChar / (1.0 + Math.exp((EDonor / KbT)));
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if Ev <= -3.3e+88: tmp = NaChar / (math.exp((Ev / KbT)) - -1.0) elif Ev <= 1.45e-178: tmp = NaChar / (math.exp((Vef / KbT)) - -1.0) else: tmp = NdChar / (1.0 + math.exp((EDonor / KbT))) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (Ev <= -3.3e+88) tmp = Float64(NaChar / Float64(exp(Float64(Ev / KbT)) - -1.0)); elseif (Ev <= 1.45e-178) tmp = Float64(NaChar / Float64(exp(Float64(Vef / KbT)) - -1.0)); else tmp = Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT)))); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if (Ev <= -3.3e+88) tmp = NaChar / (exp((Ev / KbT)) - -1.0); elseif (Ev <= 1.45e-178) tmp = NaChar / (exp((Vef / KbT)) - -1.0); else tmp = NdChar / (1.0 + exp((EDonor / KbT))); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[Ev, -3.3e+88], N[(NaChar / N[(N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[Ev, 1.45e-178], N[(NaChar / N[(N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], N[(NdChar / N[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;Ev \leq -3.3 \cdot 10^{+88}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} - -1}\\
\mathbf{elif}\;Ev \leq 1.45 \cdot 10^{-178}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} - -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\
\end{array}
\end{array}
if Ev < -3.3000000000000003e88Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6459.8
Applied rewrites59.8%
Taylor expanded in Ev around inf
Applied rewrites54.2%
if -3.3000000000000003e88 < Ev < 1.4499999999999999e-178Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6463.3
Applied rewrites63.3%
Taylor expanded in Vef around inf
Applied rewrites45.5%
if 1.4499999999999999e-178 < Ev Initial program 100.0%
Taylor expanded in NaChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6468.5
Applied rewrites68.5%
Taylor expanded in EDonor around inf
Applied rewrites43.9%
Final simplification46.7%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(if (<= Ev -2e+93)
(/ NaChar (- (exp (/ Ev KbT)) -1.0))
(if (<= Ev 6e-208)
(/ NaChar (- (exp (/ Vef KbT)) -1.0))
(/ NaChar (- (exp (/ EAccept KbT)) -1.0)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (Ev <= -2e+93) {
tmp = NaChar / (exp((Ev / KbT)) - -1.0);
} else if (Ev <= 6e-208) {
tmp = NaChar / (exp((Vef / KbT)) - -1.0);
} else {
tmp = NaChar / (exp((EAccept / KbT)) - -1.0);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: tmp
if (ev <= (-2d+93)) then
tmp = nachar / (exp((ev / kbt)) - (-1.0d0))
else if (ev <= 6d-208) then
tmp = nachar / (exp((vef / kbt)) - (-1.0d0))
else
tmp = nachar / (exp((eaccept / kbt)) - (-1.0d0))
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (Ev <= -2e+93) {
tmp = NaChar / (Math.exp((Ev / KbT)) - -1.0);
} else if (Ev <= 6e-208) {
tmp = NaChar / (Math.exp((Vef / KbT)) - -1.0);
} else {
tmp = NaChar / (Math.exp((EAccept / KbT)) - -1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if Ev <= -2e+93: tmp = NaChar / (math.exp((Ev / KbT)) - -1.0) elif Ev <= 6e-208: tmp = NaChar / (math.exp((Vef / KbT)) - -1.0) else: tmp = NaChar / (math.exp((EAccept / KbT)) - -1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (Ev <= -2e+93) tmp = Float64(NaChar / Float64(exp(Float64(Ev / KbT)) - -1.0)); elseif (Ev <= 6e-208) tmp = Float64(NaChar / Float64(exp(Float64(Vef / KbT)) - -1.0)); else tmp = Float64(NaChar / Float64(exp(Float64(EAccept / KbT)) - -1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if (Ev <= -2e+93) tmp = NaChar / (exp((Ev / KbT)) - -1.0); elseif (Ev <= 6e-208) tmp = NaChar / (exp((Vef / KbT)) - -1.0); else tmp = NaChar / (exp((EAccept / KbT)) - -1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[Ev, -2e+93], N[(NaChar / N[(N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[Ev, 6e-208], N[(NaChar / N[(N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], N[(NaChar / N[(N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;Ev \leq -2 \cdot 10^{+93}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} - -1}\\
\mathbf{elif}\;Ev \leq 6 \cdot 10^{-208}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Vef}{KbT}} - -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} - -1}\\
\end{array}
\end{array}
if Ev < -2.00000000000000009e93Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6458.5
Applied rewrites58.5%
Taylor expanded in Ev around inf
Applied rewrites52.3%
if -2.00000000000000009e93 < Ev < 5.99999999999999972e-208Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6464.1
Applied rewrites64.1%
Taylor expanded in Vef around inf
Applied rewrites46.3%
if 5.99999999999999972e-208 < Ev Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6458.2
Applied rewrites58.2%
Taylor expanded in EAccept around inf
Applied rewrites40.1%
Final simplification45.1%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (if (<= Ev -1.25e+88) (/ NaChar (- (exp (/ Ev KbT)) -1.0)) (/ NaChar (- (exp (/ EAccept KbT)) -1.0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (Ev <= -1.25e+88) {
tmp = NaChar / (exp((Ev / KbT)) - -1.0);
} else {
tmp = NaChar / (exp((EAccept / KbT)) - -1.0);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: tmp
if (ev <= (-1.25d+88)) then
tmp = nachar / (exp((ev / kbt)) - (-1.0d0))
else
tmp = nachar / (exp((eaccept / kbt)) - (-1.0d0))
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (Ev <= -1.25e+88) {
tmp = NaChar / (Math.exp((Ev / KbT)) - -1.0);
} else {
tmp = NaChar / (Math.exp((EAccept / KbT)) - -1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if Ev <= -1.25e+88: tmp = NaChar / (math.exp((Ev / KbT)) - -1.0) else: tmp = NaChar / (math.exp((EAccept / KbT)) - -1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (Ev <= -1.25e+88) tmp = Float64(NaChar / Float64(exp(Float64(Ev / KbT)) - -1.0)); else tmp = Float64(NaChar / Float64(exp(Float64(EAccept / KbT)) - -1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if (Ev <= -1.25e+88) tmp = NaChar / (exp((Ev / KbT)) - -1.0); else tmp = NaChar / (exp((EAccept / KbT)) - -1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[Ev, -1.25e+88], N[(NaChar / N[(N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision], N[(NaChar / N[(N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;Ev \leq -1.25 \cdot 10^{+88}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{Ev}{KbT}} - -1}\\
\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept}{KbT}} - -1}\\
\end{array}
\end{array}
if Ev < -1.24999999999999999e88Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6459.8
Applied rewrites59.8%
Taylor expanded in Ev around inf
Applied rewrites54.2%
if -1.24999999999999999e88 < Ev Initial program 100.0%
Taylor expanded in NaChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6461.1
Applied rewrites61.1%
Taylor expanded in EAccept around inf
Applied rewrites37.3%
Final simplification40.7%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (if (<= NdChar -3.8e-52) (* 0.5 NdChar) (if (<= NdChar 130000000.0) (* 0.5 NaChar) (* 0.5 NdChar))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (NdChar <= -3.8e-52) {
tmp = 0.5 * NdChar;
} else if (NdChar <= 130000000.0) {
tmp = 0.5 * NaChar;
} else {
tmp = 0.5 * NdChar;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: tmp
if (ndchar <= (-3.8d-52)) then
tmp = 0.5d0 * ndchar
else if (ndchar <= 130000000.0d0) then
tmp = 0.5d0 * nachar
else
tmp = 0.5d0 * ndchar
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (NdChar <= -3.8e-52) {
tmp = 0.5 * NdChar;
} else if (NdChar <= 130000000.0) {
tmp = 0.5 * NaChar;
} else {
tmp = 0.5 * NdChar;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if NdChar <= -3.8e-52: tmp = 0.5 * NdChar elif NdChar <= 130000000.0: tmp = 0.5 * NaChar else: tmp = 0.5 * NdChar return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (NdChar <= -3.8e-52) tmp = Float64(0.5 * NdChar); elseif (NdChar <= 130000000.0) tmp = Float64(0.5 * NaChar); else tmp = Float64(0.5 * NdChar); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if (NdChar <= -3.8e-52) tmp = 0.5 * NdChar; elseif (NdChar <= 130000000.0) tmp = 0.5 * NaChar; else tmp = 0.5 * NdChar; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[NdChar, -3.8e-52], N[(0.5 * NdChar), $MachinePrecision], If[LessEqual[NdChar, 130000000.0], N[(0.5 * NaChar), $MachinePrecision], N[(0.5 * NdChar), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;NdChar \leq -3.8 \cdot 10^{-52}:\\
\;\;\;\;0.5 \cdot NdChar\\
\mathbf{elif}\;NdChar \leq 130000000:\\
\;\;\;\;0.5 \cdot NaChar\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot NdChar\\
\end{array}
\end{array}
if NdChar < -3.8000000000000003e-52 or 1.3e8 < NdChar Initial program 100.0%
Taylor expanded in NaChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6473.4
Applied rewrites73.4%
Taylor expanded in KbT around inf
Applied rewrites24.6%
if -3.8000000000000003e-52 < NdChar < 1.3e8Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6429.3
Applied rewrites29.3%
Taylor expanded in NaChar around inf
Applied rewrites27.7%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (* (+ NaChar NdChar) 0.5))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return (NaChar + NdChar) * 0.5;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
code = (nachar + ndchar) * 0.5d0
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return (NaChar + NdChar) * 0.5;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): return (NaChar + NdChar) * 0.5
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) return Float64(Float64(NaChar + NdChar) * 0.5) end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = (NaChar + NdChar) * 0.5; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(N[(NaChar + NdChar), $MachinePrecision] * 0.5), $MachinePrecision]
\begin{array}{l}
\\
\left(NaChar + NdChar\right) \cdot 0.5
\end{array}
Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6428.2
Applied rewrites28.2%
Final simplification28.2%
(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.2
Applied rewrites28.2%
Taylor expanded in NaChar around inf
Applied rewrites19.1%
herbie shell --seed 2024278
(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))))))