\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 r72079604 = x;
double r72079605 = r72079604 * r72079604;
double r72079606 = y;
double r72079607 = r72079606 * r72079606;
double r72079608 = r72079605 + r72079607;
double r72079609 = r72079608 + r72079607;
double r72079610 = r72079609 + r72079607;
return r72079610;
}
double f(double x, double y) {
double r72079611 = x;
double r72079612 = y;
double r72079613 = 3.0;
double r72079614 = r72079613 * r72079612;
double r72079615 = r72079612 * r72079614;
double r72079616 = fma(r72079611, r72079611, r72079615);
return r72079616;
}




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
rmApplied add-sqr-sqrt0.3
Taylor expanded around 0 0.4
Simplified0.1
Final simplification0.1
herbie shell --seed 2019173 +o rules:numerics
(FPCore (x y)
:name "Linear.Quaternion:$c/ from linear-1.19.1.3, E"
:herbie-target
(+ (* x x) (* y (+ y (+ y y))))
(+ (+ (+ (* x x) (* y y)) (* y y)) (* y y)))