\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\mathsf{fma}\left(x, x, 3 \cdot \left(y \cdot y\right)\right)double f(double x, double y) {
double r296772 = x;
double r296773 = r296772 * r296772;
double r296774 = y;
double r296775 = r296774 * r296774;
double r296776 = r296773 + r296775;
double r296777 = r296776 + r296775;
double r296778 = r296777 + r296775;
return r296778;
}
double f(double x, double y) {
double r296779 = x;
double r296780 = 3.0;
double r296781 = y;
double r296782 = r296781 * r296781;
double r296783 = r296780 * r296782;
double r296784 = fma(r296779, r296779, r296783);
return r296784;
}




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