\mathsf{fma}\left(x, y, z\right) - \left(1 + \left(x \cdot y + z\right)\right)-1 + \left(\frac{z}{-1} + \left(\mathsf{fma}\left(x, y, z\right) + \frac{x \cdot y}{-1}\right)\right)(FPCore (x y z) :precision binary64 (- (fma x y z) (+ 1.0 (+ (* x y) z))))
(FPCore (x y z) :precision binary64 (+ -1.0 (+ (/ z -1.0) (+ (fma x y z) (/ (* x y) -1.0)))))
double code(double x, double y, double z) {
return fma(x, y, z) - (1.0 + ((x * y) + z));
}
double code(double x, double y, double z) {
return -1.0 + ((z / -1.0) + (fma(x, y, z) + ((x * y) / -1.0)));
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 45.7 |
|---|---|
| Target | 0 |
| Herbie | 13.5 |
Initial program 45.7
rmApplied flip-+_binary64_107546.5
rmApplied add-cube-cbrt_binary64_113646.8
Applied difference-of-squares_binary64_107046.8
Applied times-frac_binary64_110746.2
Taylor expanded around -inf 13.5
Simplified13.5
Final simplification13.5
herbie shell --seed 2021007
(FPCore (x y z)
:name "simple fma test"
:precision binary64
:herbie-target
-1.0
(- (fma x y z) (+ 1.0 (+ (* x y) z))))