\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 r259638 = x_re;
double r259639 = r259638 * r259638;
double r259640 = x_im;
double r259641 = r259640 * r259640;
double r259642 = r259639 - r259641;
double r259643 = r259642 * r259640;
double r259644 = r259638 * r259640;
double r259645 = r259640 * r259638;
double r259646 = r259644 + r259645;
double r259647 = r259646 * r259638;
double r259648 = r259643 + r259647;
return r259648;
}
double f(double x_re, double x_im) {
double r259649 = 3.0;
double r259650 = x_im;
double r259651 = x_re;
double r259652 = r259650 * r259651;
double r259653 = r259649 * r259652;
double r259654 = r259653 * r259651;
double r259655 = pow(r259650, r259649);
double r259656 = r259654 - r259655;
return r259656;
}




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.4
rmApplied associate-*r*0.2
rmApplied associate-*r*0.2
Final simplification0.2
herbie shell --seed 2020018 +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)))