\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\mathsf{fma}\left(3 \cdot y, y, x \cdot x\right)double f(double x, double y) {
double r555369 = x;
double r555370 = r555369 * r555369;
double r555371 = y;
double r555372 = r555371 * r555371;
double r555373 = r555370 + r555372;
double r555374 = r555373 + r555372;
double r555375 = r555374 + r555372;
return r555375;
}
double f(double x, double y) {
double r555376 = 3.0;
double r555377 = y;
double r555378 = r555376 * r555377;
double r555379 = x;
double r555380 = r555379 * r555379;
double r555381 = fma(r555378, r555377, r555380);
return r555381;
}




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
rmApplied *-un-lft-identity0.2
Applied sqrt-prod0.2
Simplified0.2
Simplified0.2
Taylor expanded around 0 0.2
Simplified0.1
Final simplification0.1
herbie shell --seed 2019350 +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)))