\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 r132994 = x_re;
double r132995 = r132994 * r132994;
double r132996 = x_im;
double r132997 = r132996 * r132996;
double r132998 = r132995 - r132997;
double r132999 = r132998 * r132996;
double r133000 = r132994 * r132996;
double r133001 = r132996 * r132994;
double r133002 = r133000 + r133001;
double r133003 = r133002 * r132994;
double r133004 = r132999 + r133003;
return r133004;
}
double f(double x_re, double x_im) {
double r133005 = 3.0;
double r133006 = x_im;
double r133007 = r133005 * r133006;
double r133008 = x_re;
double r133009 = r133007 * r133008;
double r133010 = r133009 * r133008;
double r133011 = pow(r133006, r133005);
double r133012 = r133010 - r133011;
return r133012;
}




Bits error versus x.re




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