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)e^{\mathsf{log1p}\left(\left(\sqrt[3]{\mathsf{expm1}\left(\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), -\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)} \cdot \sqrt[3]{\mathsf{expm1}\left(\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), -\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)}\right) \cdot \sqrt[3]{\mathsf{expm1}\left(\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), -\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)\right)}\right)}double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))));
}
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return exp(log1p(((cbrt(expm1(fma(y_46_re, log(hypot(x_46_re, x_46_im)), -(atan2(x_46_im, x_46_re) * y_46_im)))) * cbrt(expm1(fma(y_46_re, log(hypot(x_46_re, x_46_im)), -(atan2(x_46_im, x_46_re) * y_46_im))))) * cbrt(expm1(fma(y_46_re, log(hypot(x_46_re, x_46_im)), -(atan2(x_46_im, x_46_re) * y_46_im)))))));
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
Initial program 33.2
Taylor expanded around 0 20.0
rmApplied add-cbrt-cube20.0
Simplified4.0
rmApplied log1p-expm1-u4.0
Simplified4.0
rmApplied add-cube-cbrt4.0
Final simplification4.0
herbie shell --seed 2020079 +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)))))