\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\mathsf{fma}\left(x, x, \left(3 \cdot y\right) \cdot y\right)double f(double x, double y) {
double r366138 = x;
double r366139 = r366138 * r366138;
double r366140 = y;
double r366141 = r366140 * r366140;
double r366142 = r366139 + r366141;
double r366143 = r366142 + r366141;
double r366144 = r366143 + r366141;
return r366144;
}
double f(double x, double y) {
double r366145 = x;
double r366146 = 3.0;
double r366147 = y;
double r366148 = r366146 * r366147;
double r366149 = r366148 * r366147;
double r366150 = fma(r366145, r366145, r366149);
return r366150;
}




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-*r*0.1
Final simplification0.1
herbie shell --seed 2019323 +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)))