\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 r123886 = x_re;
double r123887 = r123886 * r123886;
double r123888 = x_im;
double r123889 = r123888 * r123888;
double r123890 = r123887 - r123889;
double r123891 = r123890 * r123886;
double r123892 = r123886 * r123888;
double r123893 = r123888 * r123886;
double r123894 = r123892 + r123893;
double r123895 = r123894 * r123888;
double r123896 = r123891 - r123895;
return r123896;
}
double f(double x_re, double x_im) {
double r123897 = x_re;
double r123898 = 3.0;
double r123899 = pow(r123897, r123898);
double r123900 = x_im;
double r123901 = r123900 * r123898;
double r123902 = r123901 * r123897;
double r123903 = r123902 * r123900;
double r123904 = r123899 - r123903;
return r123904;
}




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