\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\left(x \cdot x + y \cdot y\right) + \sqrt{2 \cdot {y}^{2}} \cdot \sqrt{2 \cdot {y}^{2}}double f(double x, double y) {
double r321435 = x;
double r321436 = r321435 * r321435;
double r321437 = y;
double r321438 = r321437 * r321437;
double r321439 = r321436 + r321438;
double r321440 = r321439 + r321438;
double r321441 = r321440 + r321438;
return r321441;
}
double f(double x, double y) {
double r321442 = x;
double r321443 = r321442 * r321442;
double r321444 = y;
double r321445 = r321444 * r321444;
double r321446 = r321443 + r321445;
double r321447 = 2.0;
double r321448 = pow(r321444, r321447);
double r321449 = r321447 * r321448;
double r321450 = sqrt(r321449);
double r321451 = r321450 * r321450;
double r321452 = r321446 + r321451;
return r321452;
}




Bits error versus x




Bits error versus y
Results
| Original | 0.1 |
|---|---|
| Target | 0.1 |
| Herbie | 0.2 |
Initial program 0.1
rmApplied associate-+l+0.1
Simplified0.1
rmApplied add-sqr-sqrt0.2
Final simplification0.2
herbie shell --seed 2019323
(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)))