\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(x.re \cdot x.im\right) \cdot 3\right) \cdot x.re - {x.im}^{3}double f(double x_re, double x_im) {
double r6431068 = x_re;
double r6431069 = r6431068 * r6431068;
double r6431070 = x_im;
double r6431071 = r6431070 * r6431070;
double r6431072 = r6431069 - r6431071;
double r6431073 = r6431072 * r6431070;
double r6431074 = r6431068 * r6431070;
double r6431075 = r6431070 * r6431068;
double r6431076 = r6431074 + r6431075;
double r6431077 = r6431076 * r6431068;
double r6431078 = r6431073 + r6431077;
return r6431078;
}
double f(double x_re, double x_im) {
double r6431079 = x_re;
double r6431080 = x_im;
double r6431081 = r6431079 * r6431080;
double r6431082 = 3.0;
double r6431083 = r6431081 * r6431082;
double r6431084 = r6431083 * r6431079;
double r6431085 = pow(r6431080, r6431082);
double r6431086 = r6431084 - r6431085;
return r6431086;
}




Bits error versus x.re




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