\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\mathsf{fma}\left(x, x, \mathsf{fma}\left(y, y, y \cdot y\right)\right) + y \cdot ydouble f(double x, double y) {
double r478116 = x;
double r478117 = r478116 * r478116;
double r478118 = y;
double r478119 = r478118 * r478118;
double r478120 = r478117 + r478119;
double r478121 = r478120 + r478119;
double r478122 = r478121 + r478119;
return r478122;
}
double f(double x, double y) {
double r478123 = x;
double r478124 = y;
double r478125 = r478124 * r478124;
double r478126 = fma(r478124, r478124, r478125);
double r478127 = fma(r478123, r478123, r478126);
double r478128 = r478127 + r478125;
return r478128;
}




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 fma-udef0.2
Simplified0.1
Final simplification0.1
herbie shell --seed 2020081 +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)))