\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\mathsf{fma}\left(x, x, \left(3 \cdot y\right) \cdot y\right)double f(double x, double y) {
double r401505 = x;
double r401506 = r401505 * r401505;
double r401507 = y;
double r401508 = r401507 * r401507;
double r401509 = r401506 + r401508;
double r401510 = r401509 + r401508;
double r401511 = r401510 + r401508;
return r401511;
}
double f(double x, double y) {
double r401512 = x;
double r401513 = 3.0;
double r401514 = y;
double r401515 = r401513 * r401514;
double r401516 = r401515 * r401514;
double r401517 = fma(r401512, r401512, r401516);
return r401517;
}




Bits error versus x




Bits error versus y
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 0.1
Simplified0.1
rmApplied associate-*r*0.1
Final simplification0.1
herbie shell --seed 2019212 +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)))