\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\mathsf{fma}\left(x, x, 3 \cdot \left(y \cdot y\right)\right)double f(double x, double y) {
double r328466 = x;
double r328467 = r328466 * r328466;
double r328468 = y;
double r328469 = r328468 * r328468;
double r328470 = r328467 + r328469;
double r328471 = r328470 + r328469;
double r328472 = r328471 + r328469;
return r328472;
}
double f(double x, double y) {
double r328473 = x;
double r328474 = 3.0;
double r328475 = y;
double r328476 = r328475 * r328475;
double r328477 = r328474 * r328476;
double r328478 = fma(r328473, r328473, r328477);
return r328478;
}




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