\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\mathsf{fma}\left(x, x, y \cdot \left(3 \cdot y\right)\right)double f(double x, double y) {
double r288280 = x;
double r288281 = r288280 * r288280;
double r288282 = y;
double r288283 = r288282 * r288282;
double r288284 = r288281 + r288283;
double r288285 = r288284 + r288283;
double r288286 = r288285 + r288283;
return r288286;
}
double f(double x, double y) {
double r288287 = x;
double r288288 = y;
double r288289 = 3.0;
double r288290 = r288289 * r288288;
double r288291 = r288288 * r288290;
double r288292 = fma(r288287, r288287, r288291);
return r288292;
}




Bits error versus x




Bits error versus y
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.1 |
Initial program 0.1
Simplified0.1
rmApplied pow10.1
Applied pow10.1
Applied pow-prod-down0.1
Applied pow10.1
Applied pow-prod-down0.1
Simplified0.1
Final simplification0.1
herbie shell --seed 2019306 +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)))