\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 r7138235 = x_re;
double r7138236 = r7138235 * r7138235;
double r7138237 = x_im;
double r7138238 = r7138237 * r7138237;
double r7138239 = r7138236 - r7138238;
double r7138240 = r7138239 * r7138237;
double r7138241 = r7138235 * r7138237;
double r7138242 = r7138237 * r7138235;
double r7138243 = r7138241 + r7138242;
double r7138244 = r7138243 * r7138235;
double r7138245 = r7138240 + r7138244;
return r7138245;
}
double f(double x_re, double x_im) {
double r7138246 = x_re;
double r7138247 = 3.0;
double r7138248 = r7138246 * r7138247;
double r7138249 = x_im;
double r7138250 = r7138248 * r7138249;
double r7138251 = r7138250 * r7138246;
double r7138252 = pow(r7138249, r7138247);
double r7138253 = r7138251 - r7138252;
return r7138253;
}




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)))