\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im
\left(-3 \cdot \left(x.re \cdot x.im\right)\right) \cdot x.im + {x.re}^{3}double f(double x_re, double x_im) {
double r258982 = x_re;
double r258983 = r258982 * r258982;
double r258984 = x_im;
double r258985 = r258984 * r258984;
double r258986 = r258983 - r258985;
double r258987 = r258986 * r258982;
double r258988 = r258982 * r258984;
double r258989 = r258984 * r258982;
double r258990 = r258988 + r258989;
double r258991 = r258990 * r258984;
double r258992 = r258987 - r258991;
return r258992;
}
double f(double x_re, double x_im) {
double r258993 = -3.0;
double r258994 = x_re;
double r258995 = x_im;
double r258996 = r258994 * r258995;
double r258997 = r258993 * r258996;
double r258998 = r258997 * r258995;
double r258999 = 3.0;
double r259000 = pow(r258994, r258999);
double r259001 = r258998 + r259000;
return r259001;
}




Bits error versus x.re




Bits error versus x.im
Results
| Original | 7.0 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 7.0
Simplified6.9
rmApplied distribute-rgt-neg-in6.9
Applied associate-*r*0.2
rmApplied fma-udef0.2
Simplified0.2
rmApplied associate-*r*0.2
Final simplification0.2
herbie shell --seed 2020056 +o rules:numerics
(FPCore (x.re x.im)
:name "math.cube on complex, real part"
:precision binary64
:herbie-target
(+ (* (* x.re x.re) (- x.re x.im)) (* (* x.re x.im) (- x.re (* 3 x.im))))
(- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))