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 r356850 = x;
double r356851 = y;
double r356852 = z;
double r356853 = r356851 + r356852;
double r356854 = r356850 * r356853;
double r356855 = 5.0;
double r356856 = r356852 * r356855;
double r356857 = r356854 + r356856;
return r356857;
}
double f(double x, double y, double z) {
double r356858 = 5.0;
double r356859 = z;
double r356860 = y;
double r356861 = r356859 + r356860;
double r356862 = x;
double r356863 = r356861 * r356862;
double r356864 = fma(r356858, r356859, r356863);
return r356864;
}




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 2019179 +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)))