\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 x.re\right) \cdot \left(x.im \cdot x.re\right) - {x.im}^{3}double f(double x_re, double x_im) {
double r255354 = x_re;
double r255355 = r255354 * r255354;
double r255356 = x_im;
double r255357 = r255356 * r255356;
double r255358 = r255355 - r255357;
double r255359 = r255358 * r255356;
double r255360 = r255354 * r255356;
double r255361 = r255356 * r255354;
double r255362 = r255360 + r255361;
double r255363 = r255362 * r255354;
double r255364 = r255359 + r255363;
return r255364;
}
double f(double x_re, double x_im) {
double r255365 = 3.0;
double r255366 = x_re;
double r255367 = r255365 * r255366;
double r255368 = x_im;
double r255369 = r255368 * r255366;
double r255370 = r255367 * r255369;
double r255371 = pow(r255368, r255365);
double r255372 = r255370 - r255371;
return r255372;
}




Bits error versus x.re




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