x \cdot \left(y + z\right) + z \cdot 5
\mathsf{fma}\left(5, z, \left(z + y\right) \cdot x\right)double f(double x, double y, double z) {
double r441806 = x;
double r441807 = y;
double r441808 = z;
double r441809 = r441807 + r441808;
double r441810 = r441806 * r441809;
double r441811 = 5.0;
double r441812 = r441808 * r441811;
double r441813 = r441810 + r441812;
return r441813;
}
double f(double x, double y, double z) {
double r441814 = 5.0;
double r441815 = z;
double r441816 = y;
double r441817 = r441815 + r441816;
double r441818 = x;
double r441819 = r441817 * r441818;
double r441820 = fma(r441814, r441815, r441819);
return r441820;
}




Bits error versus x




Bits error versus y




Bits error versus z
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.0 |
Initial program 0.1
Taylor expanded around 0 0.1
Simplified0.0
Final simplification0.0
herbie shell --seed 2019196 +o rules:numerics
(FPCore (x y z)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, C"
:herbie-target
(+ (* (+ x 5.0) z) (* x y))
(+ (* x (+ y z)) (* z 5.0)))