\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\mathsf{fma}\left(3, y \cdot y, x \cdot x\right)double f(double x, double y) {
double r408593 = x;
double r408594 = r408593 * r408593;
double r408595 = y;
double r408596 = r408595 * r408595;
double r408597 = r408594 + r408596;
double r408598 = r408597 + r408596;
double r408599 = r408598 + r408596;
return r408599;
}
double f(double x, double y) {
double r408600 = 3.0;
double r408601 = y;
double r408602 = r408601 * r408601;
double r408603 = x;
double r408604 = r408603 * r408603;
double r408605 = fma(r408600, r408602, r408604);
return r408605;
}




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