
(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 24 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
(let* ((t_0 (pow (E) (* (/ (- (- (- Ec Vef) EDonor) mu) KbT) (- 0.5)))))
(+
(/ NdChar (fma t_0 t_0 1.0))
(/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))))))\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\mathsf{E}\left(\right)}^{\left(\frac{\left(\left(Ec - Vef\right) - EDonor\right) - mu}{KbT} \cdot \left(-0.5\right)\right)}\\
\frac{NdChar}{\mathsf{fma}\left(t\_0, t\_0, 1\right)} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}}
\end{array}
\end{array}
Initial program 100.0%
lift-exp.f64N/A
lift-/.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64100.0
Applied rewrites100.0%
lift-+.f64N/A
+-commutativeN/A
lift-pow.f64N/A
sqr-powN/A
lower-fma.f64N/A
Applied rewrites100.0%
Final simplification100.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT)))))
(t_1 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))
(t_2 (+ t_0 (/ NaChar (+ 1.0 t_1)))))
(if (<= t_2 -8e+21)
(+
(/ NdChar (+ (exp (/ (- EDonor Ec) KbT)) 1.0))
(/ NaChar (+ (exp (/ (+ EAccept Ev) KbT)) 1.0)))
(if (or (<= t_2 -2e-205) (not (<= t_2 1e-95)))
(+ t_0 (/ NaChar (+ 1.0 (exp (/ Ev KbT)))))
(/ NaChar (+ t_1 1.0))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)));
double t_1 = exp(((((Ev + Vef) + EAccept) - mu) / KbT));
double t_2 = t_0 + (NaChar / (1.0 + t_1));
double tmp;
if (t_2 <= -8e+21) {
tmp = (NdChar / (exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (exp(((EAccept + Ev) / KbT)) + 1.0));
} else if ((t_2 <= -2e-205) || !(t_2 <= 1e-95)) {
tmp = t_0 + (NaChar / (1.0 + exp((Ev / KbT))));
} else {
tmp = NaChar / (t_1 + 1.0);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))
t_1 = exp(((((ev + vef) + eaccept) - mu) / kbt))
t_2 = t_0 + (nachar / (1.0d0 + t_1))
if (t_2 <= (-8d+21)) then
tmp = (ndchar / (exp(((edonor - ec) / kbt)) + 1.0d0)) + (nachar / (exp(((eaccept + ev) / kbt)) + 1.0d0))
else if ((t_2 <= (-2d-205)) .or. (.not. (t_2 <= 1d-95))) then
tmp = t_0 + (nachar / (1.0d0 + exp((ev / kbt))))
else
tmp = nachar / (t_1 + 1.0d0)
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)));
double t_1 = Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT));
double t_2 = t_0 + (NaChar / (1.0 + t_1));
double tmp;
if (t_2 <= -8e+21) {
tmp = (NdChar / (Math.exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (Math.exp(((EAccept + Ev) / KbT)) + 1.0));
} else if ((t_2 <= -2e-205) || !(t_2 <= 1e-95)) {
tmp = t_0 + (NaChar / (1.0 + Math.exp((Ev / KbT))));
} else {
tmp = NaChar / (t_1 + 1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT))) t_1 = math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) t_2 = t_0 + (NaChar / (1.0 + t_1)) tmp = 0 if t_2 <= -8e+21: tmp = (NdChar / (math.exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (math.exp(((EAccept + Ev) / KbT)) + 1.0)) elif (t_2 <= -2e-205) or not (t_2 <= 1e-95): tmp = t_0 + (NaChar / (1.0 + math.exp((Ev / KbT)))) else: tmp = NaChar / (t_1 + 1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) t_1 = exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)) t_2 = Float64(t_0 + Float64(NaChar / Float64(1.0 + t_1))) tmp = 0.0 if (t_2 <= -8e+21) tmp = Float64(Float64(NdChar / Float64(exp(Float64(Float64(EDonor - Ec) / KbT)) + 1.0)) + Float64(NaChar / Float64(exp(Float64(Float64(EAccept + Ev) / KbT)) + 1.0))); elseif ((t_2 <= -2e-205) || !(t_2 <= 1e-95)) tmp = Float64(t_0 + Float64(NaChar / Float64(1.0 + exp(Float64(Ev / KbT))))); else tmp = Float64(NaChar / Float64(t_1 + 1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT))); t_1 = exp(((((Ev + Vef) + EAccept) - mu) / KbT)); t_2 = t_0 + (NaChar / (1.0 + t_1)); tmp = 0.0; if (t_2 <= -8e+21) tmp = (NdChar / (exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (exp(((EAccept + Ev) / KbT)) + 1.0)); elseif ((t_2 <= -2e-205) || ~((t_2 <= 1e-95))) tmp = t_0 + (NaChar / (1.0 + exp((Ev / KbT)))); else tmp = NaChar / (t_1 + 1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(1.0 + N[Exp[N[((-N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision]) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 + N[(NaChar / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -8e+21], N[(N[(NdChar / N[(N[Exp[N[(N[(EDonor - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(N[Exp[N[(N[(EAccept + Ev), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[t$95$2, -2e-205], N[Not[LessEqual[t$95$2, 1e-95]], $MachinePrecision]], N[(t$95$0 + N[(NaChar / N[(1.0 + N[Exp[N[(Ev / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(NaChar / N[(t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}}\\
t_1 := e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}\\
t_2 := t\_0 + \frac{NaChar}{1 + t\_1}\\
\mathbf{if}\;t\_2 \leq -8 \cdot 10^{+21}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{EDonor - Ec}{KbT}} + 1} + \frac{NaChar}{e^{\frac{EAccept + Ev}{KbT}} + 1}\\
\mathbf{elif}\;t\_2 \leq -2 \cdot 10^{-205} \lor \neg \left(t\_2 \leq 10^{-95}\right):\\
\;\;\;\;t\_0 + \frac{NaChar}{1 + e^{\frac{Ev}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{t\_1 + 1}\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -8e21Initial program 100.0%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites93.2%
Taylor expanded in mu around 0
Applied rewrites86.3%
if -8e21 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -2e-205 or 9.99999999999999989e-96 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 99.9%
Taylor expanded in Ev around inf
lower-/.f6477.0
Applied rewrites77.0%
if -2e-205 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 9.99999999999999989e-96Initial program 100.0%
Taylor expanded in NdChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6493.5
Applied rewrites93.5%
Final simplification84.3%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT)))))
(t_1 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))
(t_2 (/ NaChar (+ 1.0 t_1)))
(t_3 (+ (* 0.5 NdChar) t_2))
(t_4 (+ t_0 t_2)))
(if (<= t_4 -5e-198)
t_3
(if (<= t_4 2e-54)
(/ NaChar (+ t_1 1.0))
(if (<= t_4 5e+115) (+ t_0 (/ NaChar 2.0)) t_3)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)));
double t_1 = exp(((((Ev + Vef) + EAccept) - mu) / KbT));
double t_2 = NaChar / (1.0 + t_1);
double t_3 = (0.5 * NdChar) + t_2;
double t_4 = t_0 + t_2;
double tmp;
if (t_4 <= -5e-198) {
tmp = t_3;
} else if (t_4 <= 2e-54) {
tmp = NaChar / (t_1 + 1.0);
} else if (t_4 <= 5e+115) {
tmp = t_0 + (NaChar / 2.0);
} else {
tmp = t_3;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: t_4
real(8) :: tmp
t_0 = ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))
t_1 = exp(((((ev + vef) + eaccept) - mu) / kbt))
t_2 = nachar / (1.0d0 + t_1)
t_3 = (0.5d0 * ndchar) + t_2
t_4 = t_0 + t_2
if (t_4 <= (-5d-198)) then
tmp = t_3
else if (t_4 <= 2d-54) then
tmp = nachar / (t_1 + 1.0d0)
else if (t_4 <= 5d+115) then
tmp = t_0 + (nachar / 2.0d0)
else
tmp = t_3
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)));
double t_1 = Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT));
double t_2 = NaChar / (1.0 + t_1);
double t_3 = (0.5 * NdChar) + t_2;
double t_4 = t_0 + t_2;
double tmp;
if (t_4 <= -5e-198) {
tmp = t_3;
} else if (t_4 <= 2e-54) {
tmp = NaChar / (t_1 + 1.0);
} else if (t_4 <= 5e+115) {
tmp = t_0 + (NaChar / 2.0);
} else {
tmp = t_3;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT))) t_1 = math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) t_2 = NaChar / (1.0 + t_1) t_3 = (0.5 * NdChar) + t_2 t_4 = t_0 + t_2 tmp = 0 if t_4 <= -5e-198: tmp = t_3 elif t_4 <= 2e-54: tmp = NaChar / (t_1 + 1.0) elif t_4 <= 5e+115: tmp = t_0 + (NaChar / 2.0) else: tmp = t_3 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) t_1 = exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)) t_2 = Float64(NaChar / Float64(1.0 + t_1)) t_3 = Float64(Float64(0.5 * NdChar) + t_2) t_4 = Float64(t_0 + t_2) tmp = 0.0 if (t_4 <= -5e-198) tmp = t_3; elseif (t_4 <= 2e-54) tmp = Float64(NaChar / Float64(t_1 + 1.0)); elseif (t_4 <= 5e+115) tmp = Float64(t_0 + Float64(NaChar / 2.0)); else tmp = t_3; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT))); t_1 = exp(((((Ev + Vef) + EAccept) - mu) / KbT)); t_2 = NaChar / (1.0 + t_1); t_3 = (0.5 * NdChar) + t_2; t_4 = t_0 + t_2; tmp = 0.0; if (t_4 <= -5e-198) tmp = t_3; elseif (t_4 <= 2e-54) tmp = NaChar / (t_1 + 1.0); elseif (t_4 <= 5e+115) tmp = t_0 + (NaChar / 2.0); else tmp = t_3; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(1.0 + N[Exp[N[((-N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision]) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(NaChar / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(0.5 * NdChar), $MachinePrecision] + t$95$2), $MachinePrecision]}, Block[{t$95$4 = N[(t$95$0 + t$95$2), $MachinePrecision]}, If[LessEqual[t$95$4, -5e-198], t$95$3, If[LessEqual[t$95$4, 2e-54], N[(NaChar / N[(t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$4, 5e+115], N[(t$95$0 + N[(NaChar / 2.0), $MachinePrecision]), $MachinePrecision], t$95$3]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}}\\
t_1 := e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}\\
t_2 := \frac{NaChar}{1 + t\_1}\\
t_3 := 0.5 \cdot NdChar + t\_2\\
t_4 := t\_0 + t\_2\\
\mathbf{if}\;t\_4 \leq -5 \cdot 10^{-198}:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_4 \leq 2 \cdot 10^{-54}:\\
\;\;\;\;\frac{NaChar}{t\_1 + 1}\\
\mathbf{elif}\;t\_4 \leq 5 \cdot 10^{+115}:\\
\;\;\;\;t\_0 + \frac{NaChar}{2}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -4.9999999999999999e-198 or 5.00000000000000008e115 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 99.9%
Taylor expanded in KbT around inf
lower-*.f6472.8
Applied rewrites72.8%
if -4.9999999999999999e-198 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 2.0000000000000001e-54Initial program 100.0%
Taylor expanded in NdChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6488.2
Applied rewrites88.2%
if 2.0000000000000001e-54 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 5.00000000000000008e115Initial program 99.9%
Taylor expanded in KbT around inf
Applied rewrites72.3%
Final simplification78.5%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))
(t_1 (/ NaChar (+ 1.0 t_0)))
(t_2 (+ (* 0.5 NdChar) t_1))
(t_3
(+
(/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT))))
t_1)))
(if (<= t_3 -5e-198)
t_2
(if (<= t_3 5e-28)
(/ NaChar (+ t_0 1.0))
(if (<= t_3 5e+115)
(/ NdChar (+ (exp (/ (- (+ (+ mu Vef) EDonor) Ec) KbT)) 1.0))
t_2)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = exp(((((Ev + Vef) + EAccept) - mu) / KbT));
double t_1 = NaChar / (1.0 + t_0);
double t_2 = (0.5 * NdChar) + t_1;
double t_3 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + t_1;
double tmp;
if (t_3 <= -5e-198) {
tmp = t_2;
} else if (t_3 <= 5e-28) {
tmp = NaChar / (t_0 + 1.0);
} else if (t_3 <= 5e+115) {
tmp = NdChar / (exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
real(8) :: tmp
t_0 = exp(((((ev + vef) + eaccept) - mu) / kbt))
t_1 = nachar / (1.0d0 + t_0)
t_2 = (0.5d0 * ndchar) + t_1
t_3 = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + t_1
if (t_3 <= (-5d-198)) then
tmp = t_2
else if (t_3 <= 5d-28) then
tmp = nachar / (t_0 + 1.0d0)
else if (t_3 <= 5d+115) then
tmp = ndchar / (exp(((((mu + vef) + edonor) - ec) / kbt)) + 1.0d0)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT));
double t_1 = NaChar / (1.0 + t_0);
double t_2 = (0.5 * NdChar) + t_1;
double t_3 = (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + t_1;
double tmp;
if (t_3 <= -5e-198) {
tmp = t_2;
} else if (t_3 <= 5e-28) {
tmp = NaChar / (t_0 + 1.0);
} else if (t_3 <= 5e+115) {
tmp = NdChar / (Math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0);
} else {
tmp = t_2;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) t_1 = NaChar / (1.0 + t_0) t_2 = (0.5 * NdChar) + t_1 t_3 = (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + t_1 tmp = 0 if t_3 <= -5e-198: tmp = t_2 elif t_3 <= 5e-28: tmp = NaChar / (t_0 + 1.0) elif t_3 <= 5e+115: tmp = NdChar / (math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0) else: tmp = t_2 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)) t_1 = Float64(NaChar / Float64(1.0 + t_0)) t_2 = Float64(Float64(0.5 * NdChar) + t_1) t_3 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) + t_1) tmp = 0.0 if (t_3 <= -5e-198) tmp = t_2; elseif (t_3 <= 5e-28) tmp = Float64(NaChar / Float64(t_0 + 1.0)); elseif (t_3 <= 5e+115) tmp = Float64(NdChar / Float64(exp(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT)) + 1.0)); else tmp = t_2; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = exp(((((Ev + Vef) + EAccept) - mu) / KbT)); t_1 = NaChar / (1.0 + t_0); t_2 = (0.5 * NdChar) + t_1; t_3 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + t_1; tmp = 0.0; if (t_3 <= -5e-198) tmp = t_2; elseif (t_3 <= 5e-28) tmp = NaChar / (t_0 + 1.0); elseif (t_3 <= 5e+115) tmp = NdChar / (exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0); else tmp = t_2; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(NaChar / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(0.5 * NdChar), $MachinePrecision] + t$95$1), $MachinePrecision]}, Block[{t$95$3 = N[(N[(NdChar / N[(1.0 + N[Exp[N[((-N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision]) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]}, If[LessEqual[t$95$3, -5e-198], t$95$2, If[LessEqual[t$95$3, 5e-28], N[(NaChar / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$3, 5e+115], N[(NdChar / N[(N[Exp[N[(N[(N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}\\
t_1 := \frac{NaChar}{1 + t\_0}\\
t_2 := 0.5 \cdot NdChar + t\_1\\
t_3 := \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + t\_1\\
\mathbf{if}\;t\_3 \leq -5 \cdot 10^{-198}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{-28}:\\
\;\;\;\;\frac{NaChar}{t\_0 + 1}\\
\mathbf{elif}\;t\_3 \leq 5 \cdot 10^{+115}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}} + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -4.9999999999999999e-198 or 5.00000000000000008e115 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 99.9%
Taylor expanded in KbT around inf
lower-*.f6472.8
Applied rewrites72.8%
if -4.9999999999999999e-198 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 5.0000000000000002e-28Initial program 100.0%
Taylor expanded in NdChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6486.2
Applied rewrites86.2%
if 5.0000000000000002e-28 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 5.00000000000000008e115Initial program 99.8%
lift-exp.f64N/A
lift-/.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f6499.9
Applied rewrites99.9%
Taylor expanded in NdChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6474.9
Applied rewrites74.9%
Final simplification78.5%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (* 0.5 (+ NdChar NaChar)))
(t_1
(+
(/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT))))
(/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))))))
(if (<= t_1 -2e-205)
t_0
(if (<= t_1 0.0)
(/ NaChar (+ 2.0 (+ (/ EAccept KbT) (+ (/ Ev KbT) (/ (- Vef mu) KbT)))))
(if (<= t_1 1e+179) (/ NdChar (+ (exp (/ mu KbT)) 1.0)) t_0)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = 0.5 * (NdChar + NaChar);
double t_1 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
double tmp;
if (t_1 <= -2e-205) {
tmp = t_0;
} else if (t_1 <= 0.0) {
tmp = NaChar / (2.0 + ((EAccept / KbT) + ((Ev / KbT) + ((Vef - mu) / KbT))));
} else if (t_1 <= 1e+179) {
tmp = NdChar / (exp((mu / KbT)) + 1.0);
} else {
tmp = t_0;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = 0.5d0 * (ndchar + nachar)
t_1 = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + (nachar / (1.0d0 + exp(((((ev + vef) + eaccept) - mu) / kbt))))
if (t_1 <= (-2d-205)) then
tmp = t_0
else if (t_1 <= 0.0d0) then
tmp = nachar / (2.0d0 + ((eaccept / kbt) + ((ev / kbt) + ((vef - mu) / kbt))))
else if (t_1 <= 1d+179) then
tmp = ndchar / (exp((mu / kbt)) + 1.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = 0.5 * (NdChar + NaChar);
double t_1 = (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
double tmp;
if (t_1 <= -2e-205) {
tmp = t_0;
} else if (t_1 <= 0.0) {
tmp = NaChar / (2.0 + ((EAccept / KbT) + ((Ev / KbT) + ((Vef - mu) / KbT))));
} else if (t_1 <= 1e+179) {
tmp = NdChar / (Math.exp((mu / KbT)) + 1.0);
} else {
tmp = t_0;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = 0.5 * (NdChar + NaChar) t_1 = (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) tmp = 0 if t_1 <= -2e-205: tmp = t_0 elif t_1 <= 0.0: tmp = NaChar / (2.0 + ((EAccept / KbT) + ((Ev / KbT) + ((Vef - mu) / KbT)))) elif t_1 <= 1e+179: tmp = NdChar / (math.exp((mu / KbT)) + 1.0) else: tmp = t_0 return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(0.5 * Float64(NdChar + NaChar)) t_1 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) + Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT))))) tmp = 0.0 if (t_1 <= -2e-205) tmp = t_0; elseif (t_1 <= 0.0) tmp = Float64(NaChar / Float64(2.0 + Float64(Float64(EAccept / KbT) + Float64(Float64(Ev / KbT) + Float64(Float64(Vef - mu) / KbT))))); elseif (t_1 <= 1e+179) tmp = Float64(NdChar / Float64(exp(Float64(mu / KbT)) + 1.0)); else tmp = t_0; end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = 0.5 * (NdChar + NaChar); t_1 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)))); tmp = 0.0; if (t_1 <= -2e-205) tmp = t_0; elseif (t_1 <= 0.0) tmp = NaChar / (2.0 + ((EAccept / KbT) + ((Ev / KbT) + ((Vef - mu) / KbT)))); elseif (t_1 <= 1e+179) tmp = NdChar / (exp((mu / KbT)) + 1.0); else tmp = t_0; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(1.0 + N[Exp[N[((-N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision]) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -2e-205], t$95$0, If[LessEqual[t$95$1, 0.0], N[(NaChar / N[(2.0 + N[(N[(EAccept / KbT), $MachinePrecision] + N[(N[(Ev / KbT), $MachinePrecision] + N[(N[(Vef - mu), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+179], N[(NdChar / N[(N[Exp[N[(mu / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := 0.5 \cdot \left(NdChar + NaChar\right)\\
t_1 := \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-205}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\frac{NaChar}{2 + \left(\frac{EAccept}{KbT} + \left(\frac{Ev}{KbT} + \frac{Vef - mu}{KbT}\right)\right)}\\
\mathbf{elif}\;t\_1 \leq 10^{+179}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{mu}{KbT}} + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -2e-205 or 9.9999999999999998e178 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6439.9
Applied rewrites39.9%
if -2e-205 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 0.0Initial program 100.0%
Taylor expanded in NdChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64100.0
Applied rewrites100.0%
Taylor expanded in Ev around 0
Applied rewrites95.6%
Taylor expanded in KbT around inf
Applied rewrites56.8%
if 0.0 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 9.9999999999999998e178Initial program 99.9%
lift-exp.f64N/A
lift-/.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64100.0
Applied rewrites100.0%
Taylor expanded in NdChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6454.9
Applied rewrites54.9%
Taylor expanded in mu around inf
Applied rewrites42.2%
Final simplification44.9%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))
(t_1
(+
(/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT))))
(/ NaChar (+ 1.0 t_0)))))
(if (or (<= t_1 -2e-205) (not (<= t_1 0.0)))
(+
(/ NdChar (+ (exp (/ (- (+ mu EDonor) Ec) KbT)) 1.0))
(/ NaChar (+ (exp (/ (- (+ EAccept Ev) mu) KbT)) 1.0)))
(/ NaChar (+ t_0 1.0)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = exp(((((Ev + Vef) + EAccept) - mu) / KbT));
double t_1 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + t_0));
double tmp;
if ((t_1 <= -2e-205) || !(t_1 <= 0.0)) {
tmp = (NdChar / (exp((((mu + EDonor) - Ec) / KbT)) + 1.0)) + (NaChar / (exp((((EAccept + Ev) - mu) / KbT)) + 1.0));
} else {
tmp = NaChar / (t_0 + 1.0);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = exp(((((ev + vef) + eaccept) - mu) / kbt))
t_1 = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + (nachar / (1.0d0 + t_0))
if ((t_1 <= (-2d-205)) .or. (.not. (t_1 <= 0.0d0))) then
tmp = (ndchar / (exp((((mu + edonor) - ec) / kbt)) + 1.0d0)) + (nachar / (exp((((eaccept + ev) - mu) / kbt)) + 1.0d0))
else
tmp = nachar / (t_0 + 1.0d0)
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT));
double t_1 = (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + t_0));
double tmp;
if ((t_1 <= -2e-205) || !(t_1 <= 0.0)) {
tmp = (NdChar / (Math.exp((((mu + EDonor) - Ec) / KbT)) + 1.0)) + (NaChar / (Math.exp((((EAccept + Ev) - mu) / KbT)) + 1.0));
} else {
tmp = NaChar / (t_0 + 1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) t_1 = (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + t_0)) tmp = 0 if (t_1 <= -2e-205) or not (t_1 <= 0.0): tmp = (NdChar / (math.exp((((mu + EDonor) - Ec) / KbT)) + 1.0)) + (NaChar / (math.exp((((EAccept + Ev) - mu) / KbT)) + 1.0)) else: tmp = NaChar / (t_0 + 1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)) t_1 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) + Float64(NaChar / Float64(1.0 + t_0))) tmp = 0.0 if ((t_1 <= -2e-205) || !(t_1 <= 0.0)) tmp = Float64(Float64(NdChar / Float64(exp(Float64(Float64(Float64(mu + EDonor) - Ec) / KbT)) + 1.0)) + Float64(NaChar / Float64(exp(Float64(Float64(Float64(EAccept + Ev) - mu) / KbT)) + 1.0))); else tmp = Float64(NaChar / Float64(t_0 + 1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = exp(((((Ev + Vef) + EAccept) - mu) / KbT)); t_1 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + t_0)); tmp = 0.0; if ((t_1 <= -2e-205) || ~((t_1 <= 0.0))) tmp = (NdChar / (exp((((mu + EDonor) - Ec) / KbT)) + 1.0)) + (NaChar / (exp((((EAccept + Ev) - mu) / KbT)) + 1.0)); else tmp = NaChar / (t_0 + 1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(1.0 + N[Exp[N[((-N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision]) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e-205], N[Not[LessEqual[t$95$1, 0.0]], $MachinePrecision]], N[(N[(NdChar / N[(N[Exp[N[(N[(N[(mu + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(N[Exp[N[(N[(N[(EAccept + Ev), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(NaChar / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}\\
t_1 := \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + t\_0}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-205} \lor \neg \left(t\_1 \leq 0\right):\\
\;\;\;\;\frac{NdChar}{e^{\frac{\left(mu + EDonor\right) - Ec}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}} + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{t\_0 + 1}\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -2e-205 or 0.0 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 99.9%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites90.8%
if -2e-205 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 0.0Initial program 100.0%
Taylor expanded in NdChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f64100.0
Applied rewrites100.0%
Final simplification93.1%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT)))))
(t_1 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))
(t_2 (+ t_0 (/ NaChar (+ 1.0 t_1)))))
(if (<= t_2 -2e-205)
(+
(/ NdChar (+ (exp (/ (- EDonor Ec) KbT)) 1.0))
(/ NaChar (+ (exp (/ (+ EAccept Ev) KbT)) 1.0)))
(if (<= t_2 4e-101)
(/ NaChar (+ t_1 1.0))
(+ t_0 (/ NaChar (+ 1.0 (exp (/ EAccept KbT)))))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)));
double t_1 = exp(((((Ev + Vef) + EAccept) - mu) / KbT));
double t_2 = t_0 + (NaChar / (1.0 + t_1));
double tmp;
if (t_2 <= -2e-205) {
tmp = (NdChar / (exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (exp(((EAccept + Ev) / KbT)) + 1.0));
} else if (t_2 <= 4e-101) {
tmp = NaChar / (t_1 + 1.0);
} else {
tmp = t_0 + (NaChar / (1.0 + exp((EAccept / KbT))));
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_0 = ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))
t_1 = exp(((((ev + vef) + eaccept) - mu) / kbt))
t_2 = t_0 + (nachar / (1.0d0 + t_1))
if (t_2 <= (-2d-205)) then
tmp = (ndchar / (exp(((edonor - ec) / kbt)) + 1.0d0)) + (nachar / (exp(((eaccept + ev) / kbt)) + 1.0d0))
else if (t_2 <= 4d-101) then
tmp = nachar / (t_1 + 1.0d0)
else
tmp = t_0 + (nachar / (1.0d0 + exp((eaccept / kbt))))
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)));
double t_1 = Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT));
double t_2 = t_0 + (NaChar / (1.0 + t_1));
double tmp;
if (t_2 <= -2e-205) {
tmp = (NdChar / (Math.exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (Math.exp(((EAccept + Ev) / KbT)) + 1.0));
} else if (t_2 <= 4e-101) {
tmp = NaChar / (t_1 + 1.0);
} else {
tmp = t_0 + (NaChar / (1.0 + Math.exp((EAccept / KbT))));
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT))) t_1 = math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) t_2 = t_0 + (NaChar / (1.0 + t_1)) tmp = 0 if t_2 <= -2e-205: tmp = (NdChar / (math.exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (math.exp(((EAccept + Ev) / KbT)) + 1.0)) elif t_2 <= 4e-101: tmp = NaChar / (t_1 + 1.0) else: tmp = t_0 + (NaChar / (1.0 + math.exp((EAccept / KbT)))) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) t_1 = exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)) t_2 = Float64(t_0 + Float64(NaChar / Float64(1.0 + t_1))) tmp = 0.0 if (t_2 <= -2e-205) tmp = Float64(Float64(NdChar / Float64(exp(Float64(Float64(EDonor - Ec) / KbT)) + 1.0)) + Float64(NaChar / Float64(exp(Float64(Float64(EAccept + Ev) / KbT)) + 1.0))); elseif (t_2 <= 4e-101) tmp = Float64(NaChar / Float64(t_1 + 1.0)); else tmp = Float64(t_0 + Float64(NaChar / Float64(1.0 + exp(Float64(EAccept / KbT))))); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT))); t_1 = exp(((((Ev + Vef) + EAccept) - mu) / KbT)); t_2 = t_0 + (NaChar / (1.0 + t_1)); tmp = 0.0; if (t_2 <= -2e-205) tmp = (NdChar / (exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (exp(((EAccept + Ev) / KbT)) + 1.0)); elseif (t_2 <= 4e-101) tmp = NaChar / (t_1 + 1.0); else tmp = t_0 + (NaChar / (1.0 + exp((EAccept / KbT)))); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(NdChar / N[(1.0 + N[Exp[N[((-N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision]) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 + N[(NaChar / N[(1.0 + t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e-205], N[(N[(NdChar / N[(N[Exp[N[(N[(EDonor - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(N[Exp[N[(N[(EAccept + Ev), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 4e-101], N[(NaChar / N[(t$95$1 + 1.0), $MachinePrecision]), $MachinePrecision], N[(t$95$0 + N[(NaChar / N[(1.0 + N[Exp[N[(EAccept / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}}\\
t_1 := e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}\\
t_2 := t\_0 + \frac{NaChar}{1 + t\_1}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{-205}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{EDonor - Ec}{KbT}} + 1} + \frac{NaChar}{e^{\frac{EAccept + Ev}{KbT}} + 1}\\
\mathbf{elif}\;t\_2 \leq 4 \cdot 10^{-101}:\\
\;\;\;\;\frac{NaChar}{t\_1 + 1}\\
\mathbf{else}:\\
\;\;\;\;t\_0 + \frac{NaChar}{1 + e^{\frac{EAccept}{KbT}}}\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -2e-205Initial program 100.0%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites89.5%
Taylor expanded in mu around 0
Applied rewrites80.0%
if -2e-205 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.00000000000000021e-101Initial program 100.0%
Taylor expanded in NdChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6493.4
Applied rewrites93.4%
if 4.00000000000000021e-101 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 99.9%
Taylor expanded in EAccept around inf
lower-/.f6478.8
Applied rewrites78.8%
Final simplification84.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))
(t_1
(+
(/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT))))
(/ NaChar (+ 1.0 t_0)))))
(if (or (<= t_1 -2e-205) (not (<= t_1 2e-28)))
(+
(/ NdChar (+ (exp (/ (- EDonor Ec) KbT)) 1.0))
(/ NaChar (+ (exp (/ (+ EAccept Ev) KbT)) 1.0)))
(/ NaChar (+ t_0 1.0)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = exp(((((Ev + Vef) + EAccept) - mu) / KbT));
double t_1 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + t_0));
double tmp;
if ((t_1 <= -2e-205) || !(t_1 <= 2e-28)) {
tmp = (NdChar / (exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (exp(((EAccept + Ev) / KbT)) + 1.0));
} else {
tmp = NaChar / (t_0 + 1.0);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: t_1
real(8) :: tmp
t_0 = exp(((((ev + vef) + eaccept) - mu) / kbt))
t_1 = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + (nachar / (1.0d0 + t_0))
if ((t_1 <= (-2d-205)) .or. (.not. (t_1 <= 2d-28))) then
tmp = (ndchar / (exp(((edonor - ec) / kbt)) + 1.0d0)) + (nachar / (exp(((eaccept + ev) / kbt)) + 1.0d0))
else
tmp = nachar / (t_0 + 1.0d0)
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT));
double t_1 = (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + t_0));
double tmp;
if ((t_1 <= -2e-205) || !(t_1 <= 2e-28)) {
tmp = (NdChar / (Math.exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (Math.exp(((EAccept + Ev) / KbT)) + 1.0));
} else {
tmp = NaChar / (t_0 + 1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) t_1 = (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + t_0)) tmp = 0 if (t_1 <= -2e-205) or not (t_1 <= 2e-28): tmp = (NdChar / (math.exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (math.exp(((EAccept + Ev) / KbT)) + 1.0)) else: tmp = NaChar / (t_0 + 1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)) t_1 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) + Float64(NaChar / Float64(1.0 + t_0))) tmp = 0.0 if ((t_1 <= -2e-205) || !(t_1 <= 2e-28)) tmp = Float64(Float64(NdChar / Float64(exp(Float64(Float64(EDonor - Ec) / KbT)) + 1.0)) + Float64(NaChar / Float64(exp(Float64(Float64(EAccept + Ev) / KbT)) + 1.0))); else tmp = Float64(NaChar / Float64(t_0 + 1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = exp(((((Ev + Vef) + EAccept) - mu) / KbT)); t_1 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + t_0)); tmp = 0.0; if ((t_1 <= -2e-205) || ~((t_1 <= 2e-28))) tmp = (NdChar / (exp(((EDonor - Ec) / KbT)) + 1.0)) + (NaChar / (exp(((EAccept + Ev) / KbT)) + 1.0)); else tmp = NaChar / (t_0 + 1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(NdChar / N[(1.0 + N[Exp[N[((-N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision]) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -2e-205], N[Not[LessEqual[t$95$1, 2e-28]], $MachinePrecision]], N[(N[(NdChar / N[(N[Exp[N[(N[(EDonor - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(N[Exp[N[(N[(EAccept + Ev), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(NaChar / N[(t$95$0 + 1.0), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}\\
t_1 := \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + t\_0}\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{-205} \lor \neg \left(t\_1 \leq 2 \cdot 10^{-28}\right):\\
\;\;\;\;\frac{NdChar}{e^{\frac{EDonor - Ec}{KbT}} + 1} + \frac{NaChar}{e^{\frac{EAccept + Ev}{KbT}} + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{t\_0 + 1}\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -2e-205 or 1.99999999999999994e-28 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 99.9%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites90.4%
Taylor expanded in mu around 0
Applied rewrites79.5%
if -2e-205 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 1.99999999999999994e-28Initial program 100.0%
Taylor expanded in NdChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6487.6
Applied rewrites87.6%
Final simplification82.6%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0
(+
(/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT))))
(/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))))))
(if (or (<= t_0 -2e-266) (not (<= t_0 4e-187)))
(* 0.5 (+ NdChar NaChar))
(* 0.5 (* (* NdChar NdChar) (pow (- NdChar NaChar) -1.0))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
double tmp;
if ((t_0 <= -2e-266) || !(t_0 <= 4e-187)) {
tmp = 0.5 * (NdChar + NaChar);
} else {
tmp = 0.5 * ((NdChar * NdChar) * pow((NdChar - NaChar), -1.0));
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + (nachar / (1.0d0 + exp(((((ev + vef) + eaccept) - mu) / kbt))))
if ((t_0 <= (-2d-266)) .or. (.not. (t_0 <= 4d-187))) then
tmp = 0.5d0 * (ndchar + nachar)
else
tmp = 0.5d0 * ((ndchar * ndchar) * ((ndchar - nachar) ** (-1.0d0)))
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
double tmp;
if ((t_0 <= -2e-266) || !(t_0 <= 4e-187)) {
tmp = 0.5 * (NdChar + NaChar);
} else {
tmp = 0.5 * ((NdChar * NdChar) * Math.pow((NdChar - NaChar), -1.0));
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) tmp = 0 if (t_0 <= -2e-266) or not (t_0 <= 4e-187): tmp = 0.5 * (NdChar + NaChar) else: tmp = 0.5 * ((NdChar * NdChar) * math.pow((NdChar - NaChar), -1.0)) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) + Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT))))) tmp = 0.0 if ((t_0 <= -2e-266) || !(t_0 <= 4e-187)) tmp = Float64(0.5 * Float64(NdChar + NaChar)); else tmp = Float64(0.5 * Float64(Float64(NdChar * NdChar) * (Float64(NdChar - NaChar) ^ -1.0))); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)))); tmp = 0.0; if ((t_0 <= -2e-266) || ~((t_0 <= 4e-187))) tmp = 0.5 * (NdChar + NaChar); else tmp = 0.5 * ((NdChar * NdChar) * ((NdChar - NaChar) ^ -1.0)); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NdChar / N[(1.0 + N[Exp[N[((-N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision]) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -2e-266], N[Not[LessEqual[t$95$0, 4e-187]], $MachinePrecision]], N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision], N[(0.5 * N[(N[(NdChar * NdChar), $MachinePrecision] * N[Power[N[(NdChar - NaChar), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-266} \lor \neg \left(t\_0 \leq 4 \cdot 10^{-187}\right):\\
\;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot \left(\left(NdChar \cdot NdChar\right) \cdot {\left(NdChar - NaChar\right)}^{-1}\right)\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -2e-266 or 4.0000000000000001e-187 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 99.9%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6435.7
Applied rewrites35.7%
if -2e-266 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 4.0000000000000001e-187Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f642.8
Applied rewrites2.8%
Applied rewrites10.5%
Taylor expanded in NdChar around inf
Applied rewrites27.3%
Final simplification33.3%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0
(+
(/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT))))
(/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))))))
(if (or (<= t_0 -2e-205) (not (<= t_0 2e-111)))
(* 0.5 (+ NdChar NaChar))
(/
NaChar
(+ 2.0 (+ (/ EAccept KbT) (+ (/ Ev KbT) (/ (- Vef mu) KbT))))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
double tmp;
if ((t_0 <= -2e-205) || !(t_0 <= 2e-111)) {
tmp = 0.5 * (NdChar + NaChar);
} else {
tmp = NaChar / (2.0 + ((EAccept / KbT) + ((Ev / KbT) + ((Vef - mu) / KbT))));
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: t_0
real(8) :: tmp
t_0 = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + (nachar / (1.0d0 + exp(((((ev + vef) + eaccept) - mu) / kbt))))
if ((t_0 <= (-2d-205)) .or. (.not. (t_0 <= 2d-111))) then
tmp = 0.5d0 * (ndchar + nachar)
else
tmp = nachar / (2.0d0 + ((eaccept / kbt) + ((ev / kbt) + ((vef - mu) / kbt))))
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
double tmp;
if ((t_0 <= -2e-205) || !(t_0 <= 2e-111)) {
tmp = 0.5 * (NdChar + NaChar);
} else {
tmp = NaChar / (2.0 + ((EAccept / KbT) + ((Ev / KbT) + ((Vef - mu) / KbT))));
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) tmp = 0 if (t_0 <= -2e-205) or not (t_0 <= 2e-111): tmp = 0.5 * (NdChar + NaChar) else: tmp = NaChar / (2.0 + ((EAccept / KbT) + ((Ev / KbT) + ((Vef - mu) / KbT)))) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) + Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT))))) tmp = 0.0 if ((t_0 <= -2e-205) || !(t_0 <= 2e-111)) tmp = Float64(0.5 * Float64(NdChar + NaChar)); else tmp = Float64(NaChar / Float64(2.0 + Float64(Float64(EAccept / KbT) + Float64(Float64(Ev / KbT) + Float64(Float64(Vef - mu) / KbT))))); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)))); tmp = 0.0; if ((t_0 <= -2e-205) || ~((t_0 <= 2e-111))) tmp = 0.5 * (NdChar + NaChar); else tmp = NaChar / (2.0 + ((EAccept / KbT) + ((Ev / KbT) + ((Vef - mu) / KbT)))); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NdChar / N[(1.0 + N[Exp[N[((-N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision]) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -2e-205], N[Not[LessEqual[t$95$0, 2e-111]], $MachinePrecision]], N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision], N[(NaChar / N[(2.0 + N[(N[(EAccept / KbT), $MachinePrecision] + N[(N[(Ev / KbT), $MachinePrecision] + N[(N[(Vef - mu), $MachinePrecision] / KbT), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-205} \lor \neg \left(t\_0 \leq 2 \cdot 10^{-111}\right):\\
\;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{2 + \left(\frac{EAccept}{KbT} + \left(\frac{Ev}{KbT} + \frac{Vef - mu}{KbT}\right)\right)}\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -2e-205 or 2.00000000000000018e-111 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 99.9%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6437.0
Applied rewrites37.0%
if -2e-205 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 2.00000000000000018e-111Initial program 100.0%
Taylor expanded in NdChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6493.2
Applied rewrites93.2%
Taylor expanded in Ev around 0
Applied rewrites87.5%
Taylor expanded in KbT around inf
Applied rewrites48.5%
Final simplification40.7%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(let* ((t_0
(+
(/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT))))
(/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)))))))
(if (or (<= t_0 -2e-205) (not (<= t_0 5e-176)))
(* 0.5 (+ NdChar NaChar))
(* (/ 2.0 (- NdChar NaChar)) (* -0.25 (* NaChar NaChar))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double t_0 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
double tmp;
if ((t_0 <= -2e-205) || !(t_0 <= 5e-176)) {
tmp = 0.5 * (NdChar + NaChar);
} else {
tmp = (2.0 / (NdChar - NaChar)) * (-0.25 * (NaChar * 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 = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + (nachar / (1.0d0 + exp(((((ev + vef) + eaccept) - mu) / kbt))))
if ((t_0 <= (-2d-205)) .or. (.not. (t_0 <= 5d-176))) then
tmp = 0.5d0 * (ndchar + nachar)
else
tmp = (2.0d0 / (ndchar - nachar)) * ((-0.25d0) * (nachar * 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 = (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
double tmp;
if ((t_0 <= -2e-205) || !(t_0 <= 5e-176)) {
tmp = 0.5 * (NdChar + NaChar);
} else {
tmp = (2.0 / (NdChar - NaChar)) * (-0.25 * (NaChar * NaChar));
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): t_0 = (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)))) tmp = 0 if (t_0 <= -2e-205) or not (t_0 <= 5e-176): tmp = 0.5 * (NdChar + NaChar) else: tmp = (2.0 / (NdChar - NaChar)) * (-0.25 * (NaChar * NaChar)) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) + Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT))))) tmp = 0.0 if ((t_0 <= -2e-205) || !(t_0 <= 5e-176)) tmp = Float64(0.5 * Float64(NdChar + NaChar)); else tmp = Float64(Float64(2.0 / Float64(NdChar - NaChar)) * Float64(-0.25 * Float64(NaChar * NaChar))); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) t_0 = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)))); tmp = 0.0; if ((t_0 <= -2e-205) || ~((t_0 <= 5e-176))) tmp = 0.5 * (NdChar + NaChar); else tmp = (2.0 / (NdChar - NaChar)) * (-0.25 * (NaChar * NaChar)); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := Block[{t$95$0 = N[(N[(NdChar / N[(1.0 + N[Exp[N[((-N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision]) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$0, -2e-205], N[Not[LessEqual[t$95$0, 5e-176]], $MachinePrecision]], N[(0.5 * N[(NdChar + NaChar), $MachinePrecision]), $MachinePrecision], N[(N[(2.0 / N[(NdChar - NaChar), $MachinePrecision]), $MachinePrecision] * N[(-0.25 * N[(NaChar * NaChar), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}}\\
\mathbf{if}\;t\_0 \leq -2 \cdot 10^{-205} \lor \neg \left(t\_0 \leq 5 \cdot 10^{-176}\right):\\
\;\;\;\;0.5 \cdot \left(NdChar + NaChar\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{2}{NdChar - NaChar} \cdot \left(-0.25 \cdot \left(NaChar \cdot NaChar\right)\right)\\
\end{array}
\end{array}
if (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < -2e-205 or 5e-176 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) Initial program 99.9%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6436.4
Applied rewrites36.4%
if -2e-205 < (+.f64 (/.f64 NdChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (neg.f64 (-.f64 (-.f64 (-.f64 Ec Vef) EDonor) mu)) KbT)))) (/.f64 NaChar (+.f64 #s(literal 1 binary64) (exp.f64 (/.f64 (+.f64 (+.f64 (+.f64 Ev Vef) EAccept) (neg.f64 mu)) KbT))))) < 5e-176Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f642.9
Applied rewrites2.9%
Applied rewrites10.2%
Applied rewrites10.2%
Taylor expanded in NdChar around 0
Applied rewrites26.6%
Final simplification33.4%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(if (or (<= Vef -7e+100) (not (<= Vef 3.8e+122)))
(+
(/ NdChar (+ 1.0 (pow (E) (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT))))
(/ NaChar (+ 1.0 (exp (/ Vef KbT)))))
(+
(/ NdChar (+ (exp (/ (- (+ mu EDonor) Ec) KbT)) 1.0))
(/ NaChar (+ (exp (/ (- (+ EAccept Ev) mu) KbT)) 1.0)))))\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;Vef \leq -7 \cdot 10^{+100} \lor \neg \left(Vef \leq 3.8 \cdot 10^{+122}\right):\\
\;\;\;\;\frac{NdChar}{1 + {\mathsf{E}\left(\right)}^{\left(\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{Vef}{KbT}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{\left(mu + EDonor\right) - Ec}{KbT}} + 1} + \frac{NaChar}{e^{\frac{\left(EAccept + Ev\right) - mu}{KbT}} + 1}\\
\end{array}
\end{array}
if Vef < -6.99999999999999953e100 or 3.7999999999999998e122 < Vef Initial program 100.0%
lift-exp.f64N/A
lift-/.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64100.0
Applied rewrites100.0%
lift-exp.f64N/A
exp-1-eN/A
lower-E.f64100.0
Applied rewrites100.0%
Taylor expanded in Vef around inf
lower-/.f6488.2
Applied rewrites88.2%
if -6.99999999999999953e100 < Vef < 3.7999999999999998e122Initial program 99.9%
Taylor expanded in Vef around 0
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
Applied rewrites99.4%
Final simplification95.2%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (+ (/ NdChar (+ 1.0 (pow (E) (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT)))) (/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT))))))
\begin{array}{l}
\\
\frac{NdChar}{1 + {\mathsf{E}\left(\right)}^{\left(\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}\right)}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}}
\end{array}
Initial program 100.0%
lift-exp.f64N/A
lift-/.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64100.0
Applied rewrites100.0%
lift-exp.f64N/A
exp-1-eN/A
lower-E.f64100.0
Applied rewrites100.0%
Final simplification100.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (+ (/ NdChar (+ 1.0 (exp (/ (- (- (- (- Ec Vef) EDonor) mu)) KbT)))) (/ NaChar (+ 1.0 (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT))))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
code = (ndchar / (1.0d0 + exp((-(((ec - vef) - edonor) - mu) / kbt)))) + (nachar / (1.0d0 + exp(((((ev + vef) + eaccept) - mu) / kbt))))
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return (NdChar / (1.0 + Math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT))));
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): return (NdChar / (1.0 + math.exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + math.exp(((((Ev + Vef) + EAccept) - mu) / KbT))))
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) return Float64(Float64(NdChar / Float64(1.0 + exp(Float64(Float64(-Float64(Float64(Float64(Ec - Vef) - EDonor) - mu)) / KbT)))) + Float64(NaChar / Float64(1.0 + exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT))))) end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = (NdChar / (1.0 + exp((-(((Ec - Vef) - EDonor) - mu) / KbT)))) + (NaChar / (1.0 + exp(((((Ev + Vef) + EAccept) - mu) / KbT)))); end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(N[(NdChar / N[(1.0 + N[Exp[N[((-N[(N[(N[(Ec - Vef), $MachinePrecision] - EDonor), $MachinePrecision] - mu), $MachinePrecision]) / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(NaChar / N[(1.0 + N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{NdChar}{1 + e^{\frac{-\left(\left(\left(Ec - Vef\right) - EDonor\right) - mu\right)}{KbT}}} + \frac{NaChar}{1 + e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}}}
\end{array}
Initial program 100.0%
Final simplification100.0%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (if (or (<= NaChar -3.5e+79) (not (<= NaChar 2.2e-147))) (/ NaChar (+ (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)) 1.0)) (/ NdChar (+ (exp (/ (- (+ (+ mu Vef) EDonor) Ec) KbT)) 1.0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if ((NaChar <= -3.5e+79) || !(NaChar <= 2.2e-147)) {
tmp = NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) + 1.0);
} else {
tmp = NdChar / (exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: tmp
if ((nachar <= (-3.5d+79)) .or. (.not. (nachar <= 2.2d-147))) then
tmp = nachar / (exp(((((ev + vef) + eaccept) - mu) / kbt)) + 1.0d0)
else
tmp = ndchar / (exp(((((mu + vef) + edonor) - ec) / kbt)) + 1.0d0)
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if ((NaChar <= -3.5e+79) || !(NaChar <= 2.2e-147)) {
tmp = NaChar / (Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) + 1.0);
} else {
tmp = NdChar / (Math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if (NaChar <= -3.5e+79) or not (NaChar <= 2.2e-147): tmp = NaChar / (math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) + 1.0) else: tmp = NdChar / (math.exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if ((NaChar <= -3.5e+79) || !(NaChar <= 2.2e-147)) tmp = Float64(NaChar / Float64(exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)) + 1.0)); else tmp = Float64(NdChar / Float64(exp(Float64(Float64(Float64(Float64(mu + Vef) + EDonor) - Ec) / KbT)) + 1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if ((NaChar <= -3.5e+79) || ~((NaChar <= 2.2e-147))) tmp = NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) + 1.0); else tmp = NdChar / (exp(((((mu + Vef) + EDonor) - Ec) / KbT)) + 1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[Or[LessEqual[NaChar, -3.5e+79], N[Not[LessEqual[NaChar, 2.2e-147]], $MachinePrecision]], N[(NaChar / N[(N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(NdChar / N[(N[Exp[N[(N[(N[(N[(mu + Vef), $MachinePrecision] + EDonor), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;NaChar \leq -3.5 \cdot 10^{+79} \lor \neg \left(NaChar \leq 2.2 \cdot 10^{-147}\right):\\
\;\;\;\;\frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{\left(\left(mu + Vef\right) + EDonor\right) - Ec}{KbT}} + 1}\\
\end{array}
\end{array}
if NaChar < -3.4999999999999998e79 or 2.2000000000000001e-147 < NaChar Initial program 100.0%
Taylor expanded in NdChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6479.1
Applied rewrites79.1%
if -3.4999999999999998e79 < NaChar < 2.2000000000000001e-147Initial program 99.9%
lift-exp.f64N/A
lift-/.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64100.0
Applied rewrites100.0%
Taylor expanded in NdChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6474.5
Applied rewrites74.5%
Final simplification76.8%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (if (or (<= NaChar -1.5) (not (<= NaChar 2.6e-154))) (/ NaChar (+ (exp (/ (- (+ (+ Ev Vef) EAccept) mu) KbT)) 1.0)) (/ NdChar (+ (exp (/ (- (+ mu Vef) Ec) KbT)) 1.0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if ((NaChar <= -1.5) || !(NaChar <= 2.6e-154)) {
tmp = NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) + 1.0);
} else {
tmp = NdChar / (exp((((mu + Vef) - Ec) / KbT)) + 1.0);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: tmp
if ((nachar <= (-1.5d0)) .or. (.not. (nachar <= 2.6d-154))) then
tmp = nachar / (exp(((((ev + vef) + eaccept) - mu) / kbt)) + 1.0d0)
else
tmp = ndchar / (exp((((mu + vef) - ec) / kbt)) + 1.0d0)
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if ((NaChar <= -1.5) || !(NaChar <= 2.6e-154)) {
tmp = NaChar / (Math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) + 1.0);
} else {
tmp = NdChar / (Math.exp((((mu + Vef) - Ec) / KbT)) + 1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if (NaChar <= -1.5) or not (NaChar <= 2.6e-154): tmp = NaChar / (math.exp(((((Ev + Vef) + EAccept) - mu) / KbT)) + 1.0) else: tmp = NdChar / (math.exp((((mu + Vef) - Ec) / KbT)) + 1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if ((NaChar <= -1.5) || !(NaChar <= 2.6e-154)) tmp = Float64(NaChar / Float64(exp(Float64(Float64(Float64(Float64(Ev + Vef) + EAccept) - mu) / KbT)) + 1.0)); else tmp = Float64(NdChar / Float64(exp(Float64(Float64(Float64(mu + Vef) - Ec) / KbT)) + 1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if ((NaChar <= -1.5) || ~((NaChar <= 2.6e-154))) tmp = NaChar / (exp(((((Ev + Vef) + EAccept) - mu) / KbT)) + 1.0); else tmp = NdChar / (exp((((mu + Vef) - Ec) / KbT)) + 1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[Or[LessEqual[NaChar, -1.5], N[Not[LessEqual[NaChar, 2.6e-154]], $MachinePrecision]], N[(NaChar / N[(N[Exp[N[(N[(N[(N[(Ev + Vef), $MachinePrecision] + EAccept), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(NdChar / N[(N[Exp[N[(N[(N[(mu + Vef), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;NaChar \leq -1.5 \lor \neg \left(NaChar \leq 2.6 \cdot 10^{-154}\right):\\
\;\;\;\;\frac{NaChar}{e^{\frac{\left(\left(Ev + Vef\right) + EAccept\right) - mu}{KbT}} + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{\left(mu + Vef\right) - Ec}{KbT}} + 1}\\
\end{array}
\end{array}
if NaChar < -1.5 or 2.6e-154 < NaChar Initial program 100.0%
Taylor expanded in NdChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6476.2
Applied rewrites76.2%
if -1.5 < NaChar < 2.6e-154Initial program 99.9%
lift-exp.f64N/A
lift-/.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64100.0
Applied rewrites100.0%
Taylor expanded in NdChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6476.9
Applied rewrites76.9%
Taylor expanded in EDonor around 0
Applied rewrites71.7%
Final simplification74.6%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (if (or (<= NaChar -4.8e+79) (not (<= NaChar 1e-153))) (/ NaChar (+ (exp (/ (- (+ EAccept Vef) mu) KbT)) 1.0)) (/ NdChar (+ (exp (/ (- (+ mu Vef) Ec) KbT)) 1.0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if ((NaChar <= -4.8e+79) || !(NaChar <= 1e-153)) {
tmp = NaChar / (exp((((EAccept + Vef) - mu) / KbT)) + 1.0);
} else {
tmp = NdChar / (exp((((mu + Vef) - Ec) / KbT)) + 1.0);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: tmp
if ((nachar <= (-4.8d+79)) .or. (.not. (nachar <= 1d-153))) then
tmp = nachar / (exp((((eaccept + vef) - mu) / kbt)) + 1.0d0)
else
tmp = ndchar / (exp((((mu + vef) - ec) / kbt)) + 1.0d0)
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if ((NaChar <= -4.8e+79) || !(NaChar <= 1e-153)) {
tmp = NaChar / (Math.exp((((EAccept + Vef) - mu) / KbT)) + 1.0);
} else {
tmp = NdChar / (Math.exp((((mu + Vef) - Ec) / KbT)) + 1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if (NaChar <= -4.8e+79) or not (NaChar <= 1e-153): tmp = NaChar / (math.exp((((EAccept + Vef) - mu) / KbT)) + 1.0) else: tmp = NdChar / (math.exp((((mu + Vef) - Ec) / KbT)) + 1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if ((NaChar <= -4.8e+79) || !(NaChar <= 1e-153)) tmp = Float64(NaChar / Float64(exp(Float64(Float64(Float64(EAccept + Vef) - mu) / KbT)) + 1.0)); else tmp = Float64(NdChar / Float64(exp(Float64(Float64(Float64(mu + Vef) - Ec) / KbT)) + 1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if ((NaChar <= -4.8e+79) || ~((NaChar <= 1e-153))) tmp = NaChar / (exp((((EAccept + Vef) - mu) / KbT)) + 1.0); else tmp = NdChar / (exp((((mu + Vef) - Ec) / KbT)) + 1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[Or[LessEqual[NaChar, -4.8e+79], N[Not[LessEqual[NaChar, 1e-153]], $MachinePrecision]], N[(NaChar / N[(N[Exp[N[(N[(N[(EAccept + Vef), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(NdChar / N[(N[Exp[N[(N[(N[(mu + Vef), $MachinePrecision] - Ec), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;NaChar \leq -4.8 \cdot 10^{+79} \lor \neg \left(NaChar \leq 10^{-153}\right):\\
\;\;\;\;\frac{NaChar}{e^{\frac{\left(EAccept + Vef\right) - mu}{KbT}} + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{\left(mu + Vef\right) - Ec}{KbT}} + 1}\\
\end{array}
\end{array}
if NaChar < -4.79999999999999971e79 or 1.00000000000000004e-153 < NaChar Initial program 100.0%
Taylor expanded in NdChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6478.8
Applied rewrites78.8%
Taylor expanded in Ev around 0
Applied rewrites72.8%
if -4.79999999999999971e79 < NaChar < 1.00000000000000004e-153Initial program 99.9%
lift-exp.f64N/A
lift-/.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64100.0
Applied rewrites100.0%
Taylor expanded in NdChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6474.6
Applied rewrites74.6%
Taylor expanded in EDonor around 0
Applied rewrites69.9%
Final simplification71.4%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (if (or (<= NaChar -6.6e-218) (not (<= NaChar 3.7e-168))) (/ NaChar (+ (exp (/ (- (+ EAccept Vef) mu) KbT)) 1.0)) (/ NdChar (+ (exp (/ (- Ec) KbT)) 1.0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if ((NaChar <= -6.6e-218) || !(NaChar <= 3.7e-168)) {
tmp = NaChar / (exp((((EAccept + Vef) - mu) / KbT)) + 1.0);
} else {
tmp = NdChar / (exp((-Ec / KbT)) + 1.0);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: tmp
if ((nachar <= (-6.6d-218)) .or. (.not. (nachar <= 3.7d-168))) then
tmp = nachar / (exp((((eaccept + vef) - mu) / kbt)) + 1.0d0)
else
tmp = ndchar / (exp((-ec / kbt)) + 1.0d0)
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if ((NaChar <= -6.6e-218) || !(NaChar <= 3.7e-168)) {
tmp = NaChar / (Math.exp((((EAccept + Vef) - mu) / KbT)) + 1.0);
} else {
tmp = NdChar / (Math.exp((-Ec / KbT)) + 1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if (NaChar <= -6.6e-218) or not (NaChar <= 3.7e-168): tmp = NaChar / (math.exp((((EAccept + Vef) - mu) / KbT)) + 1.0) else: tmp = NdChar / (math.exp((-Ec / KbT)) + 1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if ((NaChar <= -6.6e-218) || !(NaChar <= 3.7e-168)) tmp = Float64(NaChar / Float64(exp(Float64(Float64(Float64(EAccept + Vef) - mu) / KbT)) + 1.0)); else tmp = Float64(NdChar / Float64(exp(Float64(Float64(-Ec) / KbT)) + 1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if ((NaChar <= -6.6e-218) || ~((NaChar <= 3.7e-168))) tmp = NaChar / (exp((((EAccept + Vef) - mu) / KbT)) + 1.0); else tmp = NdChar / (exp((-Ec / KbT)) + 1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[Or[LessEqual[NaChar, -6.6e-218], N[Not[LessEqual[NaChar, 3.7e-168]], $MachinePrecision]], N[(NaChar / N[(N[Exp[N[(N[(N[(EAccept + Vef), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(NdChar / N[(N[Exp[N[((-Ec) / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;NaChar \leq -6.6 \cdot 10^{-218} \lor \neg \left(NaChar \leq 3.7 \cdot 10^{-168}\right):\\
\;\;\;\;\frac{NaChar}{e^{\frac{\left(EAccept + Vef\right) - mu}{KbT}} + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{-Ec}{KbT}} + 1}\\
\end{array}
\end{array}
if NaChar < -6.60000000000000046e-218 or 3.69999999999999997e-168 < NaChar Initial program 100.0%
Taylor expanded in NdChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6472.0
Applied rewrites72.0%
Taylor expanded in Ev around 0
Applied rewrites67.2%
if -6.60000000000000046e-218 < NaChar < 3.69999999999999997e-168Initial program 99.9%
lift-exp.f64N/A
lift-/.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f6499.9
Applied rewrites99.9%
Taylor expanded in NdChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6484.4
Applied rewrites84.4%
Taylor expanded in Ec around inf
Applied rewrites57.2%
Final simplification65.3%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept)
:precision binary64
(if (<= EAccept 2.4e+90)
(/ NaChar (+ (exp (/ (- (+ Ev Vef) mu) KbT)) 1.0))
(if (<= EAccept 1.35e+103)
(/ NdChar (+ (exp (/ mu KbT)) 1.0))
(/ NaChar (+ (exp (/ (- (+ EAccept Vef) mu) KbT)) 1.0)))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (EAccept <= 2.4e+90) {
tmp = NaChar / (exp((((Ev + Vef) - mu) / KbT)) + 1.0);
} else if (EAccept <= 1.35e+103) {
tmp = NdChar / (exp((mu / KbT)) + 1.0);
} else {
tmp = NaChar / (exp((((EAccept + Vef) - mu) / KbT)) + 1.0);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: tmp
if (eaccept <= 2.4d+90) then
tmp = nachar / (exp((((ev + vef) - mu) / kbt)) + 1.0d0)
else if (eaccept <= 1.35d+103) then
tmp = ndchar / (exp((mu / kbt)) + 1.0d0)
else
tmp = nachar / (exp((((eaccept + vef) - mu) / kbt)) + 1.0d0)
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if (EAccept <= 2.4e+90) {
tmp = NaChar / (Math.exp((((Ev + Vef) - mu) / KbT)) + 1.0);
} else if (EAccept <= 1.35e+103) {
tmp = NdChar / (Math.exp((mu / KbT)) + 1.0);
} else {
tmp = NaChar / (Math.exp((((EAccept + Vef) - mu) / KbT)) + 1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if EAccept <= 2.4e+90: tmp = NaChar / (math.exp((((Ev + Vef) - mu) / KbT)) + 1.0) elif EAccept <= 1.35e+103: tmp = NdChar / (math.exp((mu / KbT)) + 1.0) else: tmp = NaChar / (math.exp((((EAccept + Vef) - mu) / KbT)) + 1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if (EAccept <= 2.4e+90) tmp = Float64(NaChar / Float64(exp(Float64(Float64(Float64(Ev + Vef) - mu) / KbT)) + 1.0)); elseif (EAccept <= 1.35e+103) tmp = Float64(NdChar / Float64(exp(Float64(mu / KbT)) + 1.0)); else tmp = Float64(NaChar / Float64(exp(Float64(Float64(Float64(EAccept + Vef) - mu) / KbT)) + 1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if (EAccept <= 2.4e+90) tmp = NaChar / (exp((((Ev + Vef) - mu) / KbT)) + 1.0); elseif (EAccept <= 1.35e+103) tmp = NdChar / (exp((mu / KbT)) + 1.0); else tmp = NaChar / (exp((((EAccept + Vef) - mu) / KbT)) + 1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[LessEqual[EAccept, 2.4e+90], N[(NaChar / N[(N[Exp[N[(N[(N[(Ev + Vef), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[EAccept, 1.35e+103], N[(NdChar / N[(N[Exp[N[(mu / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(NaChar / N[(N[Exp[N[(N[(N[(EAccept + Vef), $MachinePrecision] - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;EAccept \leq 2.4 \cdot 10^{+90}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{\left(Ev + Vef\right) - mu}{KbT}} + 1}\\
\mathbf{elif}\;EAccept \leq 1.35 \cdot 10^{+103}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{mu}{KbT}} + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{\left(EAccept + Vef\right) - mu}{KbT}} + 1}\\
\end{array}
\end{array}
if EAccept < 2.4000000000000001e90Initial program 99.9%
Taylor expanded in NdChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6466.2
Applied rewrites66.2%
Taylor expanded in EAccept around 0
Applied rewrites62.7%
if 2.4000000000000001e90 < EAccept < 1.34999999999999996e103Initial program 100.0%
lift-exp.f64N/A
lift-/.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64100.0
Applied rewrites100.0%
Taylor expanded in NdChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f64100.0
Applied rewrites100.0%
Taylor expanded in mu around inf
Applied rewrites72.9%
if 1.34999999999999996e103 < EAccept Initial program 100.0%
Taylor expanded in NdChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6473.1
Applied rewrites73.1%
Taylor expanded in Ev around 0
Applied rewrites73.1%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (if (or (<= Vef -2.5e-25) (not (<= Vef 3e+96))) (/ NaChar (+ (exp (/ (- Vef mu) KbT)) 1.0)) (/ NaChar (+ (exp (/ (- EAccept mu) KbT)) 1.0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if ((Vef <= -2.5e-25) || !(Vef <= 3e+96)) {
tmp = NaChar / (exp(((Vef - mu) / KbT)) + 1.0);
} else {
tmp = NaChar / (exp(((EAccept - mu) / KbT)) + 1.0);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: tmp
if ((vef <= (-2.5d-25)) .or. (.not. (vef <= 3d+96))) then
tmp = nachar / (exp(((vef - mu) / kbt)) + 1.0d0)
else
tmp = nachar / (exp(((eaccept - mu) / kbt)) + 1.0d0)
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if ((Vef <= -2.5e-25) || !(Vef <= 3e+96)) {
tmp = NaChar / (Math.exp(((Vef - mu) / KbT)) + 1.0);
} else {
tmp = NaChar / (Math.exp(((EAccept - mu) / KbT)) + 1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if (Vef <= -2.5e-25) or not (Vef <= 3e+96): tmp = NaChar / (math.exp(((Vef - mu) / KbT)) + 1.0) else: tmp = NaChar / (math.exp(((EAccept - mu) / KbT)) + 1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if ((Vef <= -2.5e-25) || !(Vef <= 3e+96)) tmp = Float64(NaChar / Float64(exp(Float64(Float64(Vef - mu) / KbT)) + 1.0)); else tmp = Float64(NaChar / Float64(exp(Float64(Float64(EAccept - mu) / KbT)) + 1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if ((Vef <= -2.5e-25) || ~((Vef <= 3e+96))) tmp = NaChar / (exp(((Vef - mu) / KbT)) + 1.0); else tmp = NaChar / (exp(((EAccept - mu) / KbT)) + 1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[Or[LessEqual[Vef, -2.5e-25], N[Not[LessEqual[Vef, 3e+96]], $MachinePrecision]], N[(NaChar / N[(N[Exp[N[(N[(Vef - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(NaChar / N[(N[Exp[N[(N[(EAccept - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;Vef \leq -2.5 \cdot 10^{-25} \lor \neg \left(Vef \leq 3 \cdot 10^{+96}\right):\\
\;\;\;\;\frac{NaChar}{e^{\frac{Vef - mu}{KbT}} + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept - mu}{KbT}} + 1}\\
\end{array}
\end{array}
if Vef < -2.49999999999999981e-25 or 3e96 < Vef Initial program 100.0%
Taylor expanded in NdChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6473.3
Applied rewrites73.3%
Taylor expanded in Ev around 0
Applied rewrites71.7%
Taylor expanded in EAccept around 0
Applied rewrites67.7%
if -2.49999999999999981e-25 < Vef < 3e96Initial program 99.9%
Taylor expanded in NdChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6461.2
Applied rewrites61.2%
Taylor expanded in Ev around 0
Applied rewrites54.1%
Taylor expanded in Vef around 0
Applied rewrites54.8%
Final simplification60.6%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (if (or (<= NaChar -4.8e+77) (not (<= NaChar 3.8e-116))) (/ NaChar (+ (exp (/ (- EAccept mu) KbT)) 1.0)) (/ NdChar (+ (exp (/ (- Ec) KbT)) 1.0))))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if ((NaChar <= -4.8e+77) || !(NaChar <= 3.8e-116)) {
tmp = NaChar / (exp(((EAccept - mu) / KbT)) + 1.0);
} else {
tmp = NdChar / (exp((-Ec / KbT)) + 1.0);
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: tmp
if ((nachar <= (-4.8d+77)) .or. (.not. (nachar <= 3.8d-116))) then
tmp = nachar / (exp(((eaccept - mu) / kbt)) + 1.0d0)
else
tmp = ndchar / (exp((-ec / kbt)) + 1.0d0)
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if ((NaChar <= -4.8e+77) || !(NaChar <= 3.8e-116)) {
tmp = NaChar / (Math.exp(((EAccept - mu) / KbT)) + 1.0);
} else {
tmp = NdChar / (Math.exp((-Ec / KbT)) + 1.0);
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if (NaChar <= -4.8e+77) or not (NaChar <= 3.8e-116): tmp = NaChar / (math.exp(((EAccept - mu) / KbT)) + 1.0) else: tmp = NdChar / (math.exp((-Ec / KbT)) + 1.0) return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if ((NaChar <= -4.8e+77) || !(NaChar <= 3.8e-116)) tmp = Float64(NaChar / Float64(exp(Float64(Float64(EAccept - mu) / KbT)) + 1.0)); else tmp = Float64(NdChar / Float64(exp(Float64(Float64(-Ec) / KbT)) + 1.0)); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if ((NaChar <= -4.8e+77) || ~((NaChar <= 3.8e-116))) tmp = NaChar / (exp(((EAccept - mu) / KbT)) + 1.0); else tmp = NdChar / (exp((-Ec / KbT)) + 1.0); end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[Or[LessEqual[NaChar, -4.8e+77], N[Not[LessEqual[NaChar, 3.8e-116]], $MachinePrecision]], N[(NaChar / N[(N[Exp[N[(N[(EAccept - mu), $MachinePrecision] / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision], N[(NdChar / N[(N[Exp[N[((-Ec) / KbT), $MachinePrecision]], $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;NaChar \leq -4.8 \cdot 10^{+77} \lor \neg \left(NaChar \leq 3.8 \cdot 10^{-116}\right):\\
\;\;\;\;\frac{NaChar}{e^{\frac{EAccept - mu}{KbT}} + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{NdChar}{e^{\frac{-Ec}{KbT}} + 1}\\
\end{array}
\end{array}
if NaChar < -4.7999999999999997e77 or 3.8000000000000001e-116 < NaChar Initial program 100.0%
Taylor expanded in NdChar around 0
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-+.f6478.6
Applied rewrites78.6%
Taylor expanded in Ev around 0
Applied rewrites72.3%
Taylor expanded in Vef around 0
Applied rewrites58.9%
if -4.7999999999999997e77 < NaChar < 3.8000000000000001e-116Initial program 99.9%
lift-exp.f64N/A
lift-/.f64N/A
clear-numN/A
div-invN/A
clear-numN/A
lift-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64100.0
Applied rewrites100.0%
Taylor expanded in NdChar around inf
lower-/.f64N/A
+-commutativeN/A
lower-+.f64N/A
lower-exp.f64N/A
lower-/.f64N/A
lower--.f64N/A
+-commutativeN/A
lower-+.f64N/A
+-commutativeN/A
lower-+.f6474.3
Applied rewrites74.3%
Taylor expanded in Ec around inf
Applied rewrites45.9%
Final simplification52.4%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (if (or (<= NaChar -1.22e+97) (not (<= NaChar 2.05e-147))) (* 0.5 NaChar) (* 0.5 NdChar)))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if ((NaChar <= -1.22e+97) || !(NaChar <= 2.05e-147)) {
tmp = 0.5 * NaChar;
} else {
tmp = 0.5 * NdChar;
}
return tmp;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
real(8) :: tmp
if ((nachar <= (-1.22d+97)) .or. (.not. (nachar <= 2.05d-147))) then
tmp = 0.5d0 * nachar
else
tmp = 0.5d0 * ndchar
end if
code = tmp
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
double tmp;
if ((NaChar <= -1.22e+97) || !(NaChar <= 2.05e-147)) {
tmp = 0.5 * NaChar;
} else {
tmp = 0.5 * NdChar;
}
return tmp;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): tmp = 0 if (NaChar <= -1.22e+97) or not (NaChar <= 2.05e-147): tmp = 0.5 * NaChar else: tmp = 0.5 * NdChar return tmp
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0 if ((NaChar <= -1.22e+97) || !(NaChar <= 2.05e-147)) tmp = Float64(0.5 * NaChar); else tmp = Float64(0.5 * NdChar); end return tmp end
function tmp_2 = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.0; if ((NaChar <= -1.22e+97) || ~((NaChar <= 2.05e-147))) tmp = 0.5 * NaChar; else tmp = 0.5 * NdChar; end tmp_2 = tmp; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := If[Or[LessEqual[NaChar, -1.22e+97], N[Not[LessEqual[NaChar, 2.05e-147]], $MachinePrecision]], N[(0.5 * NaChar), $MachinePrecision], N[(0.5 * NdChar), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;NaChar \leq -1.22 \cdot 10^{+97} \lor \neg \left(NaChar \leq 2.05 \cdot 10^{-147}\right):\\
\;\;\;\;0.5 \cdot NaChar\\
\mathbf{else}:\\
\;\;\;\;0.5 \cdot NdChar\\
\end{array}
\end{array}
if NaChar < -1.21999999999999997e97 or 2.05e-147 < NaChar Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6430.2
Applied rewrites30.2%
Taylor expanded in NdChar around 0
Applied rewrites28.0%
if -1.21999999999999997e97 < NaChar < 2.05e-147Initial program 99.9%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6422.5
Applied rewrites22.5%
Taylor expanded in NdChar around inf
Applied rewrites21.1%
Final simplification24.5%
(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%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6426.3
Applied rewrites26.3%
(FPCore (NdChar Ec Vef EDonor mu KbT NaChar Ev EAccept) :precision binary64 (* 0.5 NaChar))
double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return 0.5 * NaChar;
}
real(8) function code(ndchar, ec, vef, edonor, mu, kbt, nachar, ev, eaccept)
real(8), intent (in) :: ndchar
real(8), intent (in) :: ec
real(8), intent (in) :: vef
real(8), intent (in) :: edonor
real(8), intent (in) :: mu
real(8), intent (in) :: kbt
real(8), intent (in) :: nachar
real(8), intent (in) :: ev
real(8), intent (in) :: eaccept
code = 0.5d0 * nachar
end function
public static double code(double NdChar, double Ec, double Vef, double EDonor, double mu, double KbT, double NaChar, double Ev, double EAccept) {
return 0.5 * NaChar;
}
def code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept): return 0.5 * NaChar
function code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) return Float64(0.5 * NaChar) end
function tmp = code(NdChar, Ec, Vef, EDonor, mu, KbT, NaChar, Ev, EAccept) tmp = 0.5 * NaChar; end
code[NdChar_, Ec_, Vef_, EDonor_, mu_, KbT_, NaChar_, Ev_, EAccept_] := N[(0.5 * NaChar), $MachinePrecision]
\begin{array}{l}
\\
0.5 \cdot NaChar
\end{array}
Initial program 100.0%
Taylor expanded in KbT around inf
+-commutativeN/A
distribute-lft-outN/A
lower-*.f64N/A
lower-+.f6426.3
Applied rewrites26.3%
Taylor expanded in NdChar around 0
Applied rewrites19.1%
herbie shell --seed 2024315
(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))))))