| Alternative 1 | |
|---|---|
| Error | 0.44% |
| 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 (/ (/ (pow l (exp w)) (exp (* w 0.3333333333333333))) (exp (* w 0.6666666666666666))))
double code(double w, double l) {
return exp(-w) * pow(l, exp(w));
}
double code(double w, double l) {
return (pow(l, exp(w)) / exp((w * 0.3333333333333333))) / exp((w * 0.6666666666666666));
}
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = exp(-w) * (l ** exp(w))
end function
real(8) function code(w, l)
real(8), intent (in) :: w
real(8), intent (in) :: l
code = ((l ** exp(w)) / exp((w * 0.3333333333333333d0))) / exp((w * 0.6666666666666666d0))
end function
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.exp((w * 0.3333333333333333))) / Math.exp((w * 0.6666666666666666));
}
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.exp((w * 0.3333333333333333))) / math.exp((w * 0.6666666666666666))
function code(w, l) return Float64(exp(Float64(-w)) * (l ^ exp(w))) end
function code(w, l) return Float64(Float64((l ^ exp(w)) / exp(Float64(w * 0.3333333333333333))) / exp(Float64(w * 0.6666666666666666))) end
function tmp = code(w, l) tmp = exp(-w) * (l ^ exp(w)); end
function tmp = code(w, l) tmp = ((l ^ exp(w)) / exp((w * 0.3333333333333333))) / exp((w * 0.6666666666666666)); end
code[w_, l_] := N[(N[Exp[(-w)], $MachinePrecision] * N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[w_, l_] := N[(N[(N[Power[l, N[Exp[w], $MachinePrecision]], $MachinePrecision] / N[Exp[N[(w * 0.3333333333333333), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / N[Exp[N[(w * 0.6666666666666666), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\frac{\frac{{\ell}^{\left(e^{w}\right)}}{e^{w \cdot 0.3333333333333333}}}{e^{w \cdot 0.6666666666666666}}
Results
Initial program 0.44
Simplified0.44
[Start]0.44 | \[ e^{-w} \cdot {\ell}^{\left(e^{w}\right)}
\] |
|---|---|
exp-neg [=>]0.44 | \[ \color{blue}{\frac{1}{e^{w}}} \cdot {\ell}^{\left(e^{w}\right)}
\] |
associate-*l/ [=>]0.44 | \[ \color{blue}{\frac{1 \cdot {\ell}^{\left(e^{w}\right)}}{e^{w}}}
\] |
*-lft-identity [=>]0.44 | \[ \frac{\color{blue}{{\ell}^{\left(e^{w}\right)}}}{e^{w}}
\] |
Applied egg-rr0.44
Simplified0.44
[Start]0.44 | \[ \frac{1}{{\left(\sqrt[3]{e^{w}}\right)}^{2}} \cdot \frac{{\ell}^{\left(e^{w}\right)}}{\sqrt[3]{e^{w}}}
\] |
|---|---|
associate-*l/ [=>]0.44 | \[ \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.44 | \[ \frac{\color{blue}{\frac{{\ell}^{\left(e^{w}\right)}}{\sqrt[3]{e^{w}}}}}{{\left(\sqrt[3]{e^{w}}\right)}^{2}}
\] |
Applied egg-rr0.45
Applied egg-rr0.45
Final simplification0.45
| Alternative 1 | |
|---|---|
| Error | 0.44% |
| Cost | 19520 |
| Alternative 2 | |
|---|---|
| Error | 0.44% |
| Cost | 19456 |
| Alternative 3 | |
|---|---|
| Error | 1.94% |
| Cost | 13440 |
| Alternative 4 | |
|---|---|
| Error | 1.94% |
| Cost | 13376 |
| Alternative 5 | |
|---|---|
| Error | 2.78% |
| Cost | 6660 |
| Alternative 6 | |
|---|---|
| Error | 2.73% |
| Cost | 6656 |
| Alternative 7 | |
|---|---|
| Error | 2.73% |
| Cost | 6592 |
| Alternative 8 | |
|---|---|
| Error | 13.26% |
| Cost | 1348 |
| Alternative 9 | |
|---|---|
| Error | 13.26% |
| Cost | 708 |
| Alternative 10 | |
|---|---|
| Error | 21.22% |
| Cost | 64 |
herbie shell --seed 2023104
(FPCore (w l)
:name "exp-w (used to crash)"
:precision binary64
(* (exp (- w)) (pow l (exp w))))