\left(x \cdot 3\right) \cdot y - z
y \cdot \left(x \cdot 3\right) - z
(FPCore (x y z) :precision binary64 (- (* (* x 3.0) y) z))
(FPCore (x y z) :precision binary64 (- (* y (* x 3.0)) z))
double code(double x, double y, double z) {
return ((x * 3.0) * y) - z;
}
double code(double x, double y, double z) {
return (y * (x * 3.0)) - z;
}








Bits error versus x








Bits error versus y








Bits error versus z
Results
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
| Alternative 1 | |
|---|---|
| Error | 0.1 |
| Cost | 448 |
| Alternative 2 | |
|---|---|
| Error | 17.4 |
| Cost | 913 |
| Alternative 3 | |
|---|---|
| Error | 26.9 |
| Cost | 128 |
| Alternative 4 | |
|---|---|
| Error | 61.8 |
| Cost | 64 |

Initial program 0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2021044
(FPCore (x y z)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, B"
:precision binary64
:herbie-target
(- (* x (* 3.0 y)) z)
(- (* (* x 3.0) y) z))