\left(d1 \cdot 3 + d1 \cdot d2\right) + d1 \cdot d3
d1 \cdot \left(3 + \left(d2 + d3\right)\right)
(FPCore (d1 d2 d3) :precision binary64 (+ (+ (* d1 3.0) (* d1 d2)) (* d1 d3)))
(FPCore (d1 d2 d3) :precision binary64 (* d1 (+ 3.0 (+ d2 d3))))
double code(double d1, double d2, double d3) {
return ((double) (((double) (((double) (d1 * 3.0)) + ((double) (d1 * d2)))) + ((double) (d1 * d3))));
}
double code(double d1, double d2, double d3) {
return ((double) (d1 * ((double) (3.0 + ((double) (d2 + d3))))));
}




Bits error versus d1




Bits error versus d2




Bits error versus d3
Results
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program Error: 0.1 bits
SimplifiedError: 0.1 bits
Final simplificationError: 0.1 bits
herbie shell --seed 2020204
(FPCore (d1 d2 d3)
:name "FastMath test3"
:precision binary64
:herbie-target
(* d1 (+ (+ 3.0 d2) d3))
(+ (+ (* d1 3.0) (* d1 d2)) (* d1 d3)))