| Alternative 1 | |
|---|---|
| Accuracy | 100.0% |
| Cost | 26240 |
\[x \cdot \left(e^{y \cdot \left(y \cdot 0.6666666666666666\right)} \cdot {\left(\sqrt[3]{e^{y}}\right)}^{y}\right)
\]
(FPCore (x y) :precision binary64 (* x (exp (* y y))))
(FPCore (x y) :precision binary64 (* x (* (pow (pow (cbrt (exp y)) 2.0) y) (exp (* y (* y 0.3333333333333333))))))
double code(double x, double y) {
return x * exp((y * y));
}
double code(double x, double y) {
return x * (pow(pow(cbrt(exp(y)), 2.0), y) * exp((y * (y * 0.3333333333333333))));
}
public static double code(double x, double y) {
return x * Math.exp((y * y));
}
public static double code(double x, double y) {
return x * (Math.pow(Math.pow(Math.cbrt(Math.exp(y)), 2.0), y) * Math.exp((y * (y * 0.3333333333333333))));
}
function code(x, y) return Float64(x * exp(Float64(y * y))) end
function code(x, y) return Float64(x * Float64(((cbrt(exp(y)) ^ 2.0) ^ y) * exp(Float64(y * Float64(y * 0.3333333333333333))))) end
code[x_, y_] := N[(x * N[Exp[N[(y * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[x_, y_] := N[(x * N[(N[Power[N[Power[N[Power[N[Exp[y], $MachinePrecision], 1/3], $MachinePrecision], 2.0], $MachinePrecision], y], $MachinePrecision] * N[Exp[N[(y * N[(y * 0.3333333333333333), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x \cdot e^{y \cdot y}
x \cdot \left({\left({\left(\sqrt[3]{e^{y}}\right)}^{2}\right)}^{y} \cdot e^{y \cdot \left(y \cdot 0.3333333333333333\right)}\right)
Results
| Original | 100.0% |
|---|---|
| Target | 100.0% |
| Herbie | 100.0% |
Initial program 100.0%
Simplified100.0%
[Start]100.0 | \[ x \cdot e^{y \cdot y}
\] |
|---|---|
exp-prod [=>]100.0 | \[ x \cdot \color{blue}{{\left(e^{y}\right)}^{y}}
\] |
Applied egg-rr100.0%
[Start]100.0 | \[ x \cdot {\left(e^{y}\right)}^{y}
\] |
|---|---|
add-cube-cbrt [=>]100.0 | \[ x \cdot {\color{blue}{\left(\left(\sqrt[3]{e^{y}} \cdot \sqrt[3]{e^{y}}\right) \cdot \sqrt[3]{e^{y}}\right)}}^{y}
\] |
unpow-prod-down [=>]100.0 | \[ x \cdot \color{blue}{\left({\left(\sqrt[3]{e^{y}} \cdot \sqrt[3]{e^{y}}\right)}^{y} \cdot {\left(\sqrt[3]{e^{y}}\right)}^{y}\right)}
\] |
pow2 [=>]100.0 | \[ x \cdot \left({\color{blue}{\left({\left(\sqrt[3]{e^{y}}\right)}^{2}\right)}}^{y} \cdot {\left(\sqrt[3]{e^{y}}\right)}^{y}\right)
\] |
Applied egg-rr100.0%
[Start]100.0 | \[ x \cdot \left({\left({\left(\sqrt[3]{e^{y}}\right)}^{2}\right)}^{y} \cdot {\left(\sqrt[3]{e^{y}}\right)}^{y}\right)
\] |
|---|---|
add-exp-log [=>]100.0 | \[ x \cdot \left({\left({\left(\sqrt[3]{e^{y}}\right)}^{2}\right)}^{y} \cdot \color{blue}{e^{\log \left({\left(\sqrt[3]{e^{y}}\right)}^{y}\right)}}\right)
\] |
log-pow [=>]100.0 | \[ x \cdot \left({\left({\left(\sqrt[3]{e^{y}}\right)}^{2}\right)}^{y} \cdot e^{\color{blue}{y \cdot \log \left(\sqrt[3]{e^{y}}\right)}}\right)
\] |
pow1/3 [=>]100.0 | \[ x \cdot \left({\left({\left(\sqrt[3]{e^{y}}\right)}^{2}\right)}^{y} \cdot e^{y \cdot \log \color{blue}{\left({\left(e^{y}\right)}^{0.3333333333333333}\right)}}\right)
\] |
pow-exp [=>]100.0 | \[ x \cdot \left({\left({\left(\sqrt[3]{e^{y}}\right)}^{2}\right)}^{y} \cdot e^{y \cdot \log \color{blue}{\left(e^{y \cdot 0.3333333333333333}\right)}}\right)
\] |
add-log-exp [<=]100.0 | \[ x \cdot \left({\left({\left(\sqrt[3]{e^{y}}\right)}^{2}\right)}^{y} \cdot e^{y \cdot \color{blue}{\left(y \cdot 0.3333333333333333\right)}}\right)
\] |
Final simplification100.0%
| Alternative 1 | |
|---|---|
| Accuracy | 100.0% |
| Cost | 26240 |
| Alternative 2 | |
|---|---|
| Accuracy | 100.0% |
| Cost | 13056 |
| Alternative 3 | |
|---|---|
| Accuracy | 100.0% |
| Cost | 6720 |
| Alternative 4 | |
|---|---|
| Accuracy | 99.0% |
| Cost | 448 |
| Alternative 5 | |
|---|---|
| Accuracy | 99.0% |
| Cost | 448 |
| Alternative 6 | |
|---|---|
| Accuracy | 98.5% |
| Cost | 64 |
herbie shell --seed 2023147
(FPCore (x y)
:name "Data.Number.Erf:$dmerfcx from erf-2.0.0.0"
:precision binary64
:herbie-target
(* x (pow (exp y) y))
(* x (exp (* y y))))