\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 r471521 = x;
double r471522 = r471521 * r471521;
double r471523 = y;
double r471524 = r471523 * r471523;
double r471525 = r471522 + r471524;
double r471526 = r471525 + r471524;
double r471527 = r471526 + r471524;
return r471527;
}
double f(double x, double y) {
double r471528 = x;
double r471529 = y;
double r471530 = 3.0;
double r471531 = r471530 * r471529;
double r471532 = r471529 * r471531;
double r471533 = fma(r471528, r471528, r471532);
return r471533;
}




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