\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im
{x.re}^{3} - \left(x.im \cdot 3\right) \cdot \left(x.re \cdot x.im\right)double f(double x_re, double x_im) {
double r155622 = x_re;
double r155623 = r155622 * r155622;
double r155624 = x_im;
double r155625 = r155624 * r155624;
double r155626 = r155623 - r155625;
double r155627 = r155626 * r155622;
double r155628 = r155622 * r155624;
double r155629 = r155624 * r155622;
double r155630 = r155628 + r155629;
double r155631 = r155630 * r155624;
double r155632 = r155627 - r155631;
return r155632;
}
double f(double x_re, double x_im) {
double r155633 = x_re;
double r155634 = 3.0;
double r155635 = pow(r155633, r155634);
double r155636 = x_im;
double r155637 = r155636 * r155634;
double r155638 = r155633 * r155636;
double r155639 = r155637 * r155638;
double r155640 = r155635 - r155639;
return r155640;
}




Bits error versus x.re




Bits error versus x.im
Results
| Original | 7.2 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 7.2
Simplified0.2
rmApplied associate-*r*0.2
rmApplied associate-*r*0.2
Simplified0.2
rmApplied associate-*l*0.2
Final simplification0.2
herbie shell --seed 2019303
(FPCore (x.re x.im)
:name "math.cube on complex, real part"
:precision binary64
:herbie-target
(+ (* (* x.re x.re) (- x.re x.im)) (* (* x.re x.im) (- x.re (* 3 x.im))))
(- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))