\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 r117316 = x_re;
double r117317 = r117316 * r117316;
double r117318 = x_im;
double r117319 = r117318 * r117318;
double r117320 = r117317 - r117319;
double r117321 = r117320 * r117318;
double r117322 = r117316 * r117318;
double r117323 = r117318 * r117316;
double r117324 = r117322 + r117323;
double r117325 = r117324 * r117316;
double r117326 = r117321 + r117325;
return r117326;
}
double f(double x_re, double x_im) {
double r117327 = 3.0;
double r117328 = x_im;
double r117329 = r117327 * r117328;
double r117330 = x_re;
double r117331 = r117329 * r117330;
double r117332 = r117331 * r117330;
double r117333 = pow(r117328, r117327);
double r117334 = r117332 - r117333;
return r117334;
}




Bits error versus x.re




Bits error versus x.im
Results
| Original | 6.9 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 6.9
Simplified6.9
rmApplied associate-*r*0.2
rmApplied associate-*r*0.2
rmApplied associate-*r*0.2
Final simplification0.2
herbie shell --seed 2020064
(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)))