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 r622068 = x;
double r622069 = y;
double r622070 = z;
double r622071 = r622069 + r622070;
double r622072 = r622068 * r622071;
double r622073 = 5.0;
double r622074 = r622070 * r622073;
double r622075 = r622072 + r622074;
return r622075;
}
double f(double x, double y, double z) {
double r622076 = x;
double r622077 = z;
double r622078 = 5.0;
double r622079 = y;
double r622080 = r622076 * r622079;
double r622081 = fma(r622078, r622077, r622080);
double r622082 = fma(r622076, r622077, r622081);
return r622082;
}




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