\left(\left(d1 \cdot d1\right) \cdot d1\right) \cdot d1
{d1}^{4}(FPCore (d1) :precision binary64 (* (* (* d1 d1) d1) d1))
(FPCore (d1) :precision binary64 (pow d1 4.0))
double code(double d1) {
return ((d1 * d1) * d1) * d1;
}
double code(double d1) {
return pow(d1, 4.0);
}







Bits error versus d1
Results
| Original | 0.1 |
|---|---|
| Target | 0 |
| Herbie | 0 |
| Alternative 1 | |
|---|---|
| Error | 0.1 |
| Cost | 448 |
| Alternative 2 | |
|---|---|
| Error | 25.5 |
| Cost | 64 |
| Alternative 3 | |
|---|---|
| Error | 61.4 |
| Cost | 64 |

Initial program 0.1
Simplified0
Simplified0
Final simplification0
herbie shell --seed 2021044
(FPCore (d1)
:name "FastMath repmul"
:precision binary64
:herbie-target
(pow d1 4.0)
(* (* (* d1 d1) d1) d1))