\left(\left(x \cdot x + y \cdot y\right) + y \cdot y\right) + y \cdot y
\mathsf{fma}\left({y}^{2}, 3, {x}^{2}\right)double f(double x, double y) {
double r498986 = x;
double r498987 = r498986 * r498986;
double r498988 = y;
double r498989 = r498988 * r498988;
double r498990 = r498987 + r498989;
double r498991 = r498990 + r498989;
double r498992 = r498991 + r498989;
return r498992;
}
double f(double x, double y) {
double r498993 = y;
double r498994 = 2.0;
double r498995 = pow(r498993, r498994);
double r498996 = 3.0;
double r498997 = x;
double r498998 = pow(r498997, r498994);
double r498999 = fma(r498995, r498996, r498998);
return r498999;
}




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
Taylor expanded around 0 0.4
Simplified0.1
Final simplification0.1
herbie shell --seed 2020036 +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)))