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)\begin{array}{l}
\mathbf{if}\;y.re \le -3.91992378934511603 \cdot 10^{173}:\\
\;\;\;\;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 1\\
\mathbf{else}:\\
\;\;\;\;e^{\sqrt[3]{{\left(\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), -\log \left(e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)\right)\right)}^{3}}} \cdot 1\\
\end{array}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) {
double temp;
if ((y_46_re <= -3.919923789345116e+173)) {
temp = (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))) * 1.0);
} else {
temp = (exp(cbrt(pow(fma(y_46_re, log(hypot(x_46_re, x_46_im)), -log(exp((atan2(x_46_im, x_46_re) * y_46_im)))), 3.0))) * 1.0);
}
return temp;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if y.re < -3.919923789345116e+173Initial program 37.9
Taylor expanded around 0 0.3
if -3.919923789345116e+173 < y.re Initial program 32.3
Taylor expanded around 0 22.0
rmApplied add-cbrt-cube22.0
Simplified4.5
rmApplied add-log-exp6.0
Final simplification5.3
herbie shell --seed 2020053 +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)))))