\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\mathsf{fma}\left({y}^{2}, 3, {x}^{2}\right)double f(double x, double y) {
double r518047 = x;
double r518048 = r518047 * r518047;
double r518049 = y;
double r518050 = r518049 * r518049;
double r518051 = r518048 + r518050;
double r518052 = r518051 + r518050;
double r518053 = r518052 + r518050;
return r518053;
}
double f(double x, double y) {
double r518054 = y;
double r518055 = 2.0;
double r518056 = pow(r518054, r518055);
double r518057 = 3.0;
double r518058 = x;
double r518059 = pow(r518058, r518055);
double r518060 = fma(r518056, r518057, r518059);
return r518060;
}




Bits error versus x




Bits error versus y
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 0.1
rmApplied add-sqr-sqrt0.2
Applied fma-def0.2
Taylor expanded around 0 0.4
Simplified0.1
Final simplification0.1
herbie shell --seed 2020036 +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)))