| Alternative 1 | |
|---|---|
| Accuracy | 99.9% |
| Cost | 7104 |
\[\mathsf{fma}\left(x, t + \left(y + z\right) \cdot 2, y \cdot 5\right)
\]
(FPCore (x y z t) :precision binary64 (+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))
(FPCore (x y z t) :precision binary64 (fma y 5.0 (* x (+ t (* (+ y z) 2.0)))))
double code(double x, double y, double z, double t) {
return (x * ((((y + z) + z) + y) + t)) + (y * 5.0);
}
double code(double x, double y, double z, double t) {
return fma(y, 5.0, (x * (t + ((y + z) * 2.0))));
}
function code(x, y, z, t) return Float64(Float64(x * Float64(Float64(Float64(Float64(y + z) + z) + y) + t)) + Float64(y * 5.0)) end
function code(x, y, z, t) return fma(y, 5.0, Float64(x * Float64(t + Float64(Float64(y + z) * 2.0)))) end
code[x_, y_, z_, t_] := N[(N[(x * N[(N[(N[(N[(y + z), $MachinePrecision] + z), $MachinePrecision] + y), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision] + N[(y * 5.0), $MachinePrecision]), $MachinePrecision]
code[x_, y_, z_, t_] := N[(y * 5.0 + N[(x * N[(t + N[(N[(y + z), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\mathsf{fma}\left(y, 5, x \cdot \left(t + \left(y + z\right) \cdot 2\right)\right)
Initial program 99.9%
Applied egg-rr100.0%
[Start]99.9 | \[ x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right) + y \cdot 5
\] |
|---|---|
+-commutative [=>]99.9 | \[ \color{blue}{y \cdot 5 + x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)}
\] |
fma-def [=>]100.0 | \[ \color{blue}{\mathsf{fma}\left(y, 5, x \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)}
\] |
*-un-lft-identity [=>]100.0 | \[ \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(1 \cdot \left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)\right)}\right)
\] |
*-un-lft-identity [<=]100.0 | \[ \mathsf{fma}\left(y, 5, x \cdot \color{blue}{\left(\left(\left(\left(y + z\right) + z\right) + y\right) + t\right)}\right)
\] |
associate-+l+ [=>]100.0 | \[ \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(\left(y + z\right) + \left(z + y\right)\right)} + t\right)\right)
\] |
*-un-lft-identity [=>]100.0 | \[ \mathsf{fma}\left(y, 5, x \cdot \left(\left(\color{blue}{1 \cdot \left(y + z\right)} + \left(z + y\right)\right) + t\right)\right)
\] |
+-commutative [<=]100.0 | \[ \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{\left(y + z\right)}\right) + t\right)\right)
\] |
*-un-lft-identity [=>]100.0 | \[ \mathsf{fma}\left(y, 5, x \cdot \left(\left(1 \cdot \left(y + z\right) + \color{blue}{1 \cdot \left(y + z\right)}\right) + t\right)\right)
\] |
distribute-rgt-out [=>]100.0 | \[ \mathsf{fma}\left(y, 5, x \cdot \left(\color{blue}{\left(y + z\right) \cdot \left(1 + 1\right)} + t\right)\right)
\] |
metadata-eval [=>]100.0 | \[ \mathsf{fma}\left(y, 5, x \cdot \left(\left(y + z\right) \cdot \color{blue}{2} + t\right)\right)
\] |
Final simplification100.0%
| Alternative 1 | |
|---|---|
| Accuracy | 99.9% |
| Cost | 7104 |
| Alternative 2 | |
|---|---|
| Accuracy | 85.7% |
| Cost | 1233 |
| Alternative 3 | |
|---|---|
| Accuracy | 60.0% |
| Cost | 1108 |
| Alternative 4 | |
|---|---|
| Accuracy | 60.8% |
| Cost | 1108 |
| Alternative 5 | |
|---|---|
| Accuracy | 84.9% |
| Cost | 972 |
| Alternative 6 | |
|---|---|
| Accuracy | 88.9% |
| Cost | 969 |
| Alternative 7 | |
|---|---|
| Accuracy | 99.9% |
| Cost | 960 |
| Alternative 8 | |
|---|---|
| Accuracy | 50.3% |
| Cost | 852 |
| Alternative 9 | |
|---|---|
| Accuracy | 49.9% |
| Cost | 848 |
| Alternative 10 | |
|---|---|
| Accuracy | 59.7% |
| Cost | 844 |
| Alternative 11 | |
|---|---|
| Accuracy | 84.0% |
| Cost | 841 |
| Alternative 12 | |
|---|---|
| Accuracy | 77.6% |
| Cost | 713 |
| Alternative 13 | |
|---|---|
| Accuracy | 49.7% |
| Cost | 456 |
| Alternative 14 | |
|---|---|
| Accuracy | 26.1% |
| Cost | 192 |
| Alternative 15 | |
|---|---|
| Accuracy | 2.6% |
| Cost | 64 |
herbie shell --seed 2023152
(FPCore (x y z t)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, B"
:precision binary64
(+ (* x (+ (+ (+ (+ y z) z) y) t)) (* y 5.0)))