
(FPCore (w l) :precision binary64 (* (exp (- w)) (pow l (exp w))))
double code(double w, double l) {
return exp(-w) * pow(l, exp(w));
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = exp(-w) * (l ** exp(w))
end function
public static double code(double w, double l) {
return Math.exp(-w) * Math.pow(l, Math.exp(w));
}
def code(w, l): return math.exp(-w) * math.pow(l, math.exp(w))
function code(w, l) return Float64(exp(Float64(-w)) * (l ^ exp(w))) end
function tmp = code(w, l) tmp = exp(-w) * (l ^ exp(w)); end
code[w_, l_] := N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (w l) :precision binary64 (* (exp (- w)) (pow l (exp w))))
double code(double w, double l) {
return exp(-w) * pow(l, exp(w));
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = exp(-w) * (l ** exp(w))
end function
public static double code(double w, double l) {
return Math.exp(-w) * Math.pow(l, Math.exp(w));
}
def code(w, l): return math.exp(-w) * math.pow(l, math.exp(w))
function code(w, l) return Float64(exp(Float64(-w)) * (l ^ exp(w))) end
function tmp = code(w, l) tmp = exp(-w) * (l ^ exp(w)); end
code[w_, l_] := N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\end{array}
(FPCore (w l)
:precision binary64
(let* ((t_0 (pow l (exp w))))
(if (<= (* t_0 (exp (- w))) 1e+305)
(/ t_0 (exp w))
(exp (- (* (exp w) (log l)) w)))))
double code(double w, double l) {
double t_0 = pow(l, exp(w));
double tmp;
if ((t_0 * exp(-w)) <= 1e+305) {
tmp = t_0 / exp(w);
} else {
tmp = exp(((exp(w) * log(l)) - w));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = l ** exp(w)
if ((t_0 * exp(-w)) <= 1d+305) then
tmp = t_0 / exp(w)
else
tmp = exp(((exp(w) * log(l)) - w))
end if
code = tmp
end function
public static double code(double w, double l) {
double t_0 = Math.pow(l, Math.exp(w));
double tmp;
if ((t_0 * Math.exp(-w)) <= 1e+305) {
tmp = t_0 / Math.exp(w);
} else {
tmp = Math.exp(((Math.exp(w) * Math.log(l)) - w));
}
return tmp;
}
def code(w, l): t_0 = math.pow(l, math.exp(w)) tmp = 0 if (t_0 * math.exp(-w)) <= 1e+305: tmp = t_0 / math.exp(w) else: tmp = math.exp(((math.exp(w) * math.log(l)) - w)) return tmp
function code(w, l) t_0 = l ^ exp(w) tmp = 0.0 if (Float64(t_0 * exp(Float64(-w))) <= 1e+305) tmp = Float64(t_0 / exp(w)); else tmp = exp(Float64(Float64(exp(w) * log(l)) - w)); end return tmp end
function tmp_2 = code(w, l) t_0 = l ^ exp(w); tmp = 0.0; if ((t_0 * exp(-w)) <= 1e+305) tmp = t_0 / exp(w); else tmp = exp(((exp(w) * log(l)) - w)); end tmp_2 = tmp; end
code[w_, l_] := Block[{t$95$0 = N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[N[(t$95$0 * N[Exp[(-w)], $MachinePrecision]), $MachinePrecision], 1e+305], N[(t$95$0 / N[Exp[w], $MachinePrecision]), $MachinePrecision], N[Exp[N[(N[(N[Exp[w], $MachinePrecision] * N[Log[l], $MachinePrecision]), $MachinePrecision] - w), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\ell}^{\left(e^{w}\right)}\\
\mathbf{if}\;t_0 \cdot e^{-w} \leq 10^{+305}:\\
\;\;\;\;\frac{t_0}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;e^{e^{w} \cdot \log \ell - w}\\
\end{array}
\end{array}
if (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) < 9.9999999999999994e304Initial program 99.7%
exp-neg99.7%
associate-*l/99.7%
*-lft-identity99.7%
Simplified99.7%
if 9.9999999999999994e304 < (*.f64 (exp.f64 (neg.f64 w)) (pow.f64 l (exp.f64 w))) Initial program 93.2%
exp-neg93.2%
associate-*l/93.2%
*-lft-identity93.2%
Simplified93.2%
add-exp-log93.2%
log-div93.2%
log-pow93.2%
add-log-exp100.0%
Applied egg-rr100.0%
Final simplification99.8%
(FPCore (w l) :precision binary64 (/ (/ (pow l (exp w)) (cbrt (exp w))) (cbrt (pow (exp w) 2.0))))
double code(double w, double l) {
return (pow(l, exp(w)) / cbrt(exp(w))) / cbrt(pow(exp(w), 2.0));
}
public static double code(double w, double l) {
return (Math.pow(l, Math.exp(w)) / Math.cbrt(Math.exp(w))) / Math.cbrt(Math.pow(Math.exp(w), 2.0));
}
function code(w, l) return Float64(Float64((l ^ exp(w)) / cbrt(exp(w))) / cbrt((exp(w) ^ 2.0))) end
code[w_, l_] := N[(N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[Power[N[Exp[w], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision] / N[Power[N[Power[N[Exp[w], $MachinePrecision], 2.0], $MachinePrecision], 1/3], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{{\ell}^{\left(e^{w}\right)}}{\sqrt[3]{e^{w}}}}{\sqrt[3]{{\left(e^{w}\right)}^{2}}}
\end{array}
Initial program 98.2%
exp-neg98.2%
associate-*l/98.2%
*-lft-identity98.2%
Simplified98.2%
*-un-lft-identity98.2%
add-cube-cbrt98.2%
times-frac98.2%
cbrt-unprod98.2%
prod-exp98.2%
Applied egg-rr98.2%
associate-*l/98.2%
*-lft-identity98.2%
count-298.2%
*-commutative98.2%
exp-prod98.2%
Simplified98.2%
Final simplification98.2%
(FPCore (w l)
:precision binary64
(if (<= w -0.0036)
(/ (exp (log l)) (exp w))
(if (<= w 0.045)
(+ l (* w (- (* l (log l)) l)))
(if (<= w 1e+18) (log (exp l)) (/ (* (log l) (* l w)) (exp w))))))
double code(double w, double l) {
double tmp;
if (w <= -0.0036) {
tmp = exp(log(l)) / exp(w);
} else if (w <= 0.045) {
tmp = l + (w * ((l * log(l)) - l));
} else if (w <= 1e+18) {
tmp = log(exp(l));
} else {
tmp = (log(l) * (l * w)) / exp(w);
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-0.0036d0)) then
tmp = exp(log(l)) / exp(w)
else if (w <= 0.045d0) then
tmp = l + (w * ((l * log(l)) - l))
else if (w <= 1d+18) then
tmp = log(exp(l))
else
tmp = (log(l) * (l * w)) / exp(w)
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -0.0036) {
tmp = Math.exp(Math.log(l)) / Math.exp(w);
} else if (w <= 0.045) {
tmp = l + (w * ((l * Math.log(l)) - l));
} else if (w <= 1e+18) {
tmp = Math.log(Math.exp(l));
} else {
tmp = (Math.log(l) * (l * w)) / Math.exp(w);
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.0036: tmp = math.exp(math.log(l)) / math.exp(w) elif w <= 0.045: tmp = l + (w * ((l * math.log(l)) - l)) elif w <= 1e+18: tmp = math.log(math.exp(l)) else: tmp = (math.log(l) * (l * w)) / math.exp(w) return tmp
function code(w, l) tmp = 0.0 if (w <= -0.0036) tmp = Float64(exp(log(l)) / exp(w)); elseif (w <= 0.045) tmp = Float64(l + Float64(w * Float64(Float64(l * log(l)) - l))); elseif (w <= 1e+18) tmp = log(exp(l)); else tmp = Float64(Float64(log(l) * Float64(l * w)) / exp(w)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.0036) tmp = exp(log(l)) / exp(w); elseif (w <= 0.045) tmp = l + (w * ((l * log(l)) - l)); elseif (w <= 1e+18) tmp = log(exp(l)); else tmp = (log(l) * (l * w)) / exp(w); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.0036], N[(N[Exp[N[Log[l], $MachinePrecision]], $MachinePrecision] / N[Exp[w], $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 0.045], N[(l + N[(w * N[(N[(l * N[Log[l], $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[w, 1e+18], N[Log[N[Exp[l], $MachinePrecision]], $MachinePrecision], N[(N[(N[Log[l], $MachinePrecision] * N[(l * w), $MachinePrecision]), $MachinePrecision] / N[Exp[w], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.0036:\\
\;\;\;\;\frac{e^{\log \ell}}{e^{w}}\\
\mathbf{elif}\;w \leq 0.045:\\
\;\;\;\;\ell + w \cdot \left(\ell \cdot \log \ell - \ell\right)\\
\mathbf{elif}\;w \leq 10^{+18}:\\
\;\;\;\;\log \left(e^{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\log \ell \cdot \left(\ell \cdot w\right)}{e^{w}}\\
\end{array}
\end{array}
if w < -0.0035999999999999999Initial program 99.9%
exp-neg99.9%
associate-*l/99.9%
*-lft-identity99.9%
Simplified99.9%
add-exp-log99.9%
log-pow99.9%
Applied egg-rr99.9%
Taylor expanded in w around 0 96.8%
if -0.0035999999999999999 < w < 0.044999999999999998Initial program 99.6%
exp-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
Simplified99.6%
Taylor expanded in w around 0 99.2%
if 0.044999999999999998 < w < 1e18Initial program 33.3%
exp-neg33.3%
associate-*l/33.3%
*-lft-identity33.3%
Simplified33.3%
add-cube-cbrt33.3%
pow333.3%
Applied egg-rr33.3%
Taylor expanded in w around 0 8.2%
unpow1/38.2%
rem-cube-cbrt8.2%
add-log-exp100.0%
Applied egg-rr100.0%
if 1e18 < w Initial program 100.0%
exp-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in w around 0 100.0%
associate-*r*100.0%
Simplified100.0%
Taylor expanded in w around inf 100.0%
associate-*r*100.0%
Simplified100.0%
Final simplification98.8%
(FPCore (w l) :precision binary64 (/ (pow l (exp w)) (exp w)))
double code(double w, double l) {
return pow(l, exp(w)) / exp(w);
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = (l ** exp(w)) / exp(w)
end function
public static double code(double w, double l) {
return Math.pow(l, Math.exp(w)) / Math.exp(w);
}
def code(w, l): return math.pow(l, math.exp(w)) / math.exp(w)
function code(w, l) return Float64((l ^ exp(w)) / exp(w)) end
function tmp = code(w, l) tmp = (l ^ exp(w)) / exp(w); end
code[w_, l_] := N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[Exp[w], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}
\end{array}
Initial program 98.2%
exp-neg98.2%
associate-*l/98.2%
*-lft-identity98.2%
Simplified98.2%
Final simplification98.2%
(FPCore (w l)
:precision binary64
(let* ((t_0 (log (exp l))) (t_1 (log1p (expm1 (/ 1.0 l)))))
(if (<= w -9.2e+266)
t_0
(if (<= w -1e+35)
t_1
(if (<= w -1.8e+20)
t_0
(if (<= w -0.64)
t_1
(if (<= w 0.075) (+ l (* w (- (* l (log l)) l))) t_0)))))))
double code(double w, double l) {
double t_0 = log(exp(l));
double t_1 = log1p(expm1((1.0 / l)));
double tmp;
if (w <= -9.2e+266) {
tmp = t_0;
} else if (w <= -1e+35) {
tmp = t_1;
} else if (w <= -1.8e+20) {
tmp = t_0;
} else if (w <= -0.64) {
tmp = t_1;
} else if (w <= 0.075) {
tmp = l + (w * ((l * log(l)) - l));
} else {
tmp = t_0;
}
return tmp;
}
public static double code(double w, double l) {
double t_0 = Math.log(Math.exp(l));
double t_1 = Math.log1p(Math.expm1((1.0 / l)));
double tmp;
if (w <= -9.2e+266) {
tmp = t_0;
} else if (w <= -1e+35) {
tmp = t_1;
} else if (w <= -1.8e+20) {
tmp = t_0;
} else if (w <= -0.64) {
tmp = t_1;
} else if (w <= 0.075) {
tmp = l + (w * ((l * Math.log(l)) - l));
} else {
tmp = t_0;
}
return tmp;
}
def code(w, l): t_0 = math.log(math.exp(l)) t_1 = math.log1p(math.expm1((1.0 / l))) tmp = 0 if w <= -9.2e+266: tmp = t_0 elif w <= -1e+35: tmp = t_1 elif w <= -1.8e+20: tmp = t_0 elif w <= -0.64: tmp = t_1 elif w <= 0.075: tmp = l + (w * ((l * math.log(l)) - l)) else: tmp = t_0 return tmp
function code(w, l) t_0 = log(exp(l)) t_1 = log1p(expm1(Float64(1.0 / l))) tmp = 0.0 if (w <= -9.2e+266) tmp = t_0; elseif (w <= -1e+35) tmp = t_1; elseif (w <= -1.8e+20) tmp = t_0; elseif (w <= -0.64) tmp = t_1; elseif (w <= 0.075) tmp = Float64(l + Float64(w * Float64(Float64(l * log(l)) - l))); else tmp = t_0; end return tmp end
code[w_, l_] := Block[{t$95$0 = N[Log[N[Exp[l], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Log[1 + N[(Exp[N[(1.0 / l), $MachinePrecision]] - 1), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[w, -9.2e+266], t$95$0, If[LessEqual[w, -1e+35], t$95$1, If[LessEqual[w, -1.8e+20], t$95$0, If[LessEqual[w, -0.64], t$95$1, If[LessEqual[w, 0.075], N[(l + N[(w * N[(N[(l * N[Log[l], $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(e^{\ell}\right)\\
t_1 := \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{1}{\ell}\right)\right)\\
\mathbf{if}\;w \leq -9.2 \cdot 10^{+266}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;w \leq -1 \cdot 10^{+35}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;w \leq -1.8 \cdot 10^{+20}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;w \leq -0.64:\\
\;\;\;\;t_1\\
\mathbf{elif}\;w \leq 0.075:\\
\;\;\;\;\ell + w \cdot \left(\ell \cdot \log \ell - \ell\right)\\
\mathbf{else}:\\
\;\;\;\;t_0\\
\end{array}
\end{array}
if w < -9.2000000000000004e266 or -9.9999999999999997e34 < w < -1.8e20 or 0.0749999999999999972 < w Initial program 93.2%
exp-neg93.2%
associate-*l/93.2%
*-lft-identity93.2%
Simplified93.2%
add-cube-cbrt93.2%
pow393.2%
Applied egg-rr93.2%
Taylor expanded in w around 0 5.3%
unpow1/35.3%
rem-cube-cbrt5.3%
add-log-exp91.7%
Applied egg-rr91.7%
if -9.2000000000000004e266 < w < -9.9999999999999997e34 or -1.8e20 < w < -0.640000000000000013Initial program 99.9%
exp-neg99.9%
associate-*l/99.9%
*-lft-identity99.9%
Simplified99.9%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in w around 0 3.2%
unpow1/33.2%
rem-cube-cbrt3.2%
add-exp-log3.2%
add-sqr-sqrt1.6%
sqrt-unprod5.5%
sqr-neg5.5%
sqrt-unprod3.9%
add-sqr-sqrt4.8%
rec-exp4.8%
add-exp-log4.8%
add-sqr-sqrt4.8%
associate-/r*4.8%
Applied egg-rr4.8%
log1p-expm1-u69.3%
associate-/l/69.3%
add-sqr-sqrt69.3%
Applied egg-rr69.3%
if -0.640000000000000013 < w < 0.0749999999999999972Initial program 99.6%
exp-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
Simplified99.6%
Taylor expanded in w around 0 99.2%
Final simplification92.7%
(FPCore (w l)
:precision binary64
(let* ((t_0 (log (exp l))))
(if (<= w -3.1e+262)
t_0
(if (<= w -2.05e+35)
(/ (* (log l) (* l w)) (exp w))
(if (or (<= w -0.58) (not (<= w 0.028)))
t_0
(+ l (* w (- (* l (log l)) l))))))))
double code(double w, double l) {
double t_0 = log(exp(l));
double tmp;
if (w <= -3.1e+262) {
tmp = t_0;
} else if (w <= -2.05e+35) {
tmp = (log(l) * (l * w)) / exp(w);
} else if ((w <= -0.58) || !(w <= 0.028)) {
tmp = t_0;
} else {
tmp = l + (w * ((l * log(l)) - l));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = log(exp(l))
if (w <= (-3.1d+262)) then
tmp = t_0
else if (w <= (-2.05d+35)) then
tmp = (log(l) * (l * w)) / exp(w)
else if ((w <= (-0.58d0)) .or. (.not. (w <= 0.028d0))) then
tmp = t_0
else
tmp = l + (w * ((l * log(l)) - l))
end if
code = tmp
end function
public static double code(double w, double l) {
double t_0 = Math.log(Math.exp(l));
double tmp;
if (w <= -3.1e+262) {
tmp = t_0;
} else if (w <= -2.05e+35) {
tmp = (Math.log(l) * (l * w)) / Math.exp(w);
} else if ((w <= -0.58) || !(w <= 0.028)) {
tmp = t_0;
} else {
tmp = l + (w * ((l * Math.log(l)) - l));
}
return tmp;
}
def code(w, l): t_0 = math.log(math.exp(l)) tmp = 0 if w <= -3.1e+262: tmp = t_0 elif w <= -2.05e+35: tmp = (math.log(l) * (l * w)) / math.exp(w) elif (w <= -0.58) or not (w <= 0.028): tmp = t_0 else: tmp = l + (w * ((l * math.log(l)) - l)) return tmp
function code(w, l) t_0 = log(exp(l)) tmp = 0.0 if (w <= -3.1e+262) tmp = t_0; elseif (w <= -2.05e+35) tmp = Float64(Float64(log(l) * Float64(l * w)) / exp(w)); elseif ((w <= -0.58) || !(w <= 0.028)) tmp = t_0; else tmp = Float64(l + Float64(w * Float64(Float64(l * log(l)) - l))); end return tmp end
function tmp_2 = code(w, l) t_0 = log(exp(l)); tmp = 0.0; if (w <= -3.1e+262) tmp = t_0; elseif (w <= -2.05e+35) tmp = (log(l) * (l * w)) / exp(w); elseif ((w <= -0.58) || ~((w <= 0.028))) tmp = t_0; else tmp = l + (w * ((l * log(l)) - l)); end tmp_2 = tmp; end
code[w_, l_] := Block[{t$95$0 = N[Log[N[Exp[l], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[w, -3.1e+262], t$95$0, If[LessEqual[w, -2.05e+35], N[(N[(N[Log[l], $MachinePrecision] * N[(l * w), $MachinePrecision]), $MachinePrecision] / N[Exp[w], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[w, -0.58], N[Not[LessEqual[w, 0.028]], $MachinePrecision]], t$95$0, N[(l + N[(w * N[(N[(l * N[Log[l], $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(e^{\ell}\right)\\
\mathbf{if}\;w \leq -3.1 \cdot 10^{+262}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;w \leq -2.05 \cdot 10^{+35}:\\
\;\;\;\;\frac{\log \ell \cdot \left(\ell \cdot w\right)}{e^{w}}\\
\mathbf{elif}\;w \leq -0.58 \lor \neg \left(w \leq 0.028\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\ell + w \cdot \left(\ell \cdot \log \ell - \ell\right)\\
\end{array}
\end{array}
if w < -3.09999999999999991e262 or -2.0499999999999999e35 < w < -0.57999999999999996 or 0.0280000000000000006 < w Initial program 93.5%
exp-neg93.5%
associate-*l/93.5%
*-lft-identity93.5%
Simplified93.5%
add-cube-cbrt93.5%
pow393.5%
Applied egg-rr93.5%
Taylor expanded in w around 0 5.4%
unpow1/35.4%
rem-cube-cbrt5.4%
add-log-exp87.4%
Applied egg-rr87.4%
if -3.09999999999999991e262 < w < -2.0499999999999999e35Initial program 100.0%
exp-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in w around 0 73.7%
associate-*r*73.7%
Simplified73.7%
Taylor expanded in w around inf 73.7%
associate-*r*73.7%
Simplified73.7%
if -0.57999999999999996 < w < 0.0280000000000000006Initial program 99.6%
exp-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
Simplified99.6%
Taylor expanded in w around 0 99.2%
Final simplification92.5%
(FPCore (w l)
:precision binary64
(let* ((t_0 (* w (- (* l (log l)) l))))
(if (<= w -4.5e+262)
(+ l (fabs t_0))
(if (<= w -8.1e+34)
(/ (* (log l) (* l w)) (exp w))
(if (or (<= w -0.35) (not (<= w 0.04))) (log (exp l)) (+ l t_0))))))
double code(double w, double l) {
double t_0 = w * ((l * log(l)) - l);
double tmp;
if (w <= -4.5e+262) {
tmp = l + fabs(t_0);
} else if (w <= -8.1e+34) {
tmp = (log(l) * (l * w)) / exp(w);
} else if ((w <= -0.35) || !(w <= 0.04)) {
tmp = log(exp(l));
} else {
tmp = l + t_0;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = w * ((l * log(l)) - l)
if (w <= (-4.5d+262)) then
tmp = l + abs(t_0)
else if (w <= (-8.1d+34)) then
tmp = (log(l) * (l * w)) / exp(w)
else if ((w <= (-0.35d0)) .or. (.not. (w <= 0.04d0))) then
tmp = log(exp(l))
else
tmp = l + t_0
end if
code = tmp
end function
public static double code(double w, double l) {
double t_0 = w * ((l * Math.log(l)) - l);
double tmp;
if (w <= -4.5e+262) {
tmp = l + Math.abs(t_0);
} else if (w <= -8.1e+34) {
tmp = (Math.log(l) * (l * w)) / Math.exp(w);
} else if ((w <= -0.35) || !(w <= 0.04)) {
tmp = Math.log(Math.exp(l));
} else {
tmp = l + t_0;
}
return tmp;
}
def code(w, l): t_0 = w * ((l * math.log(l)) - l) tmp = 0 if w <= -4.5e+262: tmp = l + math.fabs(t_0) elif w <= -8.1e+34: tmp = (math.log(l) * (l * w)) / math.exp(w) elif (w <= -0.35) or not (w <= 0.04): tmp = math.log(math.exp(l)) else: tmp = l + t_0 return tmp
function code(w, l) t_0 = Float64(w * Float64(Float64(l * log(l)) - l)) tmp = 0.0 if (w <= -4.5e+262) tmp = Float64(l + abs(t_0)); elseif (w <= -8.1e+34) tmp = Float64(Float64(log(l) * Float64(l * w)) / exp(w)); elseif ((w <= -0.35) || !(w <= 0.04)) tmp = log(exp(l)); else tmp = Float64(l + t_0); end return tmp end
function tmp_2 = code(w, l) t_0 = w * ((l * log(l)) - l); tmp = 0.0; if (w <= -4.5e+262) tmp = l + abs(t_0); elseif (w <= -8.1e+34) tmp = (log(l) * (l * w)) / exp(w); elseif ((w <= -0.35) || ~((w <= 0.04))) tmp = log(exp(l)); else tmp = l + t_0; end tmp_2 = tmp; end
code[w_, l_] := Block[{t$95$0 = N[(w * N[(N[(l * N[Log[l], $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[w, -4.5e+262], N[(l + N[Abs[t$95$0], $MachinePrecision]), $MachinePrecision], If[LessEqual[w, -8.1e+34], N[(N[(N[Log[l], $MachinePrecision] * N[(l * w), $MachinePrecision]), $MachinePrecision] / N[Exp[w], $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[w, -0.35], N[Not[LessEqual[w, 0.04]], $MachinePrecision]], N[Log[N[Exp[l], $MachinePrecision]], $MachinePrecision], N[(l + t$95$0), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := w \cdot \left(\ell \cdot \log \ell - \ell\right)\\
\mathbf{if}\;w \leq -4.5 \cdot 10^{+262}:\\
\;\;\;\;\ell + \left|t_0\right|\\
\mathbf{elif}\;w \leq -8.1 \cdot 10^{+34}:\\
\;\;\;\;\frac{\log \ell \cdot \left(\ell \cdot w\right)}{e^{w}}\\
\mathbf{elif}\;w \leq -0.35 \lor \neg \left(w \leq 0.04\right):\\
\;\;\;\;\log \left(e^{\ell}\right)\\
\mathbf{else}:\\
\;\;\;\;\ell + t_0\\
\end{array}
\end{array}
if w < -4.49999999999999972e262Initial program 100.0%
exp-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in w around 0 1.4%
add-sqr-sqrt1.4%
sqrt-unprod89.3%
pow289.3%
add-log-exp89.3%
*-commutative89.3%
exp-to-pow89.3%
Applied egg-rr89.3%
unpow289.3%
rem-sqrt-square79.1%
sub-neg79.1%
sub-neg79.1%
log-pow79.1%
Simplified79.1%
if -4.49999999999999972e262 < w < -8.1000000000000001e34Initial program 100.0%
exp-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
Simplified100.0%
Taylor expanded in w around 0 73.7%
associate-*r*73.7%
Simplified73.7%
Taylor expanded in w around inf 73.7%
associate-*r*73.7%
Simplified73.7%
if -8.1000000000000001e34 < w < -0.34999999999999998 or 0.0400000000000000008 < w Initial program 92.4%
exp-neg92.4%
associate-*l/92.4%
*-lft-identity92.4%
Simplified92.4%
add-cube-cbrt92.4%
pow392.3%
Applied egg-rr92.3%
Taylor expanded in w around 0 5.6%
unpow1/35.6%
rem-cube-cbrt5.6%
add-log-exp89.0%
Applied egg-rr89.0%
if -0.34999999999999998 < w < 0.0400000000000000008Initial program 99.6%
exp-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
Simplified99.6%
Taylor expanded in w around 0 99.2%
Final simplification92.6%
(FPCore (w l) :precision binary64 (if (<= l 0.55) (/ (+ l (* (log l) (* l w))) (exp w)) (+ l (fabs (* w (- (* l (log l)) l))))))
double code(double w, double l) {
double tmp;
if (l <= 0.55) {
tmp = (l + (log(l) * (l * w))) / exp(w);
} else {
tmp = l + fabs((w * ((l * log(l)) - l)));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (l <= 0.55d0) then
tmp = (l + (log(l) * (l * w))) / exp(w)
else
tmp = l + abs((w * ((l * log(l)) - l)))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (l <= 0.55) {
tmp = (l + (Math.log(l) * (l * w))) / Math.exp(w);
} else {
tmp = l + Math.abs((w * ((l * Math.log(l)) - l)));
}
return tmp;
}
def code(w, l): tmp = 0 if l <= 0.55: tmp = (l + (math.log(l) * (l * w))) / math.exp(w) else: tmp = l + math.fabs((w * ((l * math.log(l)) - l))) return tmp
function code(w, l) tmp = 0.0 if (l <= 0.55) tmp = Float64(Float64(l + Float64(log(l) * Float64(l * w))) / exp(w)); else tmp = Float64(l + abs(Float64(w * Float64(Float64(l * log(l)) - l)))); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (l <= 0.55) tmp = (l + (log(l) * (l * w))) / exp(w); else tmp = l + abs((w * ((l * log(l)) - l))); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[l, 0.55], N[(N[(l + N[(N[Log[l], $MachinePrecision] * N[(l * w), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[Exp[w], $MachinePrecision]), $MachinePrecision], N[(l + N[Abs[N[(w * N[(N[(l * N[Log[l], $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\ell \leq 0.55:\\
\;\;\;\;\frac{\ell + \log \ell \cdot \left(\ell \cdot w\right)}{e^{w}}\\
\mathbf{else}:\\
\;\;\;\;\ell + \left|w \cdot \left(\ell \cdot \log \ell - \ell\right)\right|\\
\end{array}
\end{array}
if l < 0.55000000000000004Initial program 99.8%
exp-neg99.8%
associate-*l/99.8%
*-lft-identity99.8%
Simplified99.8%
Taylor expanded in w around 0 99.1%
associate-*r*99.1%
Simplified99.1%
if 0.55000000000000004 < l Initial program 96.1%
exp-neg96.1%
associate-*l/96.1%
*-lft-identity96.1%
Simplified96.1%
Taylor expanded in w around 0 75.4%
add-sqr-sqrt31.1%
sqrt-unprod88.3%
pow288.3%
add-log-exp29.8%
*-commutative29.8%
exp-to-pow29.8%
Applied egg-rr29.8%
unpow229.8%
rem-sqrt-square29.8%
sub-neg29.8%
sub-neg29.8%
log-pow85.0%
Simplified85.0%
Final simplification92.9%
(FPCore (w l)
:precision binary64
(let* ((t_0 (log (exp l))))
(if (<= w -3e+259)
t_0
(if (<= w -1.96e+64)
(sqrt (/ (/ 1.0 l) l))
(if (or (<= w -0.092) (not (<= w 0.049)))
t_0
(+ l (* w (- (* l (log l)) l))))))))
double code(double w, double l) {
double t_0 = log(exp(l));
double tmp;
if (w <= -3e+259) {
tmp = t_0;
} else if (w <= -1.96e+64) {
tmp = sqrt(((1.0 / l) / l));
} else if ((w <= -0.092) || !(w <= 0.049)) {
tmp = t_0;
} else {
tmp = l + (w * ((l * log(l)) - l));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: t_0
real(8) :: tmp
t_0 = log(exp(l))
if (w <= (-3d+259)) then
tmp = t_0
else if (w <= (-1.96d+64)) then
tmp = sqrt(((1.0d0 / l) / l))
else if ((w <= (-0.092d0)) .or. (.not. (w <= 0.049d0))) then
tmp = t_0
else
tmp = l + (w * ((l * log(l)) - l))
end if
code = tmp
end function
public static double code(double w, double l) {
double t_0 = Math.log(Math.exp(l));
double tmp;
if (w <= -3e+259) {
tmp = t_0;
} else if (w <= -1.96e+64) {
tmp = Math.sqrt(((1.0 / l) / l));
} else if ((w <= -0.092) || !(w <= 0.049)) {
tmp = t_0;
} else {
tmp = l + (w * ((l * Math.log(l)) - l));
}
return tmp;
}
def code(w, l): t_0 = math.log(math.exp(l)) tmp = 0 if w <= -3e+259: tmp = t_0 elif w <= -1.96e+64: tmp = math.sqrt(((1.0 / l) / l)) elif (w <= -0.092) or not (w <= 0.049): tmp = t_0 else: tmp = l + (w * ((l * math.log(l)) - l)) return tmp
function code(w, l) t_0 = log(exp(l)) tmp = 0.0 if (w <= -3e+259) tmp = t_0; elseif (w <= -1.96e+64) tmp = sqrt(Float64(Float64(1.0 / l) / l)); elseif ((w <= -0.092) || !(w <= 0.049)) tmp = t_0; else tmp = Float64(l + Float64(w * Float64(Float64(l * log(l)) - l))); end return tmp end
function tmp_2 = code(w, l) t_0 = log(exp(l)); tmp = 0.0; if (w <= -3e+259) tmp = t_0; elseif (w <= -1.96e+64) tmp = sqrt(((1.0 / l) / l)); elseif ((w <= -0.092) || ~((w <= 0.049))) tmp = t_0; else tmp = l + (w * ((l * log(l)) - l)); end tmp_2 = tmp; end
code[w_, l_] := Block[{t$95$0 = N[Log[N[Exp[l], $MachinePrecision]], $MachinePrecision]}, If[LessEqual[w, -3e+259], t$95$0, If[LessEqual[w, -1.96e+64], N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision], If[Or[LessEqual[w, -0.092], N[Not[LessEqual[w, 0.049]], $MachinePrecision]], t$95$0, N[(l + N[(w * N[(N[(l * N[Log[l], $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \log \left(e^{\ell}\right)\\
\mathbf{if}\;w \leq -3 \cdot 10^{+259}:\\
\;\;\;\;t_0\\
\mathbf{elif}\;w \leq -1.96 \cdot 10^{+64}:\\
\;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{\ell}}\\
\mathbf{elif}\;w \leq -0.092 \lor \neg \left(w \leq 0.049\right):\\
\;\;\;\;t_0\\
\mathbf{else}:\\
\;\;\;\;\ell + w \cdot \left(\ell \cdot \log \ell - \ell\right)\\
\end{array}
\end{array}
if w < -3.00000000000000013e259 or -1.9599999999999999e64 < w < -0.091999999999999998 or 0.049000000000000002 < w Initial program 94.2%
exp-neg94.2%
associate-*l/94.2%
*-lft-identity94.2%
Simplified94.2%
add-cube-cbrt94.2%
pow394.2%
Applied egg-rr94.2%
Taylor expanded in w around 0 5.1%
unpow1/35.1%
rem-cube-cbrt5.1%
add-log-exp80.4%
Applied egg-rr80.4%
if -3.00000000000000013e259 < w < -1.9599999999999999e64Initial program 100.0%
exp-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
Simplified100.0%
add-cube-cbrt100.0%
pow3100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0 2.9%
unpow1/32.9%
rem-cube-cbrt2.9%
add-exp-log2.9%
add-sqr-sqrt1.3%
sqrt-unprod5.5%
sqr-neg5.5%
sqrt-unprod4.3%
add-sqr-sqrt4.9%
rec-exp4.9%
add-exp-log4.9%
add-sqr-sqrt4.9%
associate-/r*4.9%
Applied egg-rr4.9%
add-sqr-sqrt4.9%
sqrt-unprod41.9%
frac-times41.9%
div-inv41.9%
associate-/l/41.9%
add-sqr-sqrt41.9%
add-sqr-sqrt41.9%
Applied egg-rr41.9%
if -0.091999999999999998 < w < 0.049000000000000002Initial program 99.6%
exp-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
Simplified99.6%
Taylor expanded in w around 0 99.2%
Final simplification87.3%
(FPCore (w l) :precision binary64 (if (<= w -0.62) (sqrt (/ (/ 1.0 l) l)) (if (<= w 0.0125) (+ l (* w (- (* l (log l)) l))) (sqrt (* l l)))))
double code(double w, double l) {
double tmp;
if (w <= -0.62) {
tmp = sqrt(((1.0 / l) / l));
} else if (w <= 0.0125) {
tmp = l + (w * ((l * log(l)) - l));
} else {
tmp = sqrt((l * l));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-0.62d0)) then
tmp = sqrt(((1.0d0 / l) / l))
else if (w <= 0.0125d0) then
tmp = l + (w * ((l * log(l)) - l))
else
tmp = sqrt((l * l))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -0.62) {
tmp = Math.sqrt(((1.0 / l) / l));
} else if (w <= 0.0125) {
tmp = l + (w * ((l * Math.log(l)) - l));
} else {
tmp = Math.sqrt((l * l));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -0.62: tmp = math.sqrt(((1.0 / l) / l)) elif w <= 0.0125: tmp = l + (w * ((l * math.log(l)) - l)) else: tmp = math.sqrt((l * l)) return tmp
function code(w, l) tmp = 0.0 if (w <= -0.62) tmp = sqrt(Float64(Float64(1.0 / l) / l)); elseif (w <= 0.0125) tmp = Float64(l + Float64(w * Float64(Float64(l * log(l)) - l))); else tmp = sqrt(Float64(l * l)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -0.62) tmp = sqrt(((1.0 / l) / l)); elseif (w <= 0.0125) tmp = l + (w * ((l * log(l)) - l)); else tmp = sqrt((l * l)); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -0.62], N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision], If[LessEqual[w, 0.0125], N[(l + N[(w * N[(N[(l * N[Log[l], $MachinePrecision]), $MachinePrecision] - l), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[Sqrt[N[(l * l), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -0.62:\\
\;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{\ell}}\\
\mathbf{elif}\;w \leq 0.0125:\\
\;\;\;\;\ell + w \cdot \left(\ell \cdot \log \ell - \ell\right)\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\ell \cdot \ell}\\
\end{array}
\end{array}
if w < -0.619999999999999996Initial program 99.9%
exp-neg99.9%
associate-*l/99.9%
*-lft-identity99.9%
Simplified99.9%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in w around 0 3.6%
unpow1/33.6%
rem-cube-cbrt3.6%
add-exp-log3.6%
add-sqr-sqrt2.3%
sqrt-unprod5.3%
sqr-neg5.3%
sqrt-unprod3.0%
add-sqr-sqrt4.2%
rec-exp4.2%
add-exp-log4.2%
add-sqr-sqrt4.2%
associate-/r*4.2%
Applied egg-rr4.2%
add-sqr-sqrt4.2%
sqrt-unprod30.2%
frac-times30.2%
div-inv30.2%
associate-/l/30.2%
add-sqr-sqrt30.2%
add-sqr-sqrt30.2%
Applied egg-rr30.2%
if -0.619999999999999996 < w < 0.012500000000000001Initial program 99.6%
exp-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
Simplified99.6%
Taylor expanded in w around 0 99.2%
if 0.012500000000000001 < w Initial program 90.7%
exp-neg90.7%
associate-*l/90.7%
*-lft-identity90.7%
Simplified90.7%
add-cube-cbrt90.7%
pow390.7%
Applied egg-rr90.7%
Taylor expanded in w around 0 5.6%
unpow1/35.6%
rem-cube-cbrt5.6%
add-sqr-sqrt5.6%
sqrt-unprod55.2%
Applied egg-rr55.2%
Final simplification76.4%
(FPCore (w l) :precision binary64 (if (or (<= w -3.8e+25) (not (<= w 0.058))) (sqrt (* l l)) l))
double code(double w, double l) {
double tmp;
if ((w <= -3.8e+25) || !(w <= 0.058)) {
tmp = sqrt((l * l));
} else {
tmp = l;
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if ((w <= (-3.8d+25)) .or. (.not. (w <= 0.058d0))) then
tmp = sqrt((l * l))
else
tmp = l
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if ((w <= -3.8e+25) || !(w <= 0.058)) {
tmp = Math.sqrt((l * l));
} else {
tmp = l;
}
return tmp;
}
def code(w, l): tmp = 0 if (w <= -3.8e+25) or not (w <= 0.058): tmp = math.sqrt((l * l)) else: tmp = l return tmp
function code(w, l) tmp = 0.0 if ((w <= -3.8e+25) || !(w <= 0.058)) tmp = sqrt(Float64(l * l)); else tmp = l; end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if ((w <= -3.8e+25) || ~((w <= 0.058))) tmp = sqrt((l * l)); else tmp = l; end tmp_2 = tmp; end
code[w_, l_] := If[Or[LessEqual[w, -3.8e+25], N[Not[LessEqual[w, 0.058]], $MachinePrecision]], N[Sqrt[N[(l * l), $MachinePrecision]], $MachinePrecision], l]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -3.8 \cdot 10^{+25} \lor \neg \left(w \leq 0.058\right):\\
\;\;\;\;\sqrt{\ell \cdot \ell}\\
\mathbf{else}:\\
\;\;\;\;\ell\\
\end{array}
\end{array}
if w < -3.8e25 or 0.0580000000000000029 < w Initial program 95.7%
exp-neg95.7%
associate-*l/95.7%
*-lft-identity95.7%
Simplified95.7%
add-cube-cbrt95.7%
pow395.7%
Applied egg-rr95.7%
Taylor expanded in w around 0 4.4%
unpow1/34.4%
rem-cube-cbrt4.4%
add-sqr-sqrt4.4%
sqrt-unprod36.0%
Applied egg-rr36.0%
if -3.8e25 < w < 0.0580000000000000029Initial program 99.6%
exp-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
Simplified99.6%
Taylor expanded in w around 0 95.0%
Final simplification73.4%
(FPCore (w l) :precision binary64 (if (<= w -62.0) (sqrt (/ (/ 1.0 l) l)) (if (<= w 0.075) l (sqrt (* l l)))))
double code(double w, double l) {
double tmp;
if (w <= -62.0) {
tmp = sqrt(((1.0 / l) / l));
} else if (w <= 0.075) {
tmp = l;
} else {
tmp = sqrt((l * l));
}
return tmp;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
real(8) :: tmp
if (w <= (-62.0d0)) then
tmp = sqrt(((1.0d0 / l) / l))
else if (w <= 0.075d0) then
tmp = l
else
tmp = sqrt((l * l))
end if
code = tmp
end function
public static double code(double w, double l) {
double tmp;
if (w <= -62.0) {
tmp = Math.sqrt(((1.0 / l) / l));
} else if (w <= 0.075) {
tmp = l;
} else {
tmp = Math.sqrt((l * l));
}
return tmp;
}
def code(w, l): tmp = 0 if w <= -62.0: tmp = math.sqrt(((1.0 / l) / l)) elif w <= 0.075: tmp = l else: tmp = math.sqrt((l * l)) return tmp
function code(w, l) tmp = 0.0 if (w <= -62.0) tmp = sqrt(Float64(Float64(1.0 / l) / l)); elseif (w <= 0.075) tmp = l; else tmp = sqrt(Float64(l * l)); end return tmp end
function tmp_2 = code(w, l) tmp = 0.0; if (w <= -62.0) tmp = sqrt(((1.0 / l) / l)); elseif (w <= 0.075) tmp = l; else tmp = sqrt((l * l)); end tmp_2 = tmp; end
code[w_, l_] := If[LessEqual[w, -62.0], N[Sqrt[N[(N[(1.0 / l), $MachinePrecision] / l), $MachinePrecision]], $MachinePrecision], If[LessEqual[w, 0.075], l, N[Sqrt[N[(l * l), $MachinePrecision]], $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;w \leq -62:\\
\;\;\;\;\sqrt{\frac{\frac{1}{\ell}}{\ell}}\\
\mathbf{elif}\;w \leq 0.075:\\
\;\;\;\;\ell\\
\mathbf{else}:\\
\;\;\;\;\sqrt{\ell \cdot \ell}\\
\end{array}
\end{array}
if w < -62Initial program 100.0%
exp-neg100.0%
associate-*l/100.0%
*-lft-identity100.0%
Simplified100.0%
add-cube-cbrt100.0%
pow3100.0%
Applied egg-rr100.0%
Taylor expanded in w around 0 3.4%
unpow1/33.4%
rem-cube-cbrt3.4%
add-exp-log3.4%
add-sqr-sqrt2.1%
sqrt-unprod5.2%
sqr-neg5.2%
sqrt-unprod3.2%
add-sqr-sqrt4.1%
rec-exp4.1%
add-exp-log4.1%
add-sqr-sqrt4.1%
associate-/r*4.1%
Applied egg-rr4.1%
add-sqr-sqrt4.1%
sqrt-unprod31.1%
frac-times31.1%
div-inv31.1%
associate-/l/31.1%
add-sqr-sqrt31.1%
add-sqr-sqrt31.1%
Applied egg-rr31.1%
if -62 < w < 0.0749999999999999972Initial program 99.6%
exp-neg99.6%
associate-*l/99.6%
*-lft-identity99.6%
Simplified99.6%
Taylor expanded in w around 0 97.4%
if 0.0749999999999999972 < w Initial program 90.7%
exp-neg90.7%
associate-*l/90.7%
*-lft-identity90.7%
Simplified90.7%
add-cube-cbrt90.7%
pow390.7%
Applied egg-rr90.7%
Taylor expanded in w around 0 5.6%
unpow1/35.6%
rem-cube-cbrt5.6%
add-sqr-sqrt5.6%
sqrt-unprod55.2%
Applied egg-rr55.2%
Final simplification76.0%
(FPCore (w l) :precision binary64 l)
double code(double w, double l) {
return l;
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = l
end function
public static double code(double w, double l) {
return l;
}
def code(w, l): return l
function code(w, l) return l end
function tmp = code(w, l) tmp = l; end
code[w_, l_] := l
\begin{array}{l}
\\
\ell
\end{array}
Initial program 98.2%
exp-neg98.2%
associate-*l/98.2%
*-lft-identity98.2%
Simplified98.2%
Taylor expanded in w around 0 61.8%
Final simplification61.8%
herbie shell --seed 2023279
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))