\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 r18661217 = x;
double r18661218 = r18661217 * r18661217;
double r18661219 = y;
double r18661220 = r18661219 * r18661219;
double r18661221 = r18661218 + r18661220;
double r18661222 = r18661221 + r18661220;
double r18661223 = r18661222 + r18661220;
return r18661223;
}
double f(double x, double y) {
double r18661224 = 3.0;
double r18661225 = y;
double r18661226 = r18661225 * r18661225;
double r18661227 = x;
double r18661228 = r18661227 * r18661227;
double r18661229 = fma(r18661224, r18661226, r18661228);
return r18661229;
}




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 inf 0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019165 +o rules:numerics
(FPCore (x y)
:name "Linear.Quaternion:$c/ from linear-1.19.1.3, E"
:herbie-target
(+ (* x x) (* y (+ y (+ y y))))
(+ (+ (+ (* x x) (* y y)) (* y y)) (* y y)))