\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\mathsf{fma}\left(x, x, \left(y + y\right) \cdot y\right) + y \cdot ydouble f(double x, double y) {
double r427595 = x;
double r427596 = r427595 * r427595;
double r427597 = y;
double r427598 = r427597 * r427597;
double r427599 = r427596 + r427598;
double r427600 = r427599 + r427598;
double r427601 = r427600 + r427598;
return r427601;
}
double f(double x, double y) {
double r427602 = x;
double r427603 = y;
double r427604 = r427603 + r427603;
double r427605 = r427604 * r427603;
double r427606 = fma(r427602, r427602, r427605);
double r427607 = r427603 * r427603;
double r427608 = r427606 + r427607;
return r427608;
}




Bits error versus x




Bits error versus y
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 0.1
rmApplied add-sqr-sqrt0.2
Applied fma-def0.2
rmApplied fma-udef0.2
Simplified0.1
Final simplification0.1
herbie shell --seed 2019209 +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)))