\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 r384188 = x;
double r384189 = r384188 * r384188;
double r384190 = y;
double r384191 = r384190 * r384190;
double r384192 = r384189 + r384191;
double r384193 = r384192 + r384191;
double r384194 = r384193 + r384191;
return r384194;
}
double f(double x, double y) {
double r384195 = x;
double r384196 = 3.0;
double r384197 = y;
double r384198 = r384196 * r384197;
double r384199 = r384198 * r384197;
double r384200 = fma(r384195, r384195, r384199);
return r384200;
}




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