x \cdot \left(y + z\right) + z \cdot 5
\mathsf{fma}\left(x, z, \mathsf{fma}\left(5, z, x \cdot y\right)\right)double f(double x, double y, double z) {
double r621642 = x;
double r621643 = y;
double r621644 = z;
double r621645 = r621643 + r621644;
double r621646 = r621642 * r621645;
double r621647 = 5.0;
double r621648 = r621644 * r621647;
double r621649 = r621646 + r621648;
return r621649;
}
double f(double x, double y, double z) {
double r621650 = x;
double r621651 = z;
double r621652 = 5.0;
double r621653 = y;
double r621654 = r621650 * r621653;
double r621655 = fma(r621652, r621651, r621654);
double r621656 = fma(r621650, r621651, r621655);
return r621656;
}




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
Simplified0.1
Taylor expanded around 0 0.1
Simplified0.0
Final simplification0.0
herbie shell --seed 2020060 +o rules:numerics
(FPCore (x y z)
:name "Graphics.Rendering.Plot.Render.Plot.Legend:renderLegendOutside from plot-0.2.3.4, C"
:precision binary64
:herbie-target
(+ (* (+ x 5) z) (* x y))
(+ (* x (+ y z)) (* z 5)))