\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\mathsf{fma}\left(x, x, y \cdot \left(3 \cdot y\right)\right)double f(double x, double y) {
double r596350 = x;
double r596351 = r596350 * r596350;
double r596352 = y;
double r596353 = r596352 * r596352;
double r596354 = r596351 + r596353;
double r596355 = r596354 + r596353;
double r596356 = r596355 + r596353;
return r596356;
}
double f(double x, double y) {
double r596357 = x;
double r596358 = y;
double r596359 = 3.0;
double r596360 = r596359 * r596358;
double r596361 = r596358 * r596360;
double r596362 = fma(r596357, r596357, r596361);
return r596362;
}




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
Applied pow10.1
Applied pow-prod-down0.1
Applied pow10.1
Applied pow-prod-down0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020046 +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)))