| Alternative 1 | |
|---|---|
| Error | 0.4% |
| Cost | 19456 |
\[\frac{{\ell}^{\left(e^{w}\right)}}{e^{w}}
\]
(FPCore (w l) :precision binary64 (* (exp (- w)) (pow l (exp w))))
(FPCore (w l) :precision binary64 (/ (pow l (exp w)) (expm1 (log1p (exp w)))))
double code(double w, double l) {
return exp(-w) * pow(l, exp(w));
}
double code(double w, double l) {
return pow(l, exp(w)) / expm1(log1p(exp(w)));
}
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) {
return Math.pow(l, Math.exp(w)) / Math.expm1(Math.log1p(Math.exp(w)));
}
def code(w, l): return math.exp(-w) * math.pow(l, math.exp(w))
def code(w, l): return math.pow(l, math.exp(w)) / math.expm1(math.log1p(math.exp(w)))
function code(w, l) return Float64(exp(Float64(-w)) * (l ^ exp(w))) end
function code(w, l) return Float64((l ^ exp(w)) / expm1(log1p(exp(w)))) end
code[w_, l_] := N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[w_, l_] := N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[(Exp[N[Log[1 + N[Exp[w], $MachinePrecision]], $MachinePrecision]] - 1), $MachinePrecision]), $MachinePrecision]
e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\frac{{\ell}^{\left(e^{w}\right)}}{\mathsf{expm1}\left(\mathsf{log1p}\left(e^{w}\right)\right)}
Results
Initial program 0.4
Simplified0.4
[Start]0.4 | \[ e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\] |
|---|---|
exp-neg [=>]0.4 | \[ \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)}
\] |
associate-*l/ [=>]0.4 | \[ \color{blue}{\frac{1 \cdot {\ell}^{\left(e^{w}\right)}}{e^{w}}}
\] |
*-lft-identity [=>]0.4 | \[ \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{w}}
\] |
Applied egg-rr0.41
Simplified0.41
[Start]0.41 | \[ \frac{1}{{\left(\sqrt[3]{e^{w}}\right)}^{2}} \cdot \frac{{\ell}^{\left(e^{w}\right)}}{\sqrt[3]{e^{w}}}
\] |
|---|---|
associate-*l/ [=>]0.41 | \[ \color{blue}{\frac{1 \cdot \frac{{\ell}^{\left(e^{w}\right)}}{\sqrt[3]{e^{w}}}}{{\left(\sqrt[3]{e^{w}}\right)}^{2}}}
\] |
*-lft-identity [=>]0.41 | \[ \frac{\color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{\sqrt[3]{e^{w}}}}}{{\left(\sqrt[3]{e^{w}}\right)}^{2}}
\] |
associate-/l/ [=>]0.41 | \[ \color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{{\left(\sqrt[3]{e^{w}}\right)}^{2} \cdot \sqrt[3]{e^{w}}}}
\] |
Applied egg-rr0.4
Final simplification0.4
| Alternative 1 | |
|---|---|
| Error | 0.4% |
| Cost | 19456 |
| Alternative 2 | |
|---|---|
| Error | 1.4% |
| Cost | 13568 |
| Alternative 3 | |
|---|---|
| Error | 1.4% |
| Cost | 13184 |
| Alternative 4 | |
|---|---|
| Error | 2.04% |
| Cost | 12928 |
| Alternative 5 | |
|---|---|
| Error | 2.69% |
| Cost | 6660 |
| Alternative 6 | |
|---|---|
| Error | 2.68% |
| Cost | 6592 |
| Alternative 7 | |
|---|---|
| Error | 12.72% |
| Cost | 320 |
| Alternative 8 | |
|---|---|
| Error | 21.5% |
| Cost | 64 |
herbie shell --seed 2023103
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))