\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 r152928 = x_re;
double r152929 = r152928 * r152928;
double r152930 = x_im;
double r152931 = r152930 * r152930;
double r152932 = r152929 - r152931;
double r152933 = r152932 * r152930;
double r152934 = r152928 * r152930;
double r152935 = r152930 * r152928;
double r152936 = r152934 + r152935;
double r152937 = r152936 * r152928;
double r152938 = r152933 + r152937;
return r152938;
}
double f(double x_re, double x_im) {
double r152939 = 3.0;
double r152940 = x_im;
double r152941 = r152939 * r152940;
double r152942 = x_re;
double r152943 = r152941 * r152942;
double r152944 = r152943 * r152942;
double r152945 = pow(r152940, r152939);
double r152946 = r152944 - r152945;
return r152946;
}




Bits error versus x.re




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