\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 r316939 = x;
double r316940 = r316939 * r316939;
double r316941 = y;
double r316942 = r316941 * r316941;
double r316943 = r316940 + r316942;
double r316944 = r316943 + r316942;
double r316945 = r316944 + r316942;
return r316945;
}
double f(double x, double y) {
double r316946 = x;
double r316947 = 3.0;
double r316948 = y;
double r316949 = r316947 * r316948;
double r316950 = r316949 * r316948;
double r316951 = fma(r316946, r316946, r316950);
return r316951;
}




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 2019198 +o rules:numerics
(FPCore (x y)
:name "Linear.Quaternion:$c/ from linear-1.19.1.3, E"
:herbie-target
(+ (* x x) (* y (+ y (+ y y))))
(+ (+ (+ (* x x) (* y y)) (* y y)) (* y y)))