\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\mathsf{fma}\left(3, y \cdot y, x \cdot x\right)double f(double x, double y) {
double r2192 = x;
double r2193 = r2192 * r2192;
double r2194 = y;
double r2195 = r2194 * r2194;
double r2196 = r2193 + r2195;
double r2197 = r2196 + r2195;
double r2198 = r2197 + r2195;
return r2198;
}
double f(double x, double y) {
double r2199 = 3.0;
double r2200 = y;
double r2201 = r2200 * r2200;
double r2202 = x;
double r2203 = r2202 * r2202;
double r2204 = fma(r2199, r2201, r2203);
return r2204;
}




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