| Alternative 1 | |
|---|---|
| Error | 0.3 |
| Cost | 19520 |
\[{\ell}^{\left(e^{w}\right)} \cdot e^{-w}
\]
(FPCore (w l) :precision binary64 (* (exp (- w)) (pow l (exp w))))
(FPCore (w l) :precision binary64 (let* ((t_0 (sqrt (exp w)))) (/ (/ (pow l (exp w)) t_0) (expm1 (expm1 (log1p (log1p t_0)))))))
double code(double w, double l) {
return exp(-w) * pow(l, exp(w));
}
double code(double w, double l) {
double t_0 = sqrt(exp(w));
return (pow(l, exp(w)) / t_0) / expm1(expm1(log1p(log1p(t_0))));
}
public static double code(double w, double l) {
return Math.exp(-w) * Math.pow(l, Math.exp(w));
}
public static double code(double w, double l) {
double t_0 = Math.sqrt(Math.exp(w));
return (Math.pow(l, Math.exp(w)) / t_0) / Math.expm1(Math.expm1(Math.log1p(Math.log1p(t_0))));
}
def code(w, l): return math.exp(-w) * math.pow(l, math.exp(w))
def code(w, l): t_0 = math.sqrt(math.exp(w)) return (math.pow(l, math.exp(w)) / t_0) / math.expm1(math.expm1(math.log1p(math.log1p(t_0))))
function code(w, l) return Float64(exp(Float64(-w)) * (l ^ exp(w))) end
function code(w, l) t_0 = sqrt(exp(w)) return Float64(Float64((l ^ exp(w)) / t_0) / expm1(expm1(log1p(log1p(t_0))))) end
code[w_, l_] := N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[w_, l_] := Block[{t$95$0 = N[Sqrt[N[Exp[w], $MachinePrecision]], $MachinePrecision]}, N[(N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision] / N[(Exp[N[(Exp[N[Log[1 + N[Log[1 + t$95$0], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]]
e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\begin{array}{l}
t_0 := \sqrt{e^{w}}\\
\frac{\frac{{\ell}^{\left(e^{w}\right)}}{t_0}}{\mathsf{expm1}\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(t_0\right)\right)\right)\right)}
\end{array}
Results
Initial program 0.3
Simplified0.3
[Start]0.3 | \[ e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\] |
|---|---|
exp-neg [=>]0.3 | \[ \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)}
\] |
associate-*l/ [=>]0.3 | \[ \color{blue}{\frac{1 \cdot {\ell}^{\left(e^{w}\right)}}{e^{w}}}
\] |
*-lft-identity [=>]0.3 | \[ \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{w}}
\] |
Applied egg-rr0.3
Simplified0.3
[Start]0.3 | \[ \frac{1}{\sqrt{e^{w}}} \cdot \frac{{\ell}^{\left(e^{w}\right)}}{\sqrt{e^{w}}}
\] |
|---|---|
associate-*l/ [=>]0.3 | \[ \color{blue}{\frac{1 \cdot \frac{{\ell}^{\left(e^{w}\right)}}{\sqrt{e^{w}}}}{\sqrt{e^{w}}}}
\] |
*-lft-identity [=>]0.3 | \[ \frac{\color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{\sqrt{e^{w}}}}}{\sqrt{e^{w}}}
\] |
Applied egg-rr0.3
Applied egg-rr0.3
Final simplification0.3
| Alternative 1 | |
|---|---|
| Error | 0.3 |
| Cost | 19520 |
| Alternative 2 | |
|---|---|
| Error | 0.3 |
| Cost | 19456 |
| Alternative 3 | |
|---|---|
| Error | 0.8 |
| Cost | 13696 |
| Alternative 4 | |
|---|---|
| Error | 1.3 |
| Cost | 13376 |
| Alternative 5 | |
|---|---|
| Error | 1.7 |
| Cost | 6656 |
| Alternative 6 | |
|---|---|
| Error | 1.7 |
| Cost | 6592 |
| Alternative 7 | |
|---|---|
| Error | 2.1 |
| Cost | 452 |
| Alternative 8 | |
|---|---|
| Error | 13.9 |
| Cost | 64 |
herbie shell --seed 2023047
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))