\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 r97468 = x_re;
double r97469 = r97468 * r97468;
double r97470 = x_im;
double r97471 = r97470 * r97470;
double r97472 = r97469 - r97471;
double r97473 = r97472 * r97468;
double r97474 = r97468 * r97470;
double r97475 = r97470 * r97468;
double r97476 = r97474 + r97475;
double r97477 = r97476 * r97470;
double r97478 = r97473 - r97477;
return r97478;
}
double f(double x_re, double x_im) {
double r97479 = x_re;
double r97480 = 3.0;
double r97481 = pow(r97479, r97480);
double r97482 = x_im;
double r97483 = r97482 * r97480;
double r97484 = r97483 * r97479;
double r97485 = r97484 * r97482;
double r97486 = r97481 - r97485;
return r97486;
}




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