\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.im + \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.re
\left(3 \cdot x.re\right) \cdot \left(x.im \cdot x.re\right) - {x.im}^{3}double f(double x_re, double x_im) {
double r140532 = x_re;
double r140533 = r140532 * r140532;
double r140534 = x_im;
double r140535 = r140534 * r140534;
double r140536 = r140533 - r140535;
double r140537 = r140536 * r140534;
double r140538 = r140532 * r140534;
double r140539 = r140534 * r140532;
double r140540 = r140538 + r140539;
double r140541 = r140540 * r140532;
double r140542 = r140537 + r140541;
return r140542;
}
double f(double x_re, double x_im) {
double r140543 = 3.0;
double r140544 = x_re;
double r140545 = r140543 * r140544;
double r140546 = x_im;
double r140547 = r140546 * r140544;
double r140548 = r140545 * r140547;
double r140549 = pow(r140546, r140543);
double r140550 = r140548 - r140549;
return r140550;
}




Bits error versus x.re




Bits error versus x.im
Results
| Original | 7.5 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 7.5
Simplified7.4
rmApplied associate-*r*0.2
rmApplied add-cube-cbrt0.2
Applied associate-*l*0.3
Taylor expanded around 0 7.4
Simplified0.2
Final simplification0.2
herbie shell --seed 2020018
(FPCore (x.re x.im)
:name "math.cube on complex, imaginary part"
:precision binary64
:herbie-target
(+ (* (* x.re x.im) (* 2 x.re)) (* (* x.im (- x.re x.im)) (+ x.re x.im)))
(+ (* (- (* x.re x.re) (* x.im x.im)) x.im) (* (+ (* x.re x.im) (* x.im x.re)) x.re)))