\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
{x.re}^{3} - \left(3 \cdot \left(x.im \cdot x.re\right)\right) \cdot x.imdouble f(double x_re, double x_im) {
double r177046 = x_re;
double r177047 = r177046 * r177046;
double r177048 = x_im;
double r177049 = r177048 * r177048;
double r177050 = r177047 - r177049;
double r177051 = r177050 * r177046;
double r177052 = r177046 * r177048;
double r177053 = r177048 * r177046;
double r177054 = r177052 + r177053;
double r177055 = r177054 * r177048;
double r177056 = r177051 - r177055;
return r177056;
}
double f(double x_re, double x_im) {
double r177057 = x_re;
double r177058 = 3.0;
double r177059 = pow(r177057, r177058);
double r177060 = x_im;
double r177061 = r177060 * r177057;
double r177062 = r177058 * r177061;
double r177063 = r177062 * r177060;
double r177064 = r177059 - r177063;
return r177064;
}




Bits error versus x.re




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