\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im
\left(\left(-3 \cdot x.re\right) \cdot x.im\right) \cdot x.im + {x.re}^{3}double f(double x_re, double x_im) {
double r218754 = x_re;
double r218755 = r218754 * r218754;
double r218756 = x_im;
double r218757 = r218756 * r218756;
double r218758 = r218755 - r218757;
double r218759 = r218758 * r218754;
double r218760 = r218754 * r218756;
double r218761 = r218756 * r218754;
double r218762 = r218760 + r218761;
double r218763 = r218762 * r218756;
double r218764 = r218759 - r218763;
return r218764;
}
double f(double x_re, double x_im) {
double r218765 = -3.0;
double r218766 = x_re;
double r218767 = r218765 * r218766;
double r218768 = x_im;
double r218769 = r218767 * r218768;
double r218770 = r218769 * r218768;
double r218771 = 3.0;
double r218772 = pow(r218766, r218771);
double r218773 = r218770 + r218772;
return r218773;
}




Bits error versus x.re




Bits error versus x.im
Results
| Original | 7.3 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 7.3
Simplified7.3
rmApplied distribute-lft-neg-in7.3
Applied associate-*r*0.2
rmApplied fma-udef0.2
Simplified0.2
rmApplied associate-*r*0.2
rmApplied associate-*r*0.2
Final simplification0.2
herbie shell --seed 2020100 +o rules:numerics
(FPCore (x.re x.im)
:name "math.cube on complex, real part"
:precision binary64
:herbie-target
(+ (* (* x.re x.re) (- x.re x.im)) (* (* x.re x.im) (- x.re (* 3 x.im))))
(- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))