x \cdot \left(y + z\right) + z \cdot 5
\mathsf{fma}\left(z, 5, \left(z + y\right) \cdot x\right)double f(double x, double y, double z) {
double r478184 = x;
double r478185 = y;
double r478186 = z;
double r478187 = r478185 + r478186;
double r478188 = r478184 * r478187;
double r478189 = 5.0;
double r478190 = r478186 * r478189;
double r478191 = r478188 + r478190;
return r478191;
}
double f(double x, double y, double z) {
double r478192 = z;
double r478193 = 5.0;
double r478194 = y;
double r478195 = r478192 + r478194;
double r478196 = x;
double r478197 = r478195 * r478196;
double r478198 = fma(r478192, r478193, r478197);
return r478198;
}




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