\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 r564321 = x;
double r564322 = r564321 * r564321;
double r564323 = y;
double r564324 = r564323 * r564323;
double r564325 = r564322 + r564324;
double r564326 = r564325 + r564324;
double r564327 = r564326 + r564324;
return r564327;
}
double f(double x, double y) {
double r564328 = x;
double r564329 = 3.0;
double r564330 = y;
double r564331 = r564329 * r564330;
double r564332 = r564331 * r564330;
double r564333 = fma(r564328, r564328, r564332);
return r564333;
}




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