e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \cos \left(\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\mathsf{expm1}\left(\mathsf{log1p}\left(\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\right)\right) \cdot e^{\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), -\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \left(\left(\sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}}\right) \cdot \sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}}\right)\right) \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.im\right)\right)}double f(double x_re, double x_im, double y_re, double y_im) {
double r22921 = x_re;
double r22922 = r22921 * r22921;
double r22923 = x_im;
double r22924 = r22923 * r22923;
double r22925 = r22922 + r22924;
double r22926 = sqrt(r22925);
double r22927 = log(r22926);
double r22928 = y_re;
double r22929 = r22927 * r22928;
double r22930 = atan2(r22923, r22921);
double r22931 = y_im;
double r22932 = r22930 * r22931;
double r22933 = r22929 - r22932;
double r22934 = exp(r22933);
double r22935 = r22927 * r22931;
double r22936 = r22930 * r22928;
double r22937 = r22935 + r22936;
double r22938 = cos(r22937);
double r22939 = r22934 * r22938;
return r22939;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r22940 = x_re;
double r22941 = x_im;
double r22942 = hypot(r22940, r22941);
double r22943 = log(r22942);
double r22944 = y_im;
double r22945 = atan2(r22941, r22940);
double r22946 = y_re;
double r22947 = r22945 * r22946;
double r22948 = fma(r22943, r22944, r22947);
double r22949 = cos(r22948);
double r22950 = log1p(r22949);
double r22951 = expm1(r22950);
double r22952 = cbrt(r22945);
double r22953 = cbrt(r22952);
double r22954 = r22953 * r22953;
double r22955 = r22954 * r22953;
double r22956 = r22952 * r22955;
double r22957 = r22952 * r22944;
double r22958 = r22956 * r22957;
double r22959 = -r22958;
double r22960 = fma(r22946, r22943, r22959);
double r22961 = exp(r22960);
double r22962 = r22951 * r22961;
return r22962;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Initial program 33.2
Simplified8.5
rmApplied add-exp-log8.5
Applied pow-exp8.5
Applied div-exp3.2
Simplified3.2
rmApplied add-cube-cbrt3.2
Applied associate-*l*3.2
rmApplied add-cube-cbrt3.2
rmApplied expm1-log1p-u3.2
Final simplification3.2
herbie shell --seed 2019326 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
:name "powComplex, real part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (cos (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))