\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 r200822 = x_re;
double r200823 = r200822 * r200822;
double r200824 = x_im;
double r200825 = r200824 * r200824;
double r200826 = r200823 - r200825;
double r200827 = r200826 * r200824;
double r200828 = r200822 * r200824;
double r200829 = r200824 * r200822;
double r200830 = r200828 + r200829;
double r200831 = r200830 * r200822;
double r200832 = r200827 + r200831;
return r200832;
}
double f(double x_re, double x_im) {
double r200833 = 3.0;
double r200834 = x_im;
double r200835 = r200833 * r200834;
double r200836 = x_re;
double r200837 = r200835 * r200836;
double r200838 = r200837 * r200836;
double r200839 = pow(r200834, r200833);
double r200840 = r200838 - r200839;
return r200840;
}




Bits error versus x.re




Bits error versus x.im
Results
| Original | 7.6 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 7.6
Simplified7.5
rmApplied associate-*r*0.2
rmApplied associate-*r*0.2
rmApplied associate-*r*0.2
Final simplification0.2
herbie shell --seed 2020034 +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)))