\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 r354069 = x;
double r354070 = r354069 * r354069;
double r354071 = y;
double r354072 = r354071 * r354071;
double r354073 = r354070 + r354072;
double r354074 = r354073 + r354072;
double r354075 = r354074 + r354072;
return r354075;
}
double f(double x, double y) {
double r354076 = x;
double r354077 = 3.0;
double r354078 = y;
double r354079 = r354077 * r354078;
double r354080 = r354079 * r354078;
double r354081 = fma(r354076, r354076, r354080);
return r354081;
}




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