\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(\left(x.im \cdot 3\right) \cdot x.re\right) \cdot x.imdouble f(double x_re, double x_im) {
double r107044 = x_re;
double r107045 = r107044 * r107044;
double r107046 = x_im;
double r107047 = r107046 * r107046;
double r107048 = r107045 - r107047;
double r107049 = r107048 * r107044;
double r107050 = r107044 * r107046;
double r107051 = r107046 * r107044;
double r107052 = r107050 + r107051;
double r107053 = r107052 * r107046;
double r107054 = r107049 - r107053;
return r107054;
}
double f(double x_re, double x_im) {
double r107055 = x_re;
double r107056 = 3.0;
double r107057 = pow(r107055, r107056);
double r107058 = x_im;
double r107059 = r107058 * r107056;
double r107060 = r107059 * r107055;
double r107061 = r107060 * r107058;
double r107062 = r107057 - r107061;
return r107062;
}




Bits error versus x.re




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