\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 r666311 = x;
double r666312 = r666311 * r666311;
double r666313 = y;
double r666314 = r666313 * r666313;
double r666315 = r666312 + r666314;
double r666316 = r666315 + r666314;
double r666317 = r666316 + r666314;
return r666317;
}
double f(double x, double y) {
double r666318 = x;
double r666319 = 3.0;
double r666320 = y;
double r666321 = r666319 * r666320;
double r666322 = r666321 * r666320;
double r666323 = fma(r666318, r666318, r666322);
return r666323;
}




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