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}\;x.re \le -2.7275578330433151 \cdot 10^{-42}:\\
\;\;\;\;e^{\left(\log \left(-1 \cdot x.re\right) \cdot \left(\sqrt[3]{y.re} \cdot \sqrt[3]{y.re}\right)\right) \cdot \sqrt[3]{y.re} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot 1\\
\mathbf{elif}\;x.re \le -3.05242645728246944 \cdot 10^{-246}:\\
\;\;\;\;\left(\left(\sqrt[3]{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 \sqrt[3]{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}}\right) \cdot \sqrt[3]{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}}\right) \cdot 1\\
\mathbf{elif}\;x.re \le -3.2093552099949914 \cdot 10^{-300}:\\
\;\;\;\;\left(\left(\sqrt[3]{e^{\log \left(-1 \cdot x.re\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot \sqrt[3]{e^{\log \left(-1 \cdot x.re\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\right) \cdot \sqrt[3]{e^{\log \left(-1 \cdot x.re\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\right) \cdot 1\\
\mathbf{elif}\;x.re \le 1.30911586275430494 \cdot 10^{-12}:\\
\;\;\;\;\left(\left(\sqrt[3]{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 \sqrt[3]{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}}\right) \cdot \sqrt[3]{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}}\right) \cdot 1\\
\mathbf{else}:\\
\;\;\;\;e^{\log x.re \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \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 VAR;
if ((x_46_re <= -2.727557833043315e-42)) {
VAR = (exp((((log((-1.0 * x_46_re)) * (cbrt(y_46_re) * cbrt(y_46_re))) * cbrt(y_46_re)) - (atan2(x_46_im, x_46_re) * y_46_im))) * 1.0);
} else {
double VAR_1;
if ((x_46_re <= -3.0524264572824694e-246)) {
VAR_1 = (((cbrt(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)))) * cbrt(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))))) * cbrt(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 {
double VAR_2;
if ((x_46_re <= -3.2093552099949914e-300)) {
VAR_2 = (((cbrt(exp(((log((-1.0 * x_46_re)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)))) * cbrt(exp(((log((-1.0 * x_46_re)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))))) * cbrt(exp(((log((-1.0 * x_46_re)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))))) * 1.0);
} else {
double VAR_3;
if ((x_46_re <= 1.309115862754305e-12)) {
VAR_3 = (((cbrt(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)))) * cbrt(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))))) * cbrt(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 {
VAR_3 = (exp(((log(x_46_re) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * 1.0);
}
VAR_2 = VAR_3;
}
VAR_1 = VAR_2;
}
VAR = VAR_1;
}
return VAR;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if x.re < -2.727557833043315e-42Initial program 36.0
Taylor expanded around 0 20.1
Taylor expanded around -inf 1.9
rmApplied add-cube-cbrt1.9
Applied associate-*r*1.9
if -2.727557833043315e-42 < x.re < -3.0524264572824694e-246 or -3.2093552099949914e-300 < x.re < 1.309115862754305e-12Initial program 23.9
Taylor expanded around 0 13.2
rmApplied add-cube-cbrt13.3
if -3.0524264572824694e-246 < x.re < -3.2093552099949914e-300Initial program 33.7
Taylor expanded around 0 19.9
Taylor expanded around -inf 11.3
rmApplied add-cube-cbrt11.3
if 1.309115862754305e-12 < x.re Initial program 42.5
Taylor expanded around 0 28.0
Taylor expanded around inf 11.5
Final simplification9.4
herbie shell --seed 2020075
(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)))))