\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 r380467 = x_re;
double r380468 = r380467 * r380467;
double r380469 = x_im;
double r380470 = r380469 * r380469;
double r380471 = r380468 - r380470;
double r380472 = r380471 * r380469;
double r380473 = r380467 * r380469;
double r380474 = r380469 * r380467;
double r380475 = r380473 + r380474;
double r380476 = r380475 * r380467;
double r380477 = r380472 + r380476;
return r380477;
}
double f(double x_re, double x_im) {
double r380478 = 3.0;
double r380479 = x_im;
double r380480 = r380478 * r380479;
double r380481 = x_re;
double r380482 = r380480 * r380481;
double r380483 = r380482 * r380481;
double r380484 = pow(r380479, r380478);
double r380485 = r380483 - r380484;
return r380485;
}




Bits error versus x.re




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