\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 r627674 = x;
double r627675 = r627674 * r627674;
double r627676 = y;
double r627677 = r627676 * r627676;
double r627678 = r627675 + r627677;
double r627679 = r627678 + r627677;
double r627680 = r627679 + r627677;
return r627680;
}
double f(double x, double y) {
double r627681 = 3.0;
double r627682 = y;
double r627683 = r627682 * r627682;
double r627684 = x;
double r627685 = r627684 * r627684;
double r627686 = fma(r627681, r627683, r627685);
return r627686;
}




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