\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re
\left(\left(3 \cdot x.im\right) \cdot x.re\right) \cdot x.re - {x.im}^{3}double f(double x_re, double x_im) {
double r218855 = x_re;
double r218856 = r218855 * r218855;
double r218857 = x_im;
double r218858 = r218857 * r218857;
double r218859 = r218856 - r218858;
double r218860 = r218859 * r218857;
double r218861 = r218855 * r218857;
double r218862 = r218857 * r218855;
double r218863 = r218861 + r218862;
double r218864 = r218863 * r218855;
double r218865 = r218860 + r218864;
return r218865;
}
double f(double x_re, double x_im) {
double r218866 = 3.0;
double r218867 = x_im;
double r218868 = r218866 * r218867;
double r218869 = x_re;
double r218870 = r218868 * r218869;
double r218871 = r218870 * r218869;
double r218872 = pow(r218867, r218866);
double r218873 = r218871 - r218872;
return r218873;
}




Bits error versus x.re




Bits error versus x.im
Results
| Original | 7.4 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 7.4
Simplified7.3
rmApplied associate-*r*0.2
rmApplied associate-*r*0.2
rmApplied associate-*r*0.2
Final simplification0.2
herbie shell --seed 2020021 +o rules:numerics
(FPCore (x.re x.im)
:name "math.cube on complex, imaginary part"
:precision binary64
:herbie-target
(+ (* (* x.re x.im) (* 2 x.re)) (* (* x.im (- x.re x.im)) (+ x.re x.im)))
(+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))