\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\mathsf{fma}\left(x, x, \left(y \cdot y\right) \cdot 3\right)double f(double x, double y) {
double r20263089 = x;
double r20263090 = r20263089 * r20263089;
double r20263091 = y;
double r20263092 = r20263091 * r20263091;
double r20263093 = r20263090 + r20263092;
double r20263094 = r20263093 + r20263092;
double r20263095 = r20263094 + r20263092;
return r20263095;
}
double f(double x, double y) {
double r20263096 = x;
double r20263097 = y;
double r20263098 = r20263097 * r20263097;
double r20263099 = 3.0;
double r20263100 = r20263098 * r20263099;
double r20263101 = fma(r20263096, r20263096, r20263100);
return r20263101;
}




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-*l*0.1
Final simplification0.1
herbie shell --seed 2019169 +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)))