\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(3 \cdot \left(x.im \cdot x.re\right)\right) \cdot x.re - {x.im}^{3}double f(double x_re, double x_im) {
double r209438 = x_re;
double r209439 = r209438 * r209438;
double r209440 = x_im;
double r209441 = r209440 * r209440;
double r209442 = r209439 - r209441;
double r209443 = r209442 * r209440;
double r209444 = r209438 * r209440;
double r209445 = r209440 * r209438;
double r209446 = r209444 + r209445;
double r209447 = r209446 * r209438;
double r209448 = r209443 + r209447;
return r209448;
}
double f(double x_re, double x_im) {
double r209449 = 3.0;
double r209450 = x_im;
double r209451 = x_re;
double r209452 = r209450 * r209451;
double r209453 = r209449 * r209452;
double r209454 = r209453 * r209451;
double r209455 = pow(r209450, r209449);
double r209456 = r209454 - r209455;
return r209456;
}




Bits error versus x.re




Bits error versus x.im
Results
| Original | 7.7 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 7.7
Simplified7.7
rmApplied associate-*r*0.2
rmApplied associate-*r*0.2
rmApplied associate-*r*0.2
rmApplied *-un-lft-identity0.2
Applied associate-*r*0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2020046
(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)))