\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 r184293 = x_re;
double r184294 = r184293 * r184293;
double r184295 = x_im;
double r184296 = r184295 * r184295;
double r184297 = r184294 - r184296;
double r184298 = r184297 * r184295;
double r184299 = r184293 * r184295;
double r184300 = r184295 * r184293;
double r184301 = r184299 + r184300;
double r184302 = r184301 * r184293;
double r184303 = r184298 + r184302;
return r184303;
}
double f(double x_re, double x_im) {
double r184304 = 3.0;
double r184305 = x_im;
double r184306 = r184304 * r184305;
double r184307 = x_re;
double r184308 = r184306 * r184307;
double r184309 = r184308 * r184307;
double r184310 = pow(r184305, r184304);
double r184311 = r184309 - r184310;
return r184311;
}




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 associate-*r*0.2
rmApplied associate-*r*0.2
Final simplification0.2
herbie shell --seed 2020089
(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)))