\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 r172164 = x_re;
double r172165 = r172164 * r172164;
double r172166 = x_im;
double r172167 = r172166 * r172166;
double r172168 = r172165 - r172167;
double r172169 = r172168 * r172166;
double r172170 = r172164 * r172166;
double r172171 = r172166 * r172164;
double r172172 = r172170 + r172171;
double r172173 = r172172 * r172164;
double r172174 = r172169 + r172173;
return r172174;
}
double f(double x_re, double x_im) {
double r172175 = 3.0;
double r172176 = x_im;
double r172177 = r172175 * r172176;
double r172178 = x_re;
double r172179 = r172177 * r172178;
double r172180 = r172179 * r172178;
double r172181 = pow(r172176, r172175);
double r172182 = r172180 - r172181;
return r172182;
}




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