\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 r312611 = x;
double r312612 = r312611 * r312611;
double r312613 = y;
double r312614 = r312613 * r312613;
double r312615 = r312612 + r312614;
double r312616 = r312615 + r312614;
double r312617 = r312616 + r312614;
return r312617;
}
double f(double x, double y) {
double r312618 = x;
double r312619 = y;
double r312620 = 3.0;
double r312621 = r312620 * r312619;
double r312622 = r312619 * r312621;
double r312623 = fma(r312618, r312618, r312622);
return r312623;
}




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