\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 r113587 = x_re;
double r113588 = r113587 * r113587;
double r113589 = x_im;
double r113590 = r113589 * r113589;
double r113591 = r113588 - r113590;
double r113592 = r113591 * r113589;
double r113593 = r113587 * r113589;
double r113594 = r113589 * r113587;
double r113595 = r113593 + r113594;
double r113596 = r113595 * r113587;
double r113597 = r113592 + r113596;
return r113597;
}
double f(double x_re, double x_im) {
double r113598 = 3.0;
double r113599 = x_im;
double r113600 = x_re;
double r113601 = r113599 * r113600;
double r113602 = r113598 * r113601;
double r113603 = r113602 * r113600;
double r113604 = pow(r113599, r113598);
double r113605 = r113603 - r113604;
return r113605;
}




Bits error versus x.re




Bits error versus x.im
Results
| Original | 7.5 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 7.5
Simplified7.5
rmApplied associate-*r*0.2
rmApplied associate-*r*0.2
Final simplification0.2
herbie shell --seed 2020059 +o rules:numerics
(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)))