\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(\left(3 \cdot x.im\right) \cdot x.re\right) \cdot x.re - {x.im}^{3}double f(double x_re, double x_im) {
double r194550 = x_re;
double r194551 = r194550 * r194550;
double r194552 = x_im;
double r194553 = r194552 * r194552;
double r194554 = r194551 - r194553;
double r194555 = r194554 * r194552;
double r194556 = r194550 * r194552;
double r194557 = r194552 * r194550;
double r194558 = r194556 + r194557;
double r194559 = r194558 * r194550;
double r194560 = r194555 + r194559;
return r194560;
}
double f(double x_re, double x_im) {
double r194561 = 3.0;
double r194562 = x_im;
double r194563 = r194561 * r194562;
double r194564 = x_re;
double r194565 = r194563 * r194564;
double r194566 = r194565 * r194564;
double r194567 = pow(r194562, r194561);
double r194568 = r194566 - r194567;
return r194568;
}




Bits error versus x.re




Bits error versus x.im
Results
| Original | 7.4 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 7.4
Simplified7.3
rmApplied associate-*r*0.2
rmApplied associate-*r*0.2
rmApplied associate-*r*0.2
Final simplification0.2
herbie shell --seed 2020056 +o rules:numerics
(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)))