\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\mathsf{fma}\left(x, x, \left(y \cdot y\right) \cdot 3\right)double f(double x, double y) {
double r19394649 = x;
double r19394650 = r19394649 * r19394649;
double r19394651 = y;
double r19394652 = r19394651 * r19394651;
double r19394653 = r19394650 + r19394652;
double r19394654 = r19394653 + r19394652;
double r19394655 = r19394654 + r19394652;
return r19394655;
}
double f(double x, double y) {
double r19394656 = x;
double r19394657 = y;
double r19394658 = r19394657 * r19394657;
double r19394659 = 3.0;
double r19394660 = r19394658 * r19394659;
double r19394661 = fma(r19394656, r19394656, r19394660);
return r19394661;
}




Bits error versus x




Bits error versus y
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 0.1
Simplified0.1
rmApplied associate-*l*0.1
rmApplied add-cube-cbrt0.1
Applied associate-*l*0.2
rmApplied associate-*r*0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019172 +o rules:numerics
(FPCore (x y)
:name "Linear.Quaternion:$c/ from linear-1.19.1.3, E"
:herbie-target
(+ (* x x) (* y (+ y (+ y y))))
(+ (+ (+ (* x x) (* y y)) (* y y)) (* y y)))