\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(x.re \cdot 3\right) \cdot x.im\right) \cdot x.re - {x.im}^{3}double f(double x_re, double x_im) {
double r7107926 = x_re;
double r7107927 = r7107926 * r7107926;
double r7107928 = x_im;
double r7107929 = r7107928 * r7107928;
double r7107930 = r7107927 - r7107929;
double r7107931 = r7107930 * r7107928;
double r7107932 = r7107926 * r7107928;
double r7107933 = r7107928 * r7107926;
double r7107934 = r7107932 + r7107933;
double r7107935 = r7107934 * r7107926;
double r7107936 = r7107931 + r7107935;
return r7107936;
}
double f(double x_re, double x_im) {
double r7107937 = x_re;
double r7107938 = 3.0;
double r7107939 = r7107937 * r7107938;
double r7107940 = x_im;
double r7107941 = r7107939 * r7107940;
double r7107942 = r7107941 * r7107937;
double r7107943 = pow(r7107940, r7107938);
double r7107944 = r7107942 - r7107943;
return r7107944;
}




Bits error versus x.re




Bits error versus x.im
Results
| Original | 7.3 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 7.3
rmApplied difference-of-squares7.3
Applied associate-*l*0.2
Taylor expanded around 0 7.3
Simplified0.3
rmApplied pow10.3
Applied pow10.3
Applied pow-prod-up0.3
Applied pow10.3
Applied pow-prod-up0.2
Simplified0.2
rmApplied associate-*l*0.2
Final simplification0.2
herbie shell --seed 2019200 +o rules:numerics
(FPCore (x.re x.im)
:name "math.cube on complex, imaginary part"
:herbie-target
(+ (* (* x.re x.im) (* 2.0 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)))