\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 r217340 = x_re;
double r217341 = r217340 * r217340;
double r217342 = x_im;
double r217343 = r217342 * r217342;
double r217344 = r217341 - r217343;
double r217345 = r217344 * r217342;
double r217346 = r217340 * r217342;
double r217347 = r217342 * r217340;
double r217348 = r217346 + r217347;
double r217349 = r217348 * r217340;
double r217350 = r217345 + r217349;
return r217350;
}
double f(double x_re, double x_im) {
double r217351 = 3.0;
double r217352 = x_im;
double r217353 = r217351 * r217352;
double r217354 = x_re;
double r217355 = r217353 * r217354;
double r217356 = r217355 * r217354;
double r217357 = pow(r217352, r217351);
double r217358 = r217356 - r217357;
return r217358;
}




Bits error versus x.re




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