\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(x.re \cdot 3\right) \cdot \left(x.im \cdot x.re\right) + \left(-{x.im}^{3}\right)double f(double x_re, double x_im) {
double r114007 = x_re;
double r114008 = r114007 * r114007;
double r114009 = x_im;
double r114010 = r114009 * r114009;
double r114011 = r114008 - r114010;
double r114012 = r114011 * r114009;
double r114013 = r114007 * r114009;
double r114014 = r114009 * r114007;
double r114015 = r114013 + r114014;
double r114016 = r114015 * r114007;
double r114017 = r114012 + r114016;
return r114017;
}
double f(double x_re, double x_im) {
double r114018 = x_re;
double r114019 = 3.0;
double r114020 = r114018 * r114019;
double r114021 = x_im;
double r114022 = r114021 * r114018;
double r114023 = r114020 * r114022;
double r114024 = pow(r114021, r114019);
double r114025 = -r114024;
double r114026 = r114023 + r114025;
return r114026;
}




Bits error versus x.re




Bits error versus x.im
Results
| Original | 7.5 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 7.5
Simplified0.2
rmApplied *-un-lft-identity0.2
Applied associate-*l*0.2
Simplified0.2
rmApplied fma-udef0.2
Simplified0.2
rmApplied associate-*r*0.2
Final simplification0.2
herbie shell --seed 2019208 +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)))