\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 r287734 = x;
double r287735 = r287734 * r287734;
double r287736 = y;
double r287737 = r287736 * r287736;
double r287738 = r287735 + r287737;
double r287739 = r287738 + r287737;
double r287740 = r287739 + r287737;
return r287740;
}
double f(double x, double y) {
double r287741 = 3.0;
double r287742 = y;
double r287743 = r287742 * r287742;
double r287744 = x;
double r287745 = r287744 * r287744;
double r287746 = fma(r287741, r287743, r287745);
return r287746;
}




Bits error versus x




Bits error versus y
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 0.1
Simplified0.1
rmApplied pow10.1
rmApplied add-cube-cbrt0.1
Applied associate-*l*0.2
Taylor expanded around 0 0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019304 +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)))