\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 r209016 = x_re;
double r209017 = r209016 * r209016;
double r209018 = x_im;
double r209019 = r209018 * r209018;
double r209020 = r209017 - r209019;
double r209021 = r209020 * r209016;
double r209022 = r209016 * r209018;
double r209023 = r209018 * r209016;
double r209024 = r209022 + r209023;
double r209025 = r209024 * r209018;
double r209026 = r209021 - r209025;
return r209026;
}
double f(double x_re, double x_im) {
double r209027 = x_re;
double r209028 = 3.0;
double r209029 = pow(r209027, r209028);
double r209030 = x_im;
double r209031 = r209030 * r209027;
double r209032 = r209028 * r209031;
double r209033 = r209032 * r209030;
double r209034 = r209029 - r209033;
return r209034;
}




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