\left(x.re \cdot x.re - x.im \cdot x.im\right) \cdot x.re - \left(x.re \cdot x.im + x.im \cdot x.re\right) \cdot x.im
\mathsf{fma}\left(x.im, \left(-3 \cdot x.re\right) \cdot x.im, {x.re}^{3}\right)double f(double x_re, double x_im) {
double r252920 = x_re;
double r252921 = r252920 * r252920;
double r252922 = x_im;
double r252923 = r252922 * r252922;
double r252924 = r252921 - r252923;
double r252925 = r252924 * r252920;
double r252926 = r252920 * r252922;
double r252927 = r252922 * r252920;
double r252928 = r252926 + r252927;
double r252929 = r252928 * r252922;
double r252930 = r252925 - r252929;
return r252930;
}
double f(double x_re, double x_im) {
double r252931 = x_im;
double r252932 = -3.0;
double r252933 = x_re;
double r252934 = r252932 * r252933;
double r252935 = r252934 * r252931;
double r252936 = 3.0;
double r252937 = pow(r252933, r252936);
double r252938 = fma(r252931, r252935, r252937);
return r252938;
}




Bits error versus x.re




Bits error versus x.im
| Original | 7.3 |
|---|---|
| Target | 0.2 |
| Herbie | 0.2 |
Initial program 7.3
Simplified0.2
rmApplied associate-*r*0.2
Final simplification0.2
herbie shell --seed 2020047 +o rules:numerics
(FPCore (x.re x.im)
:name "math.cube on complex, real part"
:precision binary64
:herbie-target
(+ (* (* x.re x.re) (- x.re x.im)) (* (* x.re x.im) (- x.re (* 3 x.im))))
(- (* (- (* x.re x.re) (* x.im x.im)) x.re) (* (+ (* x.re x.im) (* x.im x.re)) x.im)))