\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\mathsf{fma}\left(x, x, \mathsf{fma}\left(y, y, y \cdot y\right)\right) + y \cdot ydouble f(double x, double y) {
double r445861 = x;
double r445862 = r445861 * r445861;
double r445863 = y;
double r445864 = r445863 * r445863;
double r445865 = r445862 + r445864;
double r445866 = r445865 + r445864;
double r445867 = r445866 + r445864;
return r445867;
}
double f(double x, double y) {
double r445868 = x;
double r445869 = y;
double r445870 = r445869 * r445869;
double r445871 = fma(r445869, r445869, r445870);
double r445872 = fma(r445868, r445868, r445871);
double r445873 = r445872 + r445870;
return r445873;
}




Bits error versus x




Bits error versus y
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 0.1
rmApplied add-sqr-sqrt0.2
Applied fma-def0.2
rmApplied fma-udef0.2
Simplified0.1
Final simplification0.1
herbie shell --seed 2020035 +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)))