\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 r532068 = x;
double r532069 = r532068 * r532068;
double r532070 = y;
double r532071 = r532070 * r532070;
double r532072 = r532069 + r532071;
double r532073 = r532072 + r532071;
double r532074 = r532073 + r532071;
return r532074;
}
double f(double x, double y) {
double r532075 = y;
double r532076 = 2.0;
double r532077 = pow(r532075, r532076);
double r532078 = 3.0;
double r532079 = x;
double r532080 = pow(r532079, r532076);
double r532081 = fma(r532077, r532078, r532080);
return r532081;
}




Bits error versus x




Bits error versus y
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 0.1
Taylor expanded around 0 0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2020025 +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)))