\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 r487826 = x;
double r487827 = r487826 * r487826;
double r487828 = y;
double r487829 = r487828 * r487828;
double r487830 = r487827 + r487829;
double r487831 = r487830 + r487829;
double r487832 = r487831 + r487829;
return r487832;
}
double f(double x, double y) {
double r487833 = 3.0;
double r487834 = y;
double r487835 = r487834 * r487834;
double r487836 = x;
double r487837 = r487836 * r487836;
double r487838 = fma(r487833, r487835, r487837);
return r487838;
}




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