\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(x.im \cdot 3\right) \cdot \left(x.re \cdot x.im\right)double f(double x_re, double x_im) {
double r194076 = x_re;
double r194077 = r194076 * r194076;
double r194078 = x_im;
double r194079 = r194078 * r194078;
double r194080 = r194077 - r194079;
double r194081 = r194080 * r194076;
double r194082 = r194076 * r194078;
double r194083 = r194078 * r194076;
double r194084 = r194082 + r194083;
double r194085 = r194084 * r194078;
double r194086 = r194081 - r194085;
return r194086;
}
double f(double x_re, double x_im) {
double r194087 = x_re;
double r194088 = 3.0;
double r194089 = pow(r194087, r194088);
double r194090 = x_im;
double r194091 = r194090 * r194088;
double r194092 = r194087 * r194090;
double r194093 = r194091 * r194092;
double r194094 = r194089 - r194093;
return r194094;
}




Bits error versus x.re




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