\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 r220123 = x_re;
double r220124 = r220123 * r220123;
double r220125 = x_im;
double r220126 = r220125 * r220125;
double r220127 = r220124 - r220126;
double r220128 = r220127 * r220125;
double r220129 = r220123 * r220125;
double r220130 = r220125 * r220123;
double r220131 = r220129 + r220130;
double r220132 = r220131 * r220123;
double r220133 = r220128 + r220132;
return r220133;
}
double f(double x_re, double x_im) {
double r220134 = 3.0;
double r220135 = x_im;
double r220136 = r220134 * r220135;
double r220137 = x_re;
double r220138 = r220136 * r220137;
double r220139 = r220138 * r220137;
double r220140 = pow(r220135, r220134);
double r220141 = r220139 - r220140;
return r220141;
}




Bits error versus x.re




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