\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 r674902 = x;
double r674903 = r674902 * r674902;
double r674904 = y;
double r674905 = r674904 * r674904;
double r674906 = r674903 + r674905;
double r674907 = r674906 + r674905;
double r674908 = r674907 + r674905;
return r674908;
}
double f(double x, double y) {
double r674909 = x;
double r674910 = 3.0;
double r674911 = y;
double r674912 = r674910 * r674911;
double r674913 = r674912 * r674911;
double r674914 = fma(r674909, r674909, r674913);
return r674914;
}




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