\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 r186559 = x_re;
double r186560 = r186559 * r186559;
double r186561 = x_im;
double r186562 = r186561 * r186561;
double r186563 = r186560 - r186562;
double r186564 = r186563 * r186561;
double r186565 = r186559 * r186561;
double r186566 = r186561 * r186559;
double r186567 = r186565 + r186566;
double r186568 = r186567 * r186559;
double r186569 = r186564 + r186568;
return r186569;
}
double f(double x_re, double x_im) {
double r186570 = 3.0;
double r186571 = x_im;
double r186572 = r186570 * r186571;
double r186573 = x_re;
double r186574 = r186572 * r186573;
double r186575 = r186574 * r186573;
double r186576 = pow(r186571, r186570);
double r186577 = r186575 - r186576;
return r186577;
}




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