\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\mathsf{fma}\left(3, y \cdot y, x \cdot x\right)double f(double x, double y) {
double r472794 = x;
double r472795 = r472794 * r472794;
double r472796 = y;
double r472797 = r472796 * r472796;
double r472798 = r472795 + r472797;
double r472799 = r472798 + r472797;
double r472800 = r472799 + r472797;
return r472800;
}
double f(double x, double y) {
double r472801 = 3.0;
double r472802 = y;
double r472803 = r472802 * r472802;
double r472804 = x;
double r472805 = r472804 * r472804;
double r472806 = fma(r472801, r472803, r472805);
return r472806;
}




Bits error versus x




Bits error versus y
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020001 +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)))