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




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 9.6 |
|---|---|
| Target | 2.4 |
| Herbie | 2.6 |
Initial program 9.6
Simplified2.6
Final simplification2.6
herbie shell --seed 2022068
(FPCore (x y z)
:name "Numeric.SpecFunctions:choose from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(/ x (/ z (+ y z)))
(/ (* x (+ y z)) z))