\left(x \cdot 2\right) \cdot x
x \cdot \left(x \cdot 2\right)
(FPCore (x) :precision binary64 (* (* x 2.0) x))
(FPCore (x) :precision binary64 (* x (* x 2.0)))
double code(double x) {
return (x * 2.0) * x;
}
double code(double x) {
return x * (x * 2.0);
}






Bits error versus x
Results
| Original | 0 |
|---|---|
| Target | 0 |
| Herbie | 0 |
| Alternative 1 | |
|---|---|
| Error | 41.9 |
| Cost | 64 |
| Alternative 2 | |
|---|---|
| Error | 61.0 |
| Cost | 64 |

Initial program 0
Simplified0
Final simplification0
herbie shell --seed 2021044
(FPCore (x)
:name "Numeric.Log:$cexpm1 from log-domain-0.10.2.1, A"
:precision binary64
:herbie-target
(* (* 2.0 x) x)
(* (* x 2.0) x))