\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 r332456 = x;
double r332457 = r332456 * r332456;
double r332458 = y;
double r332459 = r332458 * r332458;
double r332460 = r332457 + r332459;
double r332461 = r332460 + r332459;
double r332462 = r332461 + r332459;
return r332462;
}
double f(double x, double y) {
double r332463 = x;
double r332464 = 3.0;
double r332465 = y;
double r332466 = r332464 * r332465;
double r332467 = r332466 * r332465;
double r332468 = fma(r332463, r332463, r332467);
return r332468;
}




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