\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 r174018 = x_re;
double r174019 = r174018 * r174018;
double r174020 = x_im;
double r174021 = r174020 * r174020;
double r174022 = r174019 - r174021;
double r174023 = r174022 * r174020;
double r174024 = r174018 * r174020;
double r174025 = r174020 * r174018;
double r174026 = r174024 + r174025;
double r174027 = r174026 * r174018;
double r174028 = r174023 + r174027;
return r174028;
}
double f(double x_re, double x_im) {
double r174029 = 3.0;
double r174030 = x_im;
double r174031 = r174029 * r174030;
double r174032 = x_re;
double r174033 = r174031 * r174032;
double r174034 = r174033 * r174032;
double r174035 = pow(r174030, r174029);
double r174036 = r174034 - r174035;
return r174036;
}




Bits error versus x.re




Bits error versus x.im
Results
| Original | 6.9 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 6.9
Simplified6.9
rmApplied associate-*r*0.2
rmApplied associate-*r*0.2
rmApplied associate-*r*0.2
Final simplification0.2
herbie shell --seed 2020064 +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)))