\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
x.re \cdot \left(\left(x.im \cdot 3\right) \cdot x.re\right) - {x.im}^{3}double f(double x_re, double x_im) {
double r8328421 = x_re;
double r8328422 = r8328421 * r8328421;
double r8328423 = x_im;
double r8328424 = r8328423 * r8328423;
double r8328425 = r8328422 - r8328424;
double r8328426 = r8328425 * r8328423;
double r8328427 = r8328421 * r8328423;
double r8328428 = r8328423 * r8328421;
double r8328429 = r8328427 + r8328428;
double r8328430 = r8328429 * r8328421;
double r8328431 = r8328426 + r8328430;
return r8328431;
}
double f(double x_re, double x_im) {
double r8328432 = x_re;
double r8328433 = x_im;
double r8328434 = 3.0;
double r8328435 = r8328433 * r8328434;
double r8328436 = r8328435 * r8328432;
double r8328437 = r8328432 * r8328436;
double r8328438 = pow(r8328433, r8328434);
double r8328439 = r8328437 - r8328438;
return r8328439;
}




Bits error versus x.re




Bits error versus x.im
Results
| Original | 7.0 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
Initial program 7.0
Taylor expanded around -inf 7.0
Simplified0.3
Taylor expanded around -inf 7.0
Simplified0.3
rmApplied pow20.3
Applied pow10.3
Applied pow-prod-up0.2
Simplified0.2
Final simplification0.2
herbie shell --seed 2019133 +o rules:numerics
(FPCore (x.re x.im)
:name "math.cube on complex, imaginary part"
: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)))