\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\mathsf{fma}\left(x, x, \left(3 \cdot y\right) \cdot y\right)double f(double x, double y) {
double r345251 = x;
double r345252 = r345251 * r345251;
double r345253 = y;
double r345254 = r345253 * r345253;
double r345255 = r345252 + r345254;
double r345256 = r345255 + r345254;
double r345257 = r345256 + r345254;
return r345257;
}
double f(double x, double y) {
double r345258 = x;
double r345259 = 3.0;
double r345260 = y;
double r345261 = r345259 * r345260;
double r345262 = r345261 * r345260;
double r345263 = fma(r345258, r345258, r345262);
return r345263;
}




Bits error versus x




Bits error versus y
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 0.1
Simplified0.1
rmApplied associate-*r*0.1
Final simplification0.1
herbie shell --seed 2019235 +o rules:numerics
(FPCore (x y)
:name "Linear.Quaternion:$c/ from linear-1.19.1.3, E"
:precision binary64
:herbie-target
(+ (* x x) (* y (+ y (+ y y))))
(+ (+ (+ (* x x) (* y y)) (* y y)) (* y y)))