\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 3\right) \cdot x.im\right) \cdot x.re - {x.im}^{3}double f(double x_re, double x_im) {
double r6452958 = x_re;
double r6452959 = r6452958 * r6452958;
double r6452960 = x_im;
double r6452961 = r6452960 * r6452960;
double r6452962 = r6452959 - r6452961;
double r6452963 = r6452962 * r6452960;
double r6452964 = r6452958 * r6452960;
double r6452965 = r6452960 * r6452958;
double r6452966 = r6452964 + r6452965;
double r6452967 = r6452966 * r6452958;
double r6452968 = r6452963 + r6452967;
return r6452968;
}
double f(double x_re, double x_im) {
double r6452969 = x_re;
double r6452970 = 3.0;
double r6452971 = r6452969 * r6452970;
double r6452972 = x_im;
double r6452973 = r6452971 * r6452972;
double r6452974 = r6452973 * r6452969;
double r6452975 = pow(r6452972, r6452970);
double r6452976 = r6452974 - r6452975;
return r6452976;
}




Bits error versus x.re




Bits error versus x.im
Results
| Original | 6.9 |
|---|---|
| Target | 0.3 |
| Herbie | 0.2 |
Initial program 6.9
Taylor expanded around 0 6.9
Simplified0.3
rmApplied pow10.3
Applied pow10.3
Applied pow-prod-up0.3
Applied pow10.3
Applied pow-prod-up0.2
Simplified0.2
Taylor expanded around 0 6.9
Simplified0.2
rmApplied associate-*r*0.2
Final simplification0.2
herbie shell --seed 2019164 +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)))