
(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 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (+ (/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT)))) (/ NaChar (+ 1.0 (exp (/ (+ (+ (+ Ev Vef) EAccept) (- mu)) KbT))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) + -mu) / KbT))));
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
code = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + (nachar / (1.0d0 + exp(((((ev + vef) + eaccept) + -mu) / kbt))))
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) + -mu) / KbT))));
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): return (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) + -mu) / KbT))))
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) return Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) + Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) + Float64(-mu)) / KbT))))) end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) + -mu) / KbT)))); end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(N[(NdChar / N[(1.0 + N[Exp[N[((-N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision]) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] + (-mu)), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) + \left(-mu\right)}{KbT}}}
\end{array}
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (- (/ NdChar (+ 1.0 (exp (/ (+ Vef (+ mu (- EDonor Ec))) KbT)))) (/ NaChar (- -1.0 (exp (/ (+ Vef (+ EAccept (- Ev 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(((Vef + (mu + (EDonor - Ec))) / KbT)))) - (NaChar / (-1.0 - exp(((Vef + (EAccept + (Ev - 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(((vef + (mu + (edonor - ec))) / kbt)))) - (nachar / ((-1.0d0) - exp(((vef + (eaccept + (ev - 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(((Vef + (mu + (EDonor - Ec))) / KbT)))) - (NaChar / (-1.0 - Math.exp(((Vef + (EAccept + (Ev - mu))) / KbT))));
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): return (NdChar / (1.0 + math.exp(((Vef + (mu + (EDonor - Ec))) / KbT)))) - (NaChar / (-1.0 - math.exp(((Vef + (EAccept + (Ev - mu))) / KbT))))
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) return Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Vef + Float64(mu + Float64(EDonor - Ec))) / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Vef + Float64(EAccept + Float64(Ev - mu))) / KbT))))) end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = (NdChar / (1.0 + exp(((Vef + (mu + (EDonor - Ec))) / KbT)))) - (NaChar / (-1.0 - exp(((Vef + (EAccept + (Ev - mu))) / KbT)))); end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(Vef + N[(mu + N[(EDonor - Ec), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(Vef + N[(EAccept + N[(Ev - mu), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{NdChar}{1 + e^{\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}}}
\end{array}
Initial program 100.0%
Simplified100.0%
Final simplification100.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0
(+
(/ NdChar (+ 1.0 (exp (/ (+ Vef (+ mu (- EDonor Ec))) KbT))))
(/ NaChar (+ 1.0 (exp (/ Vef KbT)))))))
(if (<= Vef -3.2e+148)
t_0
(if (<= Vef 1.5e+92)
(+
(/ NdChar (+ 1.0 (exp (/ EDonor KbT))))
(/
NaChar
(+ 1.0 (pow (* E E) (/ (+ Vef (- (+ EAccept Ev) mu)) (* KbT 2.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(((Vef + (mu + (EDonor - Ec))) / KbT)))) + (NaChar / (1.0 + exp((Vef / KbT))));
double tmp;
if (Vef <= -3.2e+148) {
tmp = t_0;
} else if (Vef <= 1.5e+92) {
tmp = (NdChar / (1.0 + exp((EDonor / KbT)))) + (NaChar / (1.0 + pow((((double) M_E) * ((double) M_E)), ((Vef + ((EAccept + Ev) - mu)) / (KbT * 2.0)))));
} else {
tmp = t_0;
}
return tmp;
}
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(((Vef + (mu + (EDonor - Ec))) / KbT)))) + (NaChar / (1.0 + Math.exp((Vef / KbT))));
double tmp;
if (Vef <= -3.2e+148) {
tmp = t_0;
} else if (Vef <= 1.5e+92) {
tmp = (NdChar / (1.0 + Math.exp((EDonor / KbT)))) + (NaChar / (1.0 + Math.pow((Math.E * Math.E), ((Vef + ((EAccept + Ev) - mu)) / (KbT * 2.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(((Vef + (mu + (EDonor - Ec))) / KbT)))) + (NaChar / (1.0 + math.exp((Vef / KbT)))) tmp = 0 if Vef <= -3.2e+148: tmp = t_0 elif Vef <= 1.5e+92: tmp = (NdChar / (1.0 + math.exp((EDonor / KbT)))) + (NaChar / (1.0 + math.pow((math.e * math.e), ((Vef + ((EAccept + Ev) - mu)) / (KbT * 2.0))))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Vef + Float64(mu + Float64(EDonor - Ec))) / KbT)))) + Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT))))) tmp = 0.0 if (Vef <= -3.2e+148) tmp = t_0; elseif (Vef <= 1.5e+92) tmp = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT)))) + Float64(NaChar / Float64(1.0 + (Float64(exp(1) * exp(1)) ^ Float64(Float64(Vef + Float64(Float64(EAccept + Ev) - mu)) / Float64(KbT * 2.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(((Vef + (mu + (EDonor - Ec))) / KbT)))) + (NaChar / (1.0 + exp((Vef / KbT)))); tmp = 0.0; if (Vef <= -3.2e+148) tmp = t_0; elseif (Vef <= 1.5e+92) tmp = (NdChar / (1.0 + exp((EDonor / KbT)))) + (NaChar / (1.0 + ((2.71828182845904523536 * 2.71828182845904523536) ^ ((Vef + ((EAccept + Ev) - mu)) / (KbT * 2.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[(NdChar / N[(1.0 + N[Exp[N[(N[(Vef + N[(mu + N[(EDonor - Ec), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Vef, -3.2e+148], t$95$0, If[LessEqual[Vef, 1.5e+92], N[(N[(NdChar / N[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Power[N[(E * E), $MachinePrecision], N[(N[(Vef + N[(N[(EAccept + Ev), $MachinePrecision] - mu), $MachinePrecision]), $MachinePrecision] / N[(KbT * 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\
\mathbf{if}\;Vef \leq -3.2 \cdot 10^{+148}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;Vef \leq 1.5 \cdot 10^{+92}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} + \frac{NaChar}{1 + {\left(e \cdot e\right)}^{\left(\frac{Vef + \left(\left(EAccept + Ev\right) - mu\right)}{KbT \cdot 2}\right)}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if Vef < -3.1999999999999999e148 or 1.50000000000000007e92 < Vef Initial program 100.0%
Simplified100.0%
Taylor expanded in Vef around inf
/-lowering-/.f6488.4%
Simplified88.4%
if -3.1999999999999999e148 < Vef < 1.50000000000000007e92Initial program 99.9%
Simplified99.9%
Taylor expanded in EDonor around inf
/-lowering-/.f6476.5%
Simplified76.5%
clear-numN/A
div-invN/A
clear-numN/A
exp-prodN/A
pow-lowering-pow.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
--lowering--.f6476.5%
Applied egg-rr76.5%
sqr-powN/A
pow-prod-downN/A
pow-lowering-pow.f64N/A
*-lowering-*.f64N/A
exp-1-eN/A
E-lowering-E.f64N/A
exp-1-eN/A
E-lowering-E.f64N/A
associate-/l/N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
associate-+r-N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
*-lowering-*.f6476.6%
Applied egg-rr76.6%
Final simplification80.3%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0
(+
(/ NdChar (+ 1.0 (exp (/ (+ Vef (+ mu (- EDonor Ec))) KbT))))
(/ NaChar (+ 1.0 (exp (/ Vef KbT)))))))
(if (<= Vef -2.1e+145)
t_0
(if (<= Vef 2.65e+91)
(-
(/ NdChar (+ 1.0 (exp (/ EDonor KbT))))
(/ NaChar (- -1.0 (exp (/ (+ Vef (+ EAccept (- Ev mu))) KbT)))))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NdChar / (1.0 + exp(((Vef + (mu + (EDonor - Ec))) / KbT)))) + (NaChar / (1.0 + exp((Vef / KbT))));
double tmp;
if (Vef <= -2.1e+145) {
tmp = t_0;
} else if (Vef <= 2.65e+91) {
tmp = (NdChar / (1.0 + exp((EDonor / KbT)))) - (NaChar / (-1.0 - exp(((Vef + (EAccept + (Ev - mu))) / KbT))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = (ndchar / (1.0d0 + exp(((vef + (mu + (edonor - ec))) / kbt)))) + (nachar / (1.0d0 + exp((vef / kbt))))
if (vef <= (-2.1d+145)) then
tmp = t_0
else if (vef <= 2.65d+91) then
tmp = (ndchar / (1.0d0 + exp((edonor / kbt)))) - (nachar / ((-1.0d0) - exp(((vef + (eaccept + (ev - mu))) / kbt))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NdChar / (1.0 + Math.exp(((Vef + (mu + (EDonor - Ec))) / KbT)))) + (NaChar / (1.0 + Math.exp((Vef / KbT))));
double tmp;
if (Vef <= -2.1e+145) {
tmp = t_0;
} else if (Vef <= 2.65e+91) {
tmp = (NdChar / (1.0 + Math.exp((EDonor / KbT)))) - (NaChar / (-1.0 - Math.exp(((Vef + (EAccept + (Ev - mu))) / KbT))));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NdChar / (1.0 + math.exp(((Vef + (mu + (EDonor - Ec))) / KbT)))) + (NaChar / (1.0 + math.exp((Vef / KbT)))) tmp = 0 if Vef <= -2.1e+145: tmp = t_0 elif Vef <= 2.65e+91: tmp = (NdChar / (1.0 + math.exp((EDonor / KbT)))) - (NaChar / (-1.0 - math.exp(((Vef + (EAccept + (Ev - mu))) / KbT)))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Vef + Float64(mu + Float64(EDonor - Ec))) / KbT)))) + Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT))))) tmp = 0.0 if (Vef <= -2.1e+145) tmp = t_0; elseif (Vef <= 2.65e+91) tmp = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Vef + Float64(EAccept + Float64(Ev - mu))) / KbT))))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NdChar / (1.0 + exp(((Vef + (mu + (EDonor - Ec))) / KbT)))) + (NaChar / (1.0 + exp((Vef / KbT)))); tmp = 0.0; if (Vef <= -2.1e+145) tmp = t_0; elseif (Vef <= 2.65e+91) tmp = (NdChar / (1.0 + exp((EDonor / KbT)))) - (NaChar / (-1.0 - exp(((Vef + (EAccept + (Ev - mu))) / KbT)))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NdChar / N[(1.0 + N[Exp[N[(N[(Vef + N[(mu + N[(EDonor - Ec), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Vef, -2.1e+145], t$95$0, If[LessEqual[Vef, 2.65e+91], N[(N[(NdChar / N[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(Vef + N[(EAccept + N[(Ev - mu), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{Vef + \left(mu + \left(EDonor - Ec\right)\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\
\mathbf{if}\;Vef \leq -2.1 \cdot 10^{+145}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;Vef \leq 2.65 \cdot 10^{+91}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if Vef < -2.09999999999999989e145 or 2.64999999999999998e91 < Vef Initial program 100.0%
Simplified100.0%
Taylor expanded in Vef around inf
/-lowering-/.f6488.4%
Simplified88.4%
if -2.09999999999999989e145 < Vef < 2.64999999999999998e91Initial program 99.9%
Simplified99.9%
Taylor expanded in EDonor around inf
/-lowering-/.f6476.5%
Simplified76.5%
Final simplification80.3%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0
(-
(/ NaChar (+ 1.0 (exp (/ Vef KbT))))
(/ NdChar (- -1.0 (exp (/ (- (+ Vef EDonor) Ec) KbT)))))))
(if (<= Vef -1.1e+151)
t_0
(if (<= Vef 2.3e+93)
(-
(/ NdChar (+ 1.0 (exp (/ EDonor KbT))))
(/ NaChar (- -1.0 (exp (/ (+ Vef (+ EAccept (- Ev mu))) KbT)))))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar / (1.0 + exp((Vef / KbT)))) - (NdChar / (-1.0 - exp((((Vef + EDonor) - Ec) / KbT))));
double tmp;
if (Vef <= -1.1e+151) {
tmp = t_0;
} else if (Vef <= 2.3e+93) {
tmp = (NdChar / (1.0 + exp((EDonor / KbT)))) - (NaChar / (-1.0 - exp(((Vef + (EAccept + (Ev - mu))) / KbT))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = (nachar / (1.0d0 + exp((vef / kbt)))) - (ndchar / ((-1.0d0) - exp((((vef + edonor) - ec) / kbt))))
if (vef <= (-1.1d+151)) then
tmp = t_0
else if (vef <= 2.3d+93) then
tmp = (ndchar / (1.0d0 + exp((edonor / kbt)))) - (nachar / ((-1.0d0) - exp(((vef + (eaccept + (ev - mu))) / kbt))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NaChar / (1.0 + Math.exp((Vef / KbT)))) - (NdChar / (-1.0 - Math.exp((((Vef + EDonor) - Ec) / KbT))));
double tmp;
if (Vef <= -1.1e+151) {
tmp = t_0;
} else if (Vef <= 2.3e+93) {
tmp = (NdChar / (1.0 + Math.exp((EDonor / KbT)))) - (NaChar / (-1.0 - Math.exp(((Vef + (EAccept + (Ev - mu))) / KbT))));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NaChar / (1.0 + math.exp((Vef / KbT)))) - (NdChar / (-1.0 - math.exp((((Vef + EDonor) - Ec) / KbT)))) tmp = 0 if Vef <= -1.1e+151: tmp = t_0 elif Vef <= 2.3e+93: tmp = (NdChar / (1.0 + math.exp((EDonor / KbT)))) - (NaChar / (-1.0 - math.exp(((Vef + (EAccept + (Ev - mu))) / KbT)))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT)))) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(Float64(Vef + EDonor) - Ec) / KbT))))) tmp = 0.0 if (Vef <= -1.1e+151) tmp = t_0; elseif (Vef <= 2.3e+93) tmp = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT)))) - Float64(NaChar / Float64(-1.0 - exp(Float64(Float64(Vef + Float64(EAccept + Float64(Ev - mu))) / KbT))))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NaChar / (1.0 + exp((Vef / KbT)))) - (NdChar / (-1.0 - exp((((Vef + EDonor) - Ec) / KbT)))); tmp = 0.0; if (Vef <= -1.1e+151) tmp = t_0; elseif (Vef <= 2.3e+93) tmp = (NdChar / (1.0 + exp((EDonor / KbT)))) - (NaChar / (-1.0 - exp(((Vef + (EAccept + (Ev - mu))) / KbT)))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - N[Exp[N[(N[(N[(Vef + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Vef, -1.1e+151], t$95$0, If[LessEqual[Vef, 2.3e+93], N[(N[(NdChar / N[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NaChar / N[(-1.0 - N[Exp[N[(N[(Vef + N[(EAccept + N[(Ev - mu), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{\left(Vef + EDonor\right) - Ec}{KbT}}}\\
\mathbf{if}\;Vef \leq -1.1 \cdot 10^{+151}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;Vef \leq 2.3 \cdot 10^{+93}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}} - \frac{NaChar}{-1 - e^{\frac{Vef + \left(EAccept + \left(Ev - mu\right)\right)}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if Vef < -1.10000000000000003e151 or 2.3000000000000002e93 < Vef Initial program 100.0%
Simplified100.0%
Taylor expanded in Vef around inf
/-lowering-/.f6488.4%
Simplified88.4%
Taylor expanded in mu around 0
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f6483.4%
Simplified83.4%
if -1.10000000000000003e151 < Vef < 2.3000000000000002e93Initial program 99.9%
Simplified99.9%
Taylor expanded in EDonor around inf
/-lowering-/.f6476.5%
Simplified76.5%
Final simplification78.7%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NaChar (+ 1.0 (exp (/ (+ (+ EAccept Ev) (- Vef mu)) KbT))))))
(if (<= mu -2.75e+157)
t_0
(if (<= mu 2.6e+32)
(-
(/ NaChar (+ 1.0 (exp (/ Vef KbT))))
(/ NdChar (- -1.0 (exp (/ (- (+ Vef EDonor) Ec) KbT)))))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (1.0 + exp((((EAccept + Ev) + (Vef - mu)) / KbT)));
double tmp;
if (mu <= -2.75e+157) {
tmp = t_0;
} else if (mu <= 2.6e+32) {
tmp = (NaChar / (1.0 + exp((Vef / KbT)))) - (NdChar / (-1.0 - exp((((Vef + EDonor) - Ec) / KbT))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = nachar / (1.0d0 + exp((((eaccept + ev) + (vef - mu)) / kbt)))
if (mu <= (-2.75d+157)) then
tmp = t_0
else if (mu <= 2.6d+32) then
tmp = (nachar / (1.0d0 + exp((vef / kbt)))) - (ndchar / ((-1.0d0) - exp((((vef + edonor) - ec) / kbt))))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (1.0 + Math.exp((((EAccept + Ev) + (Vef - mu)) / KbT)));
double tmp;
if (mu <= -2.75e+157) {
tmp = t_0;
} else if (mu <= 2.6e+32) {
tmp = (NaChar / (1.0 + Math.exp((Vef / KbT)))) - (NdChar / (-1.0 - Math.exp((((Vef + EDonor) - Ec) / KbT))));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NaChar / (1.0 + math.exp((((EAccept + Ev) + (Vef - mu)) / KbT))) tmp = 0 if mu <= -2.75e+157: tmp = t_0 elif mu <= 2.6e+32: tmp = (NaChar / (1.0 + math.exp((Vef / KbT)))) - (NdChar / (-1.0 - math.exp((((Vef + EDonor) - Ec) / KbT)))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(EAccept + Ev) + Float64(Vef - mu)) / KbT)))) tmp = 0.0 if (mu <= -2.75e+157) tmp = t_0; elseif (mu <= 2.6e+32) tmp = Float64(Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT)))) - Float64(NdChar / Float64(-1.0 - exp(Float64(Float64(Float64(Vef + EDonor) - Ec) / KbT))))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NaChar / (1.0 + exp((((EAccept + Ev) + (Vef - mu)) / KbT))); tmp = 0.0; if (mu <= -2.75e+157) tmp = t_0; elseif (mu <= 2.6e+32) tmp = (NaChar / (1.0 + exp((Vef / KbT)))) - (NdChar / (-1.0 - exp((((Vef + EDonor) - Ec) / KbT)))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(EAccept + Ev), $MachinePrecision] + N[(Vef - mu), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[mu, -2.75e+157], t$95$0, If[LessEqual[mu, 2.6e+32], N[(N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(NdChar / N[(-1.0 - N[Exp[N[(N[(N[(Vef + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) + \left(Vef - mu\right)}{KbT}}}\\
\mathbf{if}\;mu \leq -2.75 \cdot 10^{+157}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;mu \leq 2.6 \cdot 10^{+32}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}} - \frac{NdChar}{-1 - e^{\frac{\left(Vef + EDonor\right) - Ec}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if mu < -2.7500000000000001e157 or 2.6000000000000002e32 < mu Initial program 99.9%
Simplified99.9%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6465.6%
Simplified65.6%
if -2.7500000000000001e157 < mu < 2.6000000000000002e32Initial program 100.0%
Simplified100.0%
Taylor expanded in Vef around inf
/-lowering-/.f6477.5%
Simplified77.5%
Taylor expanded in mu around 0
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f6477.4%
Simplified77.4%
Final simplification72.5%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (+ 1.0 (exp (/ EDonor KbT)))))
(t_1 (/ NaChar (+ 1.0 (exp (/ mu (- 0.0 KbT)))))))
(if (<= mu -2.22e+142)
t_1
(if (<= mu -9.2e-130)
t_0
(if (<= mu 5.2e-117)
(/ NaChar (+ 1.0 (exp (/ Vef KbT))))
(if (<= mu 2.6e+32) t_0 t_1))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + exp((EDonor / KbT)));
double t_1 = NaChar / (1.0 + exp((mu / (0.0 - KbT))));
double tmp;
if (mu <= -2.22e+142) {
tmp = t_1;
} else if (mu <= -9.2e-130) {
tmp = t_0;
} else if (mu <= 5.2e-117) {
tmp = NaChar / (1.0 + exp((Vef / KbT)));
} else if (mu <= 2.6e+32) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = ndchar / (1.0d0 + exp((edonor / kbt)))
t_1 = nachar / (1.0d0 + exp((mu / (0.0d0 - kbt))))
if (mu <= (-2.22d+142)) then
tmp = t_1
else if (mu <= (-9.2d-130)) then
tmp = t_0
else if (mu <= 5.2d-117) then
tmp = nachar / (1.0d0 + exp((vef / kbt)))
else if (mu <= 2.6d+32) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + Math.exp((EDonor / KbT)));
double t_1 = NaChar / (1.0 + Math.exp((mu / (0.0 - KbT))));
double tmp;
if (mu <= -2.22e+142) {
tmp = t_1;
} else if (mu <= -9.2e-130) {
tmp = t_0;
} else if (mu <= 5.2e-117) {
tmp = NaChar / (1.0 + Math.exp((Vef / KbT)));
} else if (mu <= 2.6e+32) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NdChar / (1.0 + math.exp((EDonor / KbT))) t_1 = NaChar / (1.0 + math.exp((mu / (0.0 - KbT)))) tmp = 0 if mu <= -2.22e+142: tmp = t_1 elif mu <= -9.2e-130: tmp = t_0 elif mu <= 5.2e-117: tmp = NaChar / (1.0 + math.exp((Vef / KbT))) elif mu <= 2.6e+32: tmp = t_0 else: tmp = t_1 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT)))) t_1 = Float64(NaChar / Float64(1.0 + exp(Float64(mu / Float64(0.0 - KbT))))) tmp = 0.0 if (mu <= -2.22e+142) tmp = t_1; elseif (mu <= -9.2e-130) tmp = t_0; elseif (mu <= 5.2e-117) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT)))); elseif (mu <= 2.6e+32) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NdChar / (1.0 + exp((EDonor / KbT))); t_1 = NaChar / (1.0 + exp((mu / (0.0 - KbT)))); tmp = 0.0; if (mu <= -2.22e+142) tmp = t_1; elseif (mu <= -9.2e-130) tmp = t_0; elseif (mu <= 5.2e-117) tmp = NaChar / (1.0 + exp((Vef / KbT))); elseif (mu <= 2.6e+32) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(NaChar / N[(1.0 + N[Exp[N[(mu / N[(0.0 - KbT), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[mu, -2.22e+142], t$95$1, If[LessEqual[mu, -9.2e-130], t$95$0, If[LessEqual[mu, 5.2e-117], N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[mu, 2.6e+32], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\
t_1 := \frac{NaChar}{1 + e^{\frac{mu}{0 - KbT}}}\\
\mathbf{if}\;mu \leq -2.22 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;mu \leq -9.2 \cdot 10^{-130}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;mu \leq 5.2 \cdot 10^{-117}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\
\mathbf{elif}\;mu \leq 2.6 \cdot 10^{+32}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if mu < -2.2199999999999999e142 or 2.6000000000000002e32 < mu Initial program 99.9%
Simplified99.9%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6466.2%
Simplified66.2%
Taylor expanded in mu around inf
*-lowering-*.f64N/A
/-lowering-/.f6452.4%
Simplified52.4%
if -2.2199999999999999e142 < mu < -9.2000000000000005e-130 or 5.19999999999999966e-117 < mu < 2.6000000000000002e32Initial program 100.0%
Simplified100.0%
Taylor expanded in EDonor around inf
/-lowering-/.f6477.0%
Simplified77.0%
Taylor expanded in NdChar around inf
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f6452.7%
Simplified52.7%
if -9.2000000000000005e-130 < mu < 5.19999999999999966e-117Initial program 100.0%
Simplified100.0%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6469.8%
Simplified69.8%
Taylor expanded in Vef around inf
/-lowering-/.f6454.3%
Simplified54.3%
Final simplification53.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NaChar (+ 1.0 (exp (/ Vef KbT)))))
(t_1 (/ NdChar (+ 1.0 (exp (/ EDonor KbT))))))
(if (<= Ev -9.4e+120)
(/ NaChar (+ 1.0 (exp (/ Ev KbT))))
(if (<= Ev -0.0148)
t_0
(if (<= Ev -3.7e-72) t_1 (if (<= Ev 3.25e-293) t_0 t_1))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (1.0 + exp((Vef / KbT)));
double t_1 = NdChar / (1.0 + exp((EDonor / KbT)));
double tmp;
if (Ev <= -9.4e+120) {
tmp = NaChar / (1.0 + exp((Ev / KbT)));
} else if (Ev <= -0.0148) {
tmp = t_0;
} else if (Ev <= -3.7e-72) {
tmp = t_1;
} else if (Ev <= 3.25e-293) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = nachar / (1.0d0 + exp((vef / kbt)))
t_1 = ndchar / (1.0d0 + exp((edonor / kbt)))
if (ev <= (-9.4d+120)) then
tmp = nachar / (1.0d0 + exp((ev / kbt)))
else if (ev <= (-0.0148d0)) then
tmp = t_0
else if (ev <= (-3.7d-72)) then
tmp = t_1
else if (ev <= 3.25d-293) then
tmp = t_0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (1.0 + Math.exp((Vef / KbT)));
double t_1 = NdChar / (1.0 + Math.exp((EDonor / KbT)));
double tmp;
if (Ev <= -9.4e+120) {
tmp = NaChar / (1.0 + Math.exp((Ev / KbT)));
} else if (Ev <= -0.0148) {
tmp = t_0;
} else if (Ev <= -3.7e-72) {
tmp = t_1;
} else if (Ev <= 3.25e-293) {
tmp = t_0;
} else {
tmp = t_1;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NaChar / (1.0 + math.exp((Vef / KbT))) t_1 = NdChar / (1.0 + math.exp((EDonor / KbT))) tmp = 0 if Ev <= -9.4e+120: tmp = NaChar / (1.0 + math.exp((Ev / KbT))) elif Ev <= -0.0148: tmp = t_0 elif Ev <= -3.7e-72: tmp = t_1 elif Ev <= 3.25e-293: tmp = t_0 else: tmp = t_1 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT)))) t_1 = Float64(NdChar / Float64(1.0 + exp(Float64(EDonor / KbT)))) tmp = 0.0 if (Ev <= -9.4e+120) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(Ev / KbT)))); elseif (Ev <= -0.0148) tmp = t_0; elseif (Ev <= -3.7e-72) tmp = t_1; elseif (Ev <= 3.25e-293) tmp = t_0; else tmp = t_1; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NaChar / (1.0 + exp((Vef / KbT))); t_1 = NdChar / (1.0 + exp((EDonor / KbT))); tmp = 0.0; if (Ev <= -9.4e+120) tmp = NaChar / (1.0 + exp((Ev / KbT))); elseif (Ev <= -0.0148) tmp = t_0; elseif (Ev <= -3.7e-72) tmp = t_1; elseif (Ev <= 3.25e-293) tmp = t_0; else tmp = t_1; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(NdChar / N[(1.0 + N[Exp[N[(EDonor / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Ev, -9.4e+120], N[(NaChar / N[(1.0 + N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[Ev, -0.0148], t$95$0, If[LessEqual[Ev, -3.7e-72], t$95$1, If[LessEqual[Ev, 3.25e-293], t$95$0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\
t_1 := \frac{NdChar}{1 + e^{\frac{EDonor}{KbT}}}\\
\mathbf{if}\;Ev \leq -9.4 \cdot 10^{+120}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{KbT}}}\\
\mathbf{elif}\;Ev \leq -0.0148:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;Ev \leq -3.7 \cdot 10^{-72}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;Ev \leq 3.25 \cdot 10^{-293}:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if Ev < -9.39999999999999987e120Initial program 100.0%
Simplified100.0%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6449.8%
Simplified49.8%
Taylor expanded in Ev around inf
/-lowering-/.f6439.0%
Simplified39.0%
if -9.39999999999999987e120 < Ev < -0.014800000000000001 or -3.6999999999999998e-72 < Ev < 3.25000000000000017e-293Initial program 99.9%
Simplified99.9%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6478.5%
Simplified78.5%
Taylor expanded in Vef around inf
/-lowering-/.f6457.8%
Simplified57.8%
if -0.014800000000000001 < Ev < -3.6999999999999998e-72 or 3.25000000000000017e-293 < Ev Initial program 100.0%
Simplified100.0%
Taylor expanded in EDonor around inf
/-lowering-/.f6467.6%
Simplified67.6%
Taylor expanded in NdChar around inf
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f6438.4%
Simplified38.4%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NaChar (+ 1.0 (exp (/ (+ (+ EAccept Ev) (- Vef mu)) KbT))))))
(if (<= NaChar -1.35e-107)
t_0
(if (<= NaChar 1.7e-81)
(/ NdChar (+ 1.0 (exp (/ (+ (+ Vef EDonor) (- mu Ec)) KbT))))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (1.0 + exp((((EAccept + Ev) + (Vef - mu)) / KbT)));
double tmp;
if (NaChar <= -1.35e-107) {
tmp = t_0;
} else if (NaChar <= 1.7e-81) {
tmp = NdChar / (1.0 + exp((((Vef + EDonor) + (mu - Ec)) / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = nachar / (1.0d0 + exp((((eaccept + ev) + (vef - mu)) / kbt)))
if (nachar <= (-1.35d-107)) then
tmp = t_0
else if (nachar <= 1.7d-81) then
tmp = ndchar / (1.0d0 + exp((((vef + edonor) + (mu - ec)) / kbt)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (1.0 + Math.exp((((EAccept + Ev) + (Vef - mu)) / KbT)));
double tmp;
if (NaChar <= -1.35e-107) {
tmp = t_0;
} else if (NaChar <= 1.7e-81) {
tmp = NdChar / (1.0 + Math.exp((((Vef + EDonor) + (mu - Ec)) / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NaChar / (1.0 + math.exp((((EAccept + Ev) + (Vef - mu)) / KbT))) tmp = 0 if NaChar <= -1.35e-107: tmp = t_0 elif NaChar <= 1.7e-81: tmp = NdChar / (1.0 + math.exp((((Vef + EDonor) + (mu - Ec)) / KbT))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(EAccept + Ev) + Float64(Vef - mu)) / KbT)))) tmp = 0.0 if (NaChar <= -1.35e-107) tmp = t_0; elseif (NaChar <= 1.7e-81) tmp = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(Float64(Vef + EDonor) + Float64(mu - Ec)) / KbT)))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NaChar / (1.0 + exp((((EAccept + Ev) + (Vef - mu)) / KbT))); tmp = 0.0; if (NaChar <= -1.35e-107) tmp = t_0; elseif (NaChar <= 1.7e-81) tmp = NdChar / (1.0 + exp((((Vef + EDonor) + (mu - Ec)) / KbT))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(EAccept + Ev), $MachinePrecision] + N[(Vef - mu), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[NaChar, -1.35e-107], t$95$0, If[LessEqual[NaChar, 1.7e-81], N[(NdChar / N[(1.0 + N[Exp[N[(N[(N[(Vef + EDonor), $MachinePrecision] + N[(mu - Ec), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) + \left(Vef - mu\right)}{KbT}}}\\
\mathbf{if}\;NaChar \leq -1.35 \cdot 10^{-107}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;NaChar \leq 1.7 \cdot 10^{-81}:\\
\;\;\;\;\frac{NdChar}{1 + e^{\frac{\left(Vef + EDonor\right) + \left(mu - Ec\right)}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if NaChar < -1.35e-107 or 1.6999999999999999e-81 < NaChar Initial program 99.9%
Simplified99.9%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6471.6%
Simplified71.6%
if -1.35e-107 < NaChar < 1.6999999999999999e-81Initial program 100.0%
Simplified100.0%
Taylor expanded in NdChar around inf
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6473.6%
Simplified73.6%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(if (<= KbT -2.8e+191)
(* 0.5 (+ NdChar NaChar))
(if (<= KbT 2e+205)
(/ NaChar (+ 1.0 (exp (/ (+ (+ EAccept Ev) (- Vef mu)) KbT))))
(+ (/ NdChar 2.0) (/ NaChar (+ 1.0 (exp (/ mu (- 0.0 KbT)))))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (KbT <= -2.8e+191) {
tmp = 0.5 * (NdChar + NaChar);
} else if (KbT <= 2e+205) {
tmp = NaChar / (1.0 + exp((((EAccept + Ev) + (Vef - mu)) / KbT)));
} else {
tmp = (NdChar / 2.0) + (NaChar / (1.0 + exp((mu / (0.0 - 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 (kbt <= (-2.8d+191)) then
tmp = 0.5d0 * (ndchar + nachar)
else if (kbt <= 2d+205) then
tmp = nachar / (1.0d0 + exp((((eaccept + ev) + (vef - mu)) / kbt)))
else
tmp = (ndchar / 2.0d0) + (nachar / (1.0d0 + exp((mu / (0.0d0 - 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 (KbT <= -2.8e+191) {
tmp = 0.5 * (NdChar + NaChar);
} else if (KbT <= 2e+205) {
tmp = NaChar / (1.0 + Math.exp((((EAccept + Ev) + (Vef - mu)) / KbT)));
} else {
tmp = (NdChar / 2.0) + (NaChar / (1.0 + Math.exp((mu / (0.0 - KbT)))));
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if KbT <= -2.8e+191: tmp = 0.5 * (NdChar + NaChar) elif KbT <= 2e+205: tmp = NaChar / (1.0 + math.exp((((EAccept + Ev) + (Vef - mu)) / KbT))) else: tmp = (NdChar / 2.0) + (NaChar / (1.0 + math.exp((mu / (0.0 - KbT))))) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (KbT <= -2.8e+191) tmp = Float64(0.5 * Float64(NdChar + NaChar)); elseif (KbT <= 2e+205) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(EAccept + Ev) + Float64(Vef - mu)) / KbT)))); else tmp = Float64(Float64(NdChar / 2.0) + Float64(NaChar / Float64(1.0 + exp(Float64(mu / Float64(0.0 - KbT)))))); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if (KbT <= -2.8e+191) tmp = 0.5 * (NdChar + NaChar); elseif (KbT <= 2e+205) tmp = NaChar / (1.0 + exp((((EAccept + Ev) + (Vef - mu)) / KbT))); else tmp = (NdChar / 2.0) + (NaChar / (1.0 + exp((mu / (0.0 - KbT))))); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[KbT, -2.8e+191], N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 2e+205], N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(EAccept + Ev), $MachinePrecision] + N[(Vef - mu), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(NdChar / 2.0), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(mu / N[(0.0 - KbT), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;KbT \leq -2.8 \cdot 10^{+191}:\\
\;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\
\mathbf{elif}\;KbT \leq 2 \cdot 10^{+205}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{\left(EAccept + Ev\right) + \left(Vef - mu\right)}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{2} + \frac{NaChar}{1 + e^{\frac{mu}{0 - KbT}}}\\
\end{array}
\end{array}
if KbT < -2.7999999999999999e191Initial program 99.9%
Simplified99.9%
Taylor expanded in KbT around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6484.5%
Simplified84.5%
if -2.7999999999999999e191 < KbT < 2.00000000000000003e205Initial program 100.0%
Simplified100.0%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6467.3%
Simplified67.3%
if 2.00000000000000003e205 < KbT Initial program 100.0%
Simplified100.0%
Taylor expanded in KbT around inf
Simplified62.2%
Taylor expanded in mu around inf
*-lowering-*.f64N/A
/-lowering-/.f6458.2%
Simplified58.2%
Final simplification68.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NaChar (+ 1.0 (exp (/ Vef KbT))))))
(if (<= Vef -1.85e+145)
t_0
(if (<= Vef 2.45e-236)
(+ (/ NdChar 2.0) (/ NaChar (+ 1.0 (exp (/ mu (- 0.0 KbT))))))
(if (<= Vef 6.3e+25) (/ NaChar (+ 1.0 (exp (/ Ev KbT)))) t_0)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (1.0 + exp((Vef / KbT)));
double tmp;
if (Vef <= -1.85e+145) {
tmp = t_0;
} else if (Vef <= 2.45e-236) {
tmp = (NdChar / 2.0) + (NaChar / (1.0 + exp((mu / (0.0 - KbT)))));
} else if (Vef <= 6.3e+25) {
tmp = NaChar / (1.0 + exp((Ev / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = nachar / (1.0d0 + exp((vef / kbt)))
if (vef <= (-1.85d+145)) then
tmp = t_0
else if (vef <= 2.45d-236) then
tmp = (ndchar / 2.0d0) + (nachar / (1.0d0 + exp((mu / (0.0d0 - kbt)))))
else if (vef <= 6.3d+25) then
tmp = nachar / (1.0d0 + exp((ev / kbt)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (1.0 + Math.exp((Vef / KbT)));
double tmp;
if (Vef <= -1.85e+145) {
tmp = t_0;
} else if (Vef <= 2.45e-236) {
tmp = (NdChar / 2.0) + (NaChar / (1.0 + Math.exp((mu / (0.0 - KbT)))));
} else if (Vef <= 6.3e+25) {
tmp = NaChar / (1.0 + Math.exp((Ev / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NaChar / (1.0 + math.exp((Vef / KbT))) tmp = 0 if Vef <= -1.85e+145: tmp = t_0 elif Vef <= 2.45e-236: tmp = (NdChar / 2.0) + (NaChar / (1.0 + math.exp((mu / (0.0 - KbT))))) elif Vef <= 6.3e+25: tmp = NaChar / (1.0 + math.exp((Ev / KbT))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT)))) tmp = 0.0 if (Vef <= -1.85e+145) tmp = t_0; elseif (Vef <= 2.45e-236) tmp = Float64(Float64(NdChar / 2.0) + Float64(NaChar / Float64(1.0 + exp(Float64(mu / Float64(0.0 - KbT)))))); elseif (Vef <= 6.3e+25) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(Ev / KbT)))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NaChar / (1.0 + exp((Vef / KbT))); tmp = 0.0; if (Vef <= -1.85e+145) tmp = t_0; elseif (Vef <= 2.45e-236) tmp = (NdChar / 2.0) + (NaChar / (1.0 + exp((mu / (0.0 - KbT))))); elseif (Vef <= 6.3e+25) tmp = NaChar / (1.0 + exp((Ev / KbT))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Vef, -1.85e+145], t$95$0, If[LessEqual[Vef, 2.45e-236], N[(N[(NdChar / 2.0), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(mu / N[(0.0 - KbT), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[Vef, 6.3e+25], N[(NaChar / N[(1.0 + N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\
\mathbf{if}\;Vef \leq -1.85 \cdot 10^{+145}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;Vef \leq 2.45 \cdot 10^{-236}:\\
\;\;\;\;\frac{NdChar}{2} + \frac{NaChar}{1 + e^{\frac{mu}{0 - KbT}}}\\
\mathbf{elif}\;Vef \leq 6.3 \cdot 10^{+25}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if Vef < -1.84999999999999997e145 or 6.29999999999999973e25 < Vef Initial program 100.0%
Simplified100.0%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6467.5%
Simplified67.5%
Taylor expanded in Vef around inf
/-lowering-/.f6458.7%
Simplified58.7%
if -1.84999999999999997e145 < Vef < 2.4499999999999998e-236Initial program 99.9%
Simplified99.9%
Taylor expanded in KbT around inf
Simplified60.3%
Taylor expanded in mu around inf
*-lowering-*.f64N/A
/-lowering-/.f6450.2%
Simplified50.2%
if 2.4499999999999998e-236 < Vef < 6.29999999999999973e25Initial program 100.0%
Simplified100.0%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6459.7%
Simplified59.7%
Taylor expanded in Ev around inf
/-lowering-/.f6434.5%
Simplified34.5%
Final simplification50.1%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(if (<= KbT -3.5e+148)
(*
0.5
(* (- NaChar NdChar) (* (+ NdChar NaChar) (/ 1.0 (- NaChar NdChar)))))
(if (<= KbT 2.8e-157)
(/ NaChar (+ 1.0 (exp (/ EAccept KbT))))
(if (<= KbT 1.6e+206)
(/ NaChar (+ 1.0 (exp (/ Ev KbT))))
(* 0.5 (+ NdChar NaChar))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (KbT <= -3.5e+148) {
tmp = 0.5 * ((NaChar - NdChar) * ((NdChar + NaChar) * (1.0 / (NaChar - NdChar))));
} else if (KbT <= 2.8e-157) {
tmp = NaChar / (1.0 + exp((EAccept / KbT)));
} else if (KbT <= 1.6e+206) {
tmp = NaChar / (1.0 + exp((Ev / KbT)));
} else {
tmp = 0.5 * (NdChar + NaChar);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: tmp
if (kbt <= (-3.5d+148)) then
tmp = 0.5d0 * ((nachar - ndchar) * ((ndchar + nachar) * (1.0d0 / (nachar - ndchar))))
else if (kbt <= 2.8d-157) then
tmp = nachar / (1.0d0 + exp((eaccept / kbt)))
else if (kbt <= 1.6d+206) then
tmp = nachar / (1.0d0 + exp((ev / kbt)))
else
tmp = 0.5d0 * (ndchar + nachar)
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (KbT <= -3.5e+148) {
tmp = 0.5 * ((NaChar - NdChar) * ((NdChar + NaChar) * (1.0 / (NaChar - NdChar))));
} else if (KbT <= 2.8e-157) {
tmp = NaChar / (1.0 + Math.exp((EAccept / KbT)));
} else if (KbT <= 1.6e+206) {
tmp = NaChar / (1.0 + Math.exp((Ev / KbT)));
} else {
tmp = 0.5 * (NdChar + NaChar);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if KbT <= -3.5e+148: tmp = 0.5 * ((NaChar - NdChar) * ((NdChar + NaChar) * (1.0 / (NaChar - NdChar)))) elif KbT <= 2.8e-157: tmp = NaChar / (1.0 + math.exp((EAccept / KbT))) elif KbT <= 1.6e+206: tmp = NaChar / (1.0 + math.exp((Ev / KbT))) else: tmp = 0.5 * (NdChar + NaChar) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (KbT <= -3.5e+148) tmp = Float64(0.5 * Float64(Float64(NaChar - NdChar) * Float64(Float64(NdChar + NaChar) * Float64(1.0 / Float64(NaChar - NdChar))))); elseif (KbT <= 2.8e-157) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(EAccept / KbT)))); elseif (KbT <= 1.6e+206) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(Ev / KbT)))); else tmp = Float64(0.5 * Float64(NdChar + NaChar)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if (KbT <= -3.5e+148) tmp = 0.5 * ((NaChar - NdChar) * ((NdChar + NaChar) * (1.0 / (NaChar - NdChar)))); elseif (KbT <= 2.8e-157) tmp = NaChar / (1.0 + exp((EAccept / KbT))); elseif (KbT <= 1.6e+206) tmp = NaChar / (1.0 + exp((Ev / KbT))); else tmp = 0.5 * (NdChar + NaChar); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[KbT, -3.5e+148], N[(0.5 * N[(N[(NaChar - NdChar), $MachinePrecision] * N[(N[(NdChar + NaChar), $MachinePrecision] * N[(1.0 / N[(NaChar - NdChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 2.8e-157], N[(NaChar / N[(1.0 + N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 1.6e+206], N[(NaChar / N[(1.0 + N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;KbT \leq -3.5 \cdot 10^{+148}:\\
\;\;\;\;0.5 \cdot \left(\left(NaChar - NdChar\right) \cdot \left(\left(NdChar + NaChar\right) \cdot \frac{1}{NaChar - NdChar}\right)\right)\\
\mathbf{elif}\;KbT \leq 2.8 \cdot 10^{-157}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\
\mathbf{elif}\;KbT \leq 1.6 \cdot 10^{+206}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\
\end{array}
\end{array}
if KbT < -3.4999999999999999e148Initial program 100.0%
Simplified100.0%
Taylor expanded in KbT around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6471.3%
Simplified71.3%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6440.3%
Applied egg-rr40.3%
associate-/r/N/A
difference-of-squaresN/A
flip-+N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
flip-+N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f6471.3%
Applied egg-rr71.3%
if -3.4999999999999999e148 < KbT < 2.8000000000000001e-157Initial program 99.9%
Simplified99.9%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6466.5%
Simplified66.5%
Taylor expanded in EAccept around inf
/-lowering-/.f6439.2%
Simplified39.2%
if 2.8000000000000001e-157 < KbT < 1.60000000000000003e206Initial program 100.0%
Simplified100.0%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6470.8%
Simplified70.8%
Taylor expanded in Ev around inf
/-lowering-/.f6437.9%
Simplified37.9%
if 1.60000000000000003e206 < KbT Initial program 100.0%
Simplified100.0%
Taylor expanded in KbT around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6453.2%
Simplified53.2%
Final simplification44.1%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NaChar (+ 1.0 (exp (/ Vef KbT))))))
(if (<= Vef -1.65e+145)
t_0
(if (<= Vef 9.6e+26) (/ NaChar (+ 1.0 (exp (/ Ev KbT)))) t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (1.0 + exp((Vef / KbT)));
double tmp;
if (Vef <= -1.65e+145) {
tmp = t_0;
} else if (Vef <= 9.6e+26) {
tmp = NaChar / (1.0 + exp((Ev / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = nachar / (1.0d0 + exp((vef / kbt)))
if (vef <= (-1.65d+145)) then
tmp = t_0
else if (vef <= 9.6d+26) then
tmp = nachar / (1.0d0 + exp((ev / kbt)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NaChar / (1.0 + Math.exp((Vef / KbT)));
double tmp;
if (Vef <= -1.65e+145) {
tmp = t_0;
} else if (Vef <= 9.6e+26) {
tmp = NaChar / (1.0 + Math.exp((Ev / KbT)));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NaChar / (1.0 + math.exp((Vef / KbT))) tmp = 0 if Vef <= -1.65e+145: tmp = t_0 elif Vef <= 9.6e+26: tmp = NaChar / (1.0 + math.exp((Ev / KbT))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NaChar / Float64(1.0 + exp(Float64(Vef / KbT)))) tmp = 0.0 if (Vef <= -1.65e+145) tmp = t_0; elseif (Vef <= 9.6e+26) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(Ev / KbT)))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NaChar / (1.0 + exp((Vef / KbT))); tmp = 0.0; if (Vef <= -1.65e+145) tmp = t_0; elseif (Vef <= 9.6e+26) tmp = NaChar / (1.0 + exp((Ev / KbT))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NaChar / N[(1.0 + N[Exp[N[(Vef / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[Vef, -1.65e+145], t$95$0, If[LessEqual[Vef, 9.6e+26], N[(NaChar / N[(1.0 + N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\
\mathbf{if}\;Vef \leq -1.65 \cdot 10^{+145}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;Vef \leq 9.6 \cdot 10^{+26}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{Ev}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if Vef < -1.65000000000000013e145 or 9.60000000000000018e26 < Vef Initial program 100.0%
Simplified100.0%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6467.5%
Simplified67.5%
Taylor expanded in Vef around inf
/-lowering-/.f6458.7%
Simplified58.7%
if -1.65000000000000013e145 < Vef < 9.60000000000000018e26Initial program 99.9%
Simplified99.9%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6460.0%
Simplified60.0%
Taylor expanded in Ev around inf
/-lowering-/.f6438.5%
Simplified38.5%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (+ EAccept (- (+ Vef Ev) mu))))
(if (<= KbT -3.6e+148)
(*
0.5
(* (- NaChar NdChar) (* (+ NdChar NaChar) (/ 1.0 (- NaChar NdChar)))))
(if (<= KbT 2e-170)
(/ NaChar (+ 1.0 (exp (/ EAccept KbT))))
(if (<= KbT 2.9e+97)
(/
NaChar
(+
2.0
(/
(+ t_0 (/ (* -0.5 (* t_0 (- (- mu (+ Vef Ev)) EAccept))) KbT))
KbT)))
(* 0.5 (+ NdChar NaChar)))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = EAccept + ((Vef + Ev) - mu);
double tmp;
if (KbT <= -3.6e+148) {
tmp = 0.5 * ((NaChar - NdChar) * ((NdChar + NaChar) * (1.0 / (NaChar - NdChar))));
} else if (KbT <= 2e-170) {
tmp = NaChar / (1.0 + exp((EAccept / KbT)));
} else if (KbT <= 2.9e+97) {
tmp = NaChar / (2.0 + ((t_0 + ((-0.5 * (t_0 * ((mu - (Vef + Ev)) - EAccept))) / KbT)) / KbT));
} else {
tmp = 0.5 * (NdChar + NaChar);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = eaccept + ((vef + ev) - mu)
if (kbt <= (-3.6d+148)) then
tmp = 0.5d0 * ((nachar - ndchar) * ((ndchar + nachar) * (1.0d0 / (nachar - ndchar))))
else if (kbt <= 2d-170) then
tmp = nachar / (1.0d0 + exp((eaccept / kbt)))
else if (kbt <= 2.9d+97) then
tmp = nachar / (2.0d0 + ((t_0 + (((-0.5d0) * (t_0 * ((mu - (vef + ev)) - eaccept))) / kbt)) / kbt))
else
tmp = 0.5d0 * (ndchar + nachar)
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = EAccept + ((Vef + Ev) - mu);
double tmp;
if (KbT <= -3.6e+148) {
tmp = 0.5 * ((NaChar - NdChar) * ((NdChar + NaChar) * (1.0 / (NaChar - NdChar))));
} else if (KbT <= 2e-170) {
tmp = NaChar / (1.0 + Math.exp((EAccept / KbT)));
} else if (KbT <= 2.9e+97) {
tmp = NaChar / (2.0 + ((t_0 + ((-0.5 * (t_0 * ((mu - (Vef + Ev)) - EAccept))) / KbT)) / KbT));
} else {
tmp = 0.5 * (NdChar + NaChar);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = EAccept + ((Vef + Ev) - mu) tmp = 0 if KbT <= -3.6e+148: tmp = 0.5 * ((NaChar - NdChar) * ((NdChar + NaChar) * (1.0 / (NaChar - NdChar)))) elif KbT <= 2e-170: tmp = NaChar / (1.0 + math.exp((EAccept / KbT))) elif KbT <= 2.9e+97: tmp = NaChar / (2.0 + ((t_0 + ((-0.5 * (t_0 * ((mu - (Vef + Ev)) - EAccept))) / KbT)) / KbT)) else: tmp = 0.5 * (NdChar + NaChar) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(EAccept + Float64(Float64(Vef + Ev) - mu)) tmp = 0.0 if (KbT <= -3.6e+148) tmp = Float64(0.5 * Float64(Float64(NaChar - NdChar) * Float64(Float64(NdChar + NaChar) * Float64(1.0 / Float64(NaChar - NdChar))))); elseif (KbT <= 2e-170) tmp = Float64(NaChar / Float64(1.0 + exp(Float64(EAccept / KbT)))); elseif (KbT <= 2.9e+97) tmp = Float64(NaChar / Float64(2.0 + Float64(Float64(t_0 + Float64(Float64(-0.5 * Float64(t_0 * Float64(Float64(mu - Float64(Vef + Ev)) - EAccept))) / KbT)) / KbT))); else tmp = Float64(0.5 * Float64(NdChar + NaChar)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = EAccept + ((Vef + Ev) - mu); tmp = 0.0; if (KbT <= -3.6e+148) tmp = 0.5 * ((NaChar - NdChar) * ((NdChar + NaChar) * (1.0 / (NaChar - NdChar)))); elseif (KbT <= 2e-170) tmp = NaChar / (1.0 + exp((EAccept / KbT))); elseif (KbT <= 2.9e+97) tmp = NaChar / (2.0 + ((t_0 + ((-0.5 * (t_0 * ((mu - (Vef + Ev)) - EAccept))) / KbT)) / KbT)); else tmp = 0.5 * (NdChar + NaChar); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(EAccept + N[(N[(Vef + Ev), $MachinePrecision] - mu), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -3.6e+148], N[(0.5 * N[(N[(NaChar - NdChar), $MachinePrecision] * N[(N[(NdChar + NaChar), $MachinePrecision] * N[(1.0 / N[(NaChar - NdChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 2e-170], N[(NaChar / N[(1.0 + N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 2.9e+97], N[(NaChar / N[(2.0 + N[(N[(t$95$0 + N[(N[(-0.5 * N[(t$95$0 * N[(N[(mu - N[(Vef + Ev), $MachinePrecision]), $MachinePrecision] - EAccept), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := EAccept + \left(\left(Vef + Ev\right) - mu\right)\\
\mathbf{if}\;KbT \leq -3.6 \cdot 10^{+148}:\\
\;\;\;\;0.5 \cdot \left(\left(NaChar - NdChar\right) \cdot \left(\left(NdChar + NaChar\right) \cdot \frac{1}{NaChar - NdChar}\right)\right)\\
\mathbf{elif}\;KbT \leq 2 \cdot 10^{-170}:\\
\;\;\;\;\frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\
\mathbf{elif}\;KbT \leq 2.9 \cdot 10^{+97}:\\
\;\;\;\;\frac{NaChar}{2 + \frac{t\_0 + \frac{-0.5 \cdot \left(t\_0 \cdot \left(\left(mu - \left(Vef + Ev\right)\right) - EAccept\right)\right)}{KbT}}{KbT}}\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\
\end{array}
\end{array}
if KbT < -3.60000000000000006e148Initial program 100.0%
Simplified100.0%
Taylor expanded in KbT around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6471.3%
Simplified71.3%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f6440.3%
Applied egg-rr40.3%
associate-/r/N/A
difference-of-squaresN/A
flip-+N/A
associate-*r*N/A
*-lowering-*.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
flip-+N/A
+-commutativeN/A
+-lowering-+.f64N/A
--lowering--.f6471.3%
Applied egg-rr71.3%
if -3.60000000000000006e148 < KbT < 1.99999999999999997e-170Initial program 99.9%
Simplified99.9%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6466.9%
Simplified66.9%
Taylor expanded in EAccept around inf
/-lowering-/.f6440.8%
Simplified40.8%
if 1.99999999999999997e-170 < KbT < 2.89999999999999987e97Initial program 100.0%
Simplified100.0%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6468.4%
Simplified68.4%
Taylor expanded in KbT around -inf
+-lowering-+.f64N/A
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
Simplified32.0%
if 2.89999999999999987e97 < KbT Initial program 100.0%
Simplified100.0%
Taylor expanded in KbT around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6445.6%
Simplified45.6%
Final simplification43.1%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (+ EAccept (- (+ Vef Ev) mu))) (t_1 (* 0.5 (+ NdChar NaChar))))
(if (<= KbT -0.0108)
t_1
(if (<= KbT 3.6e+96)
(/
NaChar
(+
2.0
(/
(+ t_0 (/ (* -0.5 (* t_0 (- (- mu (+ Vef Ev)) EAccept))) KbT))
KbT)))
t_1))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = EAccept + ((Vef + Ev) - mu);
double t_1 = 0.5 * (NdChar + NaChar);
double tmp;
if (KbT <= -0.0108) {
tmp = t_1;
} else if (KbT <= 3.6e+96) {
tmp = NaChar / (2.0 + ((t_0 + ((-0.5 * (t_0 * ((mu - (Vef + Ev)) - EAccept))) / KbT)) / KbT));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = eaccept + ((vef + ev) - mu)
t_1 = 0.5d0 * (ndchar + nachar)
if (kbt <= (-0.0108d0)) then
tmp = t_1
else if (kbt <= 3.6d+96) then
tmp = nachar / (2.0d0 + ((t_0 + (((-0.5d0) * (t_0 * ((mu - (vef + ev)) - eaccept))) / kbt)) / kbt))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = EAccept + ((Vef + Ev) - mu);
double t_1 = 0.5 * (NdChar + NaChar);
double tmp;
if (KbT <= -0.0108) {
tmp = t_1;
} else if (KbT <= 3.6e+96) {
tmp = NaChar / (2.0 + ((t_0 + ((-0.5 * (t_0 * ((mu - (Vef + Ev)) - EAccept))) / KbT)) / KbT));
} else {
tmp = t_1;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = EAccept + ((Vef + Ev) - mu) t_1 = 0.5 * (NdChar + NaChar) tmp = 0 if KbT <= -0.0108: tmp = t_1 elif KbT <= 3.6e+96: tmp = NaChar / (2.0 + ((t_0 + ((-0.5 * (t_0 * ((mu - (Vef + Ev)) - EAccept))) / KbT)) / KbT)) else: tmp = t_1 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(EAccept + Float64(Float64(Vef + Ev) - mu)) t_1 = Float64(0.5 * Float64(NdChar + NaChar)) tmp = 0.0 if (KbT <= -0.0108) tmp = t_1; elseif (KbT <= 3.6e+96) tmp = Float64(NaChar / Float64(2.0 + Float64(Float64(t_0 + Float64(Float64(-0.5 * Float64(t_0 * Float64(Float64(mu - Float64(Vef + Ev)) - EAccept))) / KbT)) / KbT))); else tmp = t_1; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = EAccept + ((Vef + Ev) - mu); t_1 = 0.5 * (NdChar + NaChar); tmp = 0.0; if (KbT <= -0.0108) tmp = t_1; elseif (KbT <= 3.6e+96) tmp = NaChar / (2.0 + ((t_0 + ((-0.5 * (t_0 * ((mu - (Vef + Ev)) - EAccept))) / KbT)) / KbT)); else tmp = t_1; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(EAccept + N[(N[(Vef + Ev), $MachinePrecision] - mu), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -0.0108], t$95$1, If[LessEqual[KbT, 3.6e+96], N[(NaChar / N[(2.0 + N[(N[(t$95$0 + N[(N[(-0.5 * N[(t$95$0 * N[(N[(mu - N[(Vef + Ev), $MachinePrecision]), $MachinePrecision] - EAccept), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := EAccept + \left(\left(Vef + Ev\right) - mu\right)\\
t_1 := 0.5 \cdot \left(NdChar + NaChar\right)\\
\mathbf{if}\;KbT \leq -0.0108:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;KbT \leq 3.6 \cdot 10^{+96}:\\
\;\;\;\;\frac{NaChar}{2 + \frac{t\_0 + \frac{-0.5 \cdot \left(t\_0 \cdot \left(\left(mu - \left(Vef + Ev\right)\right) - EAccept\right)\right)}{KbT}}{KbT}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if KbT < -0.010800000000000001 or 3.60000000000000013e96 < KbT Initial program 99.9%
Simplified99.9%
Taylor expanded in KbT around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6452.1%
Simplified52.1%
if -0.010800000000000001 < KbT < 3.60000000000000013e96Initial program 100.0%
Simplified100.0%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6467.3%
Simplified67.3%
Taylor expanded in KbT around -inf
+-lowering-+.f64N/A
mul-1-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
Simplified30.6%
Final simplification38.9%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (* 0.5 (+ NdChar NaChar))))
(if (<= KbT -0.0095)
t_0
(if (<= KbT -1.45e-213)
(/ NaChar (- 2.0 (/ (- (/ (* -0.5 (* Ev Ev)) KbT) Ev) KbT)))
(if (<= KbT 4.5e-101)
(*
0.5
(/
1.0
(/
(+ 1.0 (/ (- (/ (* NaChar NaChar) NdChar) NaChar) NdChar))
NdChar)))
t_0)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = 0.5 * (NdChar + NaChar);
double tmp;
if (KbT <= -0.0095) {
tmp = t_0;
} else if (KbT <= -1.45e-213) {
tmp = NaChar / (2.0 - ((((-0.5 * (Ev * Ev)) / KbT) - Ev) / KbT));
} else if (KbT <= 4.5e-101) {
tmp = 0.5 * (1.0 / ((1.0 + ((((NaChar * NaChar) / NdChar) - NaChar) / NdChar)) / 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) :: tmp
t_0 = 0.5d0 * (ndchar + nachar)
if (kbt <= (-0.0095d0)) then
tmp = t_0
else if (kbt <= (-1.45d-213)) then
tmp = nachar / (2.0d0 - (((((-0.5d0) * (ev * ev)) / kbt) - ev) / kbt))
else if (kbt <= 4.5d-101) then
tmp = 0.5d0 * (1.0d0 / ((1.0d0 + ((((nachar * nachar) / ndchar) - nachar) / ndchar)) / ndchar))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = 0.5 * (NdChar + NaChar);
double tmp;
if (KbT <= -0.0095) {
tmp = t_0;
} else if (KbT <= -1.45e-213) {
tmp = NaChar / (2.0 - ((((-0.5 * (Ev * Ev)) / KbT) - Ev) / KbT));
} else if (KbT <= 4.5e-101) {
tmp = 0.5 * (1.0 / ((1.0 + ((((NaChar * NaChar) / NdChar) - NaChar) / NdChar)) / NdChar));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = 0.5 * (NdChar + NaChar) tmp = 0 if KbT <= -0.0095: tmp = t_0 elif KbT <= -1.45e-213: tmp = NaChar / (2.0 - ((((-0.5 * (Ev * Ev)) / KbT) - Ev) / KbT)) elif KbT <= 4.5e-101: tmp = 0.5 * (1.0 / ((1.0 + ((((NaChar * NaChar) / NdChar) - NaChar) / NdChar)) / NdChar)) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(0.5 * Float64(NdChar + NaChar)) tmp = 0.0 if (KbT <= -0.0095) tmp = t_0; elseif (KbT <= -1.45e-213) tmp = Float64(NaChar / Float64(2.0 - Float64(Float64(Float64(Float64(-0.5 * Float64(Ev * Ev)) / KbT) - Ev) / KbT))); elseif (KbT <= 4.5e-101) tmp = Float64(0.5 * Float64(1.0 / Float64(Float64(1.0 + Float64(Float64(Float64(Float64(NaChar * NaChar) / NdChar) - NaChar) / NdChar)) / NdChar))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = 0.5 * (NdChar + NaChar); tmp = 0.0; if (KbT <= -0.0095) tmp = t_0; elseif (KbT <= -1.45e-213) tmp = NaChar / (2.0 - ((((-0.5 * (Ev * Ev)) / KbT) - Ev) / KbT)); elseif (KbT <= 4.5e-101) tmp = 0.5 * (1.0 / ((1.0 + ((((NaChar * NaChar) / NdChar) - NaChar) / NdChar)) / NdChar)); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -0.0095], t$95$0, If[LessEqual[KbT, -1.45e-213], N[(NaChar / N[(2.0 - N[(N[(N[(N[(-0.5 * N[(Ev * Ev), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision] - Ev), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 4.5e-101], N[(0.5 * N[(1.0 / N[(N[(1.0 + N[(N[(N[(N[(NaChar * NaChar), $MachinePrecision] / NdChar), $MachinePrecision] - NaChar), $MachinePrecision] / NdChar), $MachinePrecision]), $MachinePrecision] / NdChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
\mathbf{if}\;KbT \leq -0.0095:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;KbT \leq -1.45 \cdot 10^{-213}:\\
\;\;\;\;\frac{NaChar}{2 - \frac{\frac{-0.5 \cdot \left(Ev \cdot Ev\right)}{KbT} - Ev}{KbT}}\\
\mathbf{elif}\;KbT \leq 4.5 \cdot 10^{-101}:\\
\;\;\;\;0.5 \cdot \frac{1}{\frac{1 + \frac{\frac{NaChar \cdot NaChar}{NdChar} - NaChar}{NdChar}}{NdChar}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if KbT < -0.00949999999999999976 or 4.4999999999999998e-101 < KbT Initial program 99.9%
Simplified99.9%
Taylor expanded in KbT around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6441.8%
Simplified41.8%
if -0.00949999999999999976 < KbT < -1.45e-213Initial program 100.0%
Simplified100.0%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6473.0%
Simplified73.0%
Taylor expanded in Ev around inf
/-lowering-/.f6436.1%
Simplified36.1%
Taylor expanded in KbT around -inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6417.6%
Simplified17.6%
if -1.45e-213 < KbT < 4.4999999999999998e-101Initial program 100.0%
Simplified100.0%
Taylor expanded in KbT around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6410.4%
Simplified10.4%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f648.8%
Applied egg-rr8.8%
Taylor expanded in NdChar around -inf
associate-*r/N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
associate-*r/N/A
distribute-lft-inN/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
metadata-evalN/A
+-commutativeN/A
/-lowering-/.f64N/A
Simplified25.1%
Final simplification33.8%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (* 0.5 (+ NdChar NaChar))))
(if (<= KbT -0.0019)
t_0
(if (<= KbT 5.4e-162)
(/ NaChar (+ 2.0 (* Ev (+ (/ 1.0 KbT) (* 0.5 (/ Ev (* KbT 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 = 0.5 * (NdChar + NaChar);
double tmp;
if (KbT <= -0.0019) {
tmp = t_0;
} else if (KbT <= 5.4e-162) {
tmp = NaChar / (2.0 + (Ev * ((1.0 / KbT) + (0.5 * (Ev / (KbT * KbT))))));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = 0.5d0 * (ndchar + nachar)
if (kbt <= (-0.0019d0)) then
tmp = t_0
else if (kbt <= 5.4d-162) then
tmp = nachar / (2.0d0 + (ev * ((1.0d0 / kbt) + (0.5d0 * (ev / (kbt * 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 = 0.5 * (NdChar + NaChar);
double tmp;
if (KbT <= -0.0019) {
tmp = t_0;
} else if (KbT <= 5.4e-162) {
tmp = NaChar / (2.0 + (Ev * ((1.0 / KbT) + (0.5 * (Ev / (KbT * KbT))))));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = 0.5 * (NdChar + NaChar) tmp = 0 if KbT <= -0.0019: tmp = t_0 elif KbT <= 5.4e-162: tmp = NaChar / (2.0 + (Ev * ((1.0 / KbT) + (0.5 * (Ev / (KbT * KbT)))))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(0.5 * Float64(NdChar + NaChar)) tmp = 0.0 if (KbT <= -0.0019) tmp = t_0; elseif (KbT <= 5.4e-162) tmp = Float64(NaChar / Float64(2.0 + Float64(Ev * Float64(Float64(1.0 / KbT) + Float64(0.5 * Float64(Ev / Float64(KbT * KbT))))))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = 0.5 * (NdChar + NaChar); tmp = 0.0; if (KbT <= -0.0019) tmp = t_0; elseif (KbT <= 5.4e-162) tmp = NaChar / (2.0 + (Ev * ((1.0 / KbT) + (0.5 * (Ev / (KbT * 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[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -0.0019], t$95$0, If[LessEqual[KbT, 5.4e-162], N[(NaChar / N[(2.0 + N[(Ev * N[(N[(1.0 / KbT), $MachinePrecision] + N[(0.5 * N[(Ev / N[(KbT * KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
\mathbf{if}\;KbT \leq -0.0019:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;KbT \leq 5.4 \cdot 10^{-162}:\\
\;\;\;\;\frac{NaChar}{2 + Ev \cdot \left(\frac{1}{KbT} + 0.5 \cdot \frac{Ev}{KbT \cdot KbT}\right)}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if KbT < -0.0019 or 5.39999999999999968e-162 < KbT Initial program 99.9%
Simplified99.9%
Taylor expanded in KbT around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6438.9%
Simplified38.9%
if -0.0019 < KbT < 5.39999999999999968e-162Initial program 100.0%
Simplified100.0%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6467.4%
Simplified67.4%
Taylor expanded in Ev around inf
/-lowering-/.f6435.6%
Simplified35.6%
Taylor expanded in Ev around 0
+-lowering-+.f64N/A
*-lowering-*.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
unpow2N/A
*-lowering-*.f6428.8%
Simplified28.8%
Final simplification35.4%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (* 0.5 (+ NdChar NaChar))))
(if (<= KbT -4.2e-70)
t_0
(if (<= KbT 3e+56)
(*
0.5
(/
1.0
(/
(+ 1.0 (/ (- (/ (* NdChar NdChar) NaChar) NdChar) NaChar))
NaChar)))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = 0.5 * (NdChar + NaChar);
double tmp;
if (KbT <= -4.2e-70) {
tmp = t_0;
} else if (KbT <= 3e+56) {
tmp = 0.5 * (1.0 / ((1.0 + ((((NdChar * NdChar) / NaChar) - NdChar) / NaChar)) / NaChar));
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = 0.5d0 * (ndchar + nachar)
if (kbt <= (-4.2d-70)) then
tmp = t_0
else if (kbt <= 3d+56) then
tmp = 0.5d0 * (1.0d0 / ((1.0d0 + ((((ndchar * ndchar) / nachar) - ndchar) / nachar)) / nachar))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = 0.5 * (NdChar + NaChar);
double tmp;
if (KbT <= -4.2e-70) {
tmp = t_0;
} else if (KbT <= 3e+56) {
tmp = 0.5 * (1.0 / ((1.0 + ((((NdChar * NdChar) / NaChar) - NdChar) / NaChar)) / NaChar));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = 0.5 * (NdChar + NaChar) tmp = 0 if KbT <= -4.2e-70: tmp = t_0 elif KbT <= 3e+56: tmp = 0.5 * (1.0 / ((1.0 + ((((NdChar * NdChar) / NaChar) - NdChar) / NaChar)) / NaChar)) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(0.5 * Float64(NdChar + NaChar)) tmp = 0.0 if (KbT <= -4.2e-70) tmp = t_0; elseif (KbT <= 3e+56) tmp = Float64(0.5 * Float64(1.0 / Float64(Float64(1.0 + Float64(Float64(Float64(Float64(NdChar * NdChar) / NaChar) - NdChar) / NaChar)) / NaChar))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = 0.5 * (NdChar + NaChar); tmp = 0.0; if (KbT <= -4.2e-70) tmp = t_0; elseif (KbT <= 3e+56) tmp = 0.5 * (1.0 / ((1.0 + ((((NdChar * NdChar) / NaChar) - NdChar) / NaChar)) / NaChar)); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -4.2e-70], t$95$0, If[LessEqual[KbT, 3e+56], N[(0.5 * N[(1.0 / N[(N[(1.0 + N[(N[(N[(N[(NdChar * NdChar), $MachinePrecision] / NaChar), $MachinePrecision] - NdChar), $MachinePrecision] / NaChar), $MachinePrecision]), $MachinePrecision] / NaChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
\mathbf{if}\;KbT \leq -4.2 \cdot 10^{-70}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;KbT \leq 3 \cdot 10^{+56}:\\
\;\;\;\;0.5 \cdot \frac{1}{\frac{1 + \frac{\frac{NdChar \cdot NdChar}{NaChar} - NdChar}{NaChar}}{NaChar}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if KbT < -4.2000000000000002e-70 or 3.00000000000000006e56 < KbT Initial program 99.9%
Simplified99.9%
Taylor expanded in KbT around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6447.4%
Simplified47.4%
if -4.2000000000000002e-70 < KbT < 3.00000000000000006e56Initial program 100.0%
Simplified100.0%
Taylor expanded in KbT around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6411.5%
Simplified11.5%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f648.0%
Applied egg-rr8.0%
Taylor expanded in NaChar around -inf
associate-*r/N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
associate-*r/N/A
distribute-lft-inN/A
neg-mul-1N/A
mul-1-negN/A
remove-double-negN/A
metadata-evalN/A
+-commutativeN/A
/-lowering-/.f64N/A
Simplified20.6%
Final simplification33.5%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (* 0.5 (+ NdChar NaChar))))
(if (<= KbT -0.236)
t_0
(if (<= KbT -1.2e-213)
(/ NaChar (- 2.0 (/ (- (/ (* -0.5 (* Ev Ev)) KbT) Ev) KbT)))
(if (<= KbT 2.05e-201)
(* 0.5 (/ 1.0 (/ (- NdChar NaChar) (* NdChar NdChar))))
t_0)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = 0.5 * (NdChar + NaChar);
double tmp;
if (KbT <= -0.236) {
tmp = t_0;
} else if (KbT <= -1.2e-213) {
tmp = NaChar / (2.0 - ((((-0.5 * (Ev * Ev)) / KbT) - Ev) / KbT));
} else if (KbT <= 2.05e-201) {
tmp = 0.5 * (1.0 / ((NdChar - NaChar) / (NdChar * 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) :: tmp
t_0 = 0.5d0 * (ndchar + nachar)
if (kbt <= (-0.236d0)) then
tmp = t_0
else if (kbt <= (-1.2d-213)) then
tmp = nachar / (2.0d0 - (((((-0.5d0) * (ev * ev)) / kbt) - ev) / kbt))
else if (kbt <= 2.05d-201) then
tmp = 0.5d0 * (1.0d0 / ((ndchar - nachar) / (ndchar * ndchar)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = 0.5 * (NdChar + NaChar);
double tmp;
if (KbT <= -0.236) {
tmp = t_0;
} else if (KbT <= -1.2e-213) {
tmp = NaChar / (2.0 - ((((-0.5 * (Ev * Ev)) / KbT) - Ev) / KbT));
} else if (KbT <= 2.05e-201) {
tmp = 0.5 * (1.0 / ((NdChar - NaChar) / (NdChar * NdChar)));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = 0.5 * (NdChar + NaChar) tmp = 0 if KbT <= -0.236: tmp = t_0 elif KbT <= -1.2e-213: tmp = NaChar / (2.0 - ((((-0.5 * (Ev * Ev)) / KbT) - Ev) / KbT)) elif KbT <= 2.05e-201: tmp = 0.5 * (1.0 / ((NdChar - NaChar) / (NdChar * NdChar))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(0.5 * Float64(NdChar + NaChar)) tmp = 0.0 if (KbT <= -0.236) tmp = t_0; elseif (KbT <= -1.2e-213) tmp = Float64(NaChar / Float64(2.0 - Float64(Float64(Float64(Float64(-0.5 * Float64(Ev * Ev)) / KbT) - Ev) / KbT))); elseif (KbT <= 2.05e-201) tmp = Float64(0.5 * Float64(1.0 / Float64(Float64(NdChar - NaChar) / Float64(NdChar * NdChar)))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = 0.5 * (NdChar + NaChar); tmp = 0.0; if (KbT <= -0.236) tmp = t_0; elseif (KbT <= -1.2e-213) tmp = NaChar / (2.0 - ((((-0.5 * (Ev * Ev)) / KbT) - Ev) / KbT)); elseif (KbT <= 2.05e-201) tmp = 0.5 * (1.0 / ((NdChar - NaChar) / (NdChar * NdChar))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -0.236], t$95$0, If[LessEqual[KbT, -1.2e-213], N[(NaChar / N[(2.0 - N[(N[(N[(N[(-0.5 * N[(Ev * Ev), $MachinePrecision]), $MachinePrecision] / KbT), $MachinePrecision] - Ev), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[KbT, 2.05e-201], N[(0.5 * N[(1.0 / N[(N[(NdChar - NaChar), $MachinePrecision] / N[(NdChar * NdChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
\mathbf{if}\;KbT \leq -0.236:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;KbT \leq -1.2 \cdot 10^{-213}:\\
\;\;\;\;\frac{NaChar}{2 - \frac{\frac{-0.5 \cdot \left(Ev \cdot Ev\right)}{KbT} - Ev}{KbT}}\\
\mathbf{elif}\;KbT \leq 2.05 \cdot 10^{-201}:\\
\;\;\;\;0.5 \cdot \frac{1}{\frac{NdChar - NaChar}{NdChar \cdot NdChar}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if KbT < -0.23599999999999999 or 2.05000000000000001e-201 < KbT Initial program 99.9%
Simplified99.9%
Taylor expanded in KbT around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6437.1%
Simplified37.1%
if -0.23599999999999999 < KbT < -1.19999999999999998e-213Initial program 100.0%
Simplified100.0%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6473.0%
Simplified73.0%
Taylor expanded in Ev around inf
/-lowering-/.f6436.1%
Simplified36.1%
Taylor expanded in KbT around -inf
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f64N/A
+-commutativeN/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
associate-*r/N/A
/-lowering-/.f64N/A
*-lowering-*.f64N/A
unpow2N/A
*-lowering-*.f6417.6%
Simplified17.6%
if -1.19999999999999998e-213 < KbT < 2.05000000000000001e-201Initial program 100.0%
Simplified100.0%
Taylor expanded in KbT around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f648.1%
Simplified8.1%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f649.4%
Applied egg-rr9.4%
Taylor expanded in NaChar around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6428.7%
Simplified28.7%
Final simplification33.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (* 0.5 (+ NdChar NaChar))))
(if (<= KbT -4.15e-193)
t_0
(if (<= KbT 5.7e-201)
(* 0.5 (/ 1.0 (/ (- NdChar NaChar) (* NdChar NdChar))))
t_0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = 0.5 * (NdChar + NaChar);
double tmp;
if (KbT <= -4.15e-193) {
tmp = t_0;
} else if (KbT <= 5.7e-201) {
tmp = 0.5 * (1.0 / ((NdChar - NaChar) / (NdChar * 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) :: tmp
t_0 = 0.5d0 * (ndchar + nachar)
if (kbt <= (-4.15d-193)) then
tmp = t_0
else if (kbt <= 5.7d-201) then
tmp = 0.5d0 * (1.0d0 / ((ndchar - nachar) / (ndchar * ndchar)))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = 0.5 * (NdChar + NaChar);
double tmp;
if (KbT <= -4.15e-193) {
tmp = t_0;
} else if (KbT <= 5.7e-201) {
tmp = 0.5 * (1.0 / ((NdChar - NaChar) / (NdChar * NdChar)));
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = 0.5 * (NdChar + NaChar) tmp = 0 if KbT <= -4.15e-193: tmp = t_0 elif KbT <= 5.7e-201: tmp = 0.5 * (1.0 / ((NdChar - NaChar) / (NdChar * NdChar))) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(0.5 * Float64(NdChar + NaChar)) tmp = 0.0 if (KbT <= -4.15e-193) tmp = t_0; elseif (KbT <= 5.7e-201) tmp = Float64(0.5 * Float64(1.0 / Float64(Float64(NdChar - NaChar) / Float64(NdChar * NdChar)))); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = 0.5 * (NdChar + NaChar); tmp = 0.0; if (KbT <= -4.15e-193) tmp = t_0; elseif (KbT <= 5.7e-201) tmp = 0.5 * (1.0 / ((NdChar - NaChar) / (NdChar * NdChar))); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[KbT, -4.15e-193], t$95$0, If[LessEqual[KbT, 5.7e-201], N[(0.5 * N[(1.0 / N[(N[(NdChar - NaChar), $MachinePrecision] / N[(NdChar * NdChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
\mathbf{if}\;KbT \leq -4.15 \cdot 10^{-193}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;KbT \leq 5.7 \cdot 10^{-201}:\\
\;\;\;\;0.5 \cdot \frac{1}{\frac{NdChar - NaChar}{NdChar \cdot NdChar}}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if KbT < -4.1500000000000002e-193 or 5.7000000000000001e-201 < KbT Initial program 100.0%
Simplified100.0%
Taylor expanded in KbT around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6432.8%
Simplified32.8%
if -4.1500000000000002e-193 < KbT < 5.7000000000000001e-201Initial program 100.0%
Simplified100.0%
Taylor expanded in KbT around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f647.9%
Simplified7.9%
flip-+N/A
clear-numN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f64N/A
--lowering--.f64N/A
*-lowering-*.f64N/A
*-lowering-*.f649.3%
Applied egg-rr9.3%
Taylor expanded in NaChar around 0
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
unpow2N/A
*-lowering-*.f6428.1%
Simplified28.1%
Final simplification32.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (if (<= Ev -1.38e+166) (* NdChar 0.5) (if (<= Ev 7e-296) (/ NaChar 2.0) (* NdChar 0.5))))
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.38e+166) {
tmp = NdChar * 0.5;
} else if (Ev <= 7e-296) {
tmp = NaChar / 2.0;
} else {
tmp = NdChar * 0.5;
}
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.38d+166)) then
tmp = ndchar * 0.5d0
else if (ev <= 7d-296) then
tmp = nachar / 2.0d0
else
tmp = ndchar * 0.5d0
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.38e+166) {
tmp = NdChar * 0.5;
} else if (Ev <= 7e-296) {
tmp = NaChar / 2.0;
} else {
tmp = NdChar * 0.5;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if Ev <= -1.38e+166: tmp = NdChar * 0.5 elif Ev <= 7e-296: tmp = NaChar / 2.0 else: tmp = NdChar * 0.5 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (Ev <= -1.38e+166) tmp = Float64(NdChar * 0.5); elseif (Ev <= 7e-296) tmp = Float64(NaChar / 2.0); else tmp = Float64(NdChar * 0.5); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if (Ev <= -1.38e+166) tmp = NdChar * 0.5; elseif (Ev <= 7e-296) tmp = NaChar / 2.0; else tmp = NdChar * 0.5; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[Ev, -1.38e+166], N[(NdChar * 0.5), $MachinePrecision], If[LessEqual[Ev, 7e-296], N[(NaChar / 2.0), $MachinePrecision], N[(NdChar * 0.5), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;Ev \leq -1.38 \cdot 10^{+166}:\\
\;\;\;\;NdChar \cdot 0.5\\
\mathbf{elif}\;Ev \leq 7 \cdot 10^{-296}:\\
\;\;\;\;\frac{NaChar}{2}\\
\mathbf{else}:\\
\;\;\;\;NdChar \cdot 0.5\\
\end{array}
\end{array}
if Ev < -1.38000000000000001e166 or 6.9999999999999998e-296 < Ev Initial program 100.0%
Simplified100.0%
Taylor expanded in KbT around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6427.7%
Simplified27.7%
Taylor expanded in NaChar around 0
*-commutativeN/A
*-lowering-*.f6423.5%
Simplified23.5%
if -1.38000000000000001e166 < Ev < 6.9999999999999998e-296Initial program 99.9%
Simplified99.9%
Taylor expanded in NdChar around 0
/-lowering-/.f64N/A
+-lowering-+.f64N/A
exp-lowering-exp.f64N/A
/-lowering-/.f64N/A
associate--l+N/A
sub-negN/A
associate-+r+N/A
mul-1-negN/A
associate-+r+N/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f6472.6%
Simplified72.6%
Taylor expanded in KbT around inf
Simplified25.8%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (* 0.5 (+ NdChar NaChar)))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return 0.5 * (NdChar + 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 * (ndchar + 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 * (NdChar + NaChar);
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): return 0.5 * (NdChar + NaChar)
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) return Float64(0.5 * Float64(NdChar + NaChar)) end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.5 * (NdChar + NaChar); end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot \left(NdChar + NaChar\right)
\end{array}
Initial program 100.0%
Simplified100.0%
Taylor expanded in KbT around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6428.7%
Simplified28.7%
Final simplification28.7%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (* NdChar 0.5))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return 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 = 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 NdChar * 0.5;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): return NdChar * 0.5
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) return Float64(NdChar * 0.5) end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = NdChar * 0.5; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(NdChar * 0.5), $MachinePrecision]
\begin{array}{l}
\\
NdChar \cdot 0.5
\end{array}
Initial program 100.0%
Simplified100.0%
Taylor expanded in KbT around inf
distribute-lft-outN/A
*-lowering-*.f64N/A
+-lowering-+.f6428.7%
Simplified28.7%
Taylor expanded in NaChar around 0
*-commutativeN/A
*-lowering-*.f6418.4%
Simplified18.4%
herbie shell --seed 2024140
(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))))))