\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 r447113 = x_re;
double r447114 = r447113 * r447113;
double r447115 = x_im;
double r447116 = r447115 * r447115;
double r447117 = r447114 - r447116;
double r447118 = r447117 * r447115;
double r447119 = r447113 * r447115;
double r447120 = r447115 * r447113;
double r447121 = r447119 + r447120;
double r447122 = r447121 * r447113;
double r447123 = r447118 + r447122;
return r447123;
}
double f(double x_re, double x_im) {
double r447124 = 3.0;
double r447125 = x_im;
double r447126 = r447124 * r447125;
double r447127 = x_re;
double r447128 = r447126 * r447127;
double r447129 = r447128 * r447127;
double r447130 = pow(r447125, r447124);
double r447131 = r447129 - r447130;
return r447131;
}




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
(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)))