\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.im \cdot \left(\left(x.im \cdot x.re\right) \cdot -3\right) + {x.re}^{3}double f(double x_re, double x_im) {
double r100689 = x_re;
double r100690 = r100689 * r100689;
double r100691 = x_im;
double r100692 = r100691 * r100691;
double r100693 = r100690 - r100692;
double r100694 = r100693 * r100689;
double r100695 = r100689 * r100691;
double r100696 = r100691 * r100689;
double r100697 = r100695 + r100696;
double r100698 = r100697 * r100691;
double r100699 = r100694 - r100698;
return r100699;
}
double f(double x_re, double x_im) {
double r100700 = x_im;
double r100701 = x_re;
double r100702 = r100700 * r100701;
double r100703 = -3.0;
double r100704 = r100702 * r100703;
double r100705 = r100700 * r100704;
double r100706 = 3.0;
double r100707 = pow(r100701, r100706);
double r100708 = r100705 + r100707;
return r100708;
}




Bits error versus x.re




Bits error versus x.im
Results
| Original | 7.6 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 7.6
Simplified7.6
rmApplied pow17.6
Applied pow17.6
Applied pow-prod-down7.6
Simplified7.6
rmApplied associate-*r*7.5
Simplified0.2
rmApplied associate-*l*0.2
Simplified0.2
rmApplied associate-*l*0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2019196
(FPCore (x.re x.im)
:name "math.cube on complex, real part"
:herbie-target
(+ (* (* x.re x.re) (- x.re x.im)) (* (* x.re x.im) (- x.re (* 3.0 x.im))))
(- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))