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 \leq -7.886014516012344 \cdot 10^{-222}:\\
\;\;\;\;e^{\log \left(-x.re\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;x.re \leq 2.7192715241158423 \cdot 10^{-299}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;x.re \leq 1.608969993350805 \cdot 10^{-67} \lor \neg \left(x.re \leq 0.9295754959825187\right):\\
\;\;\;\;\sqrt[3]{{\left(\frac{{x.re}^{y.re}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\right)}^{3}}\\
\mathbf{else}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{{\cos \left(y.im \cdot \log \left(\sqrt{{x.re}^{2} + {x.im}^{2}}\right) + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{3}}\\
\end{array}(FPCore (x.re x.im y.re y.im)
: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)))))(FPCore (x.re x.im y.re y.im)
:precision binary64
(if (<= x.re -7.886014516012344e-222)
(exp (- (* (log (- x.re)) y.re) (* (atan2 x.im x.re) y.im)))
(if (<= x.re 2.7192715241158423e-299)
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(if (or (<= x.re 1.608969993350805e-67)
(not (<= x.re 0.9295754959825187)))
(cbrt (pow (/ (pow x.re y.re) (exp (* (atan2 x.im x.re) y.im))) 3.0))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(cbrt
(pow
(cos
(+
(* y.im (log (sqrt (+ (pow x.re 2.0) (pow x.im 2.0)))))
(* y.re (atan2 x.im x.re))))
3.0)))))))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 tmp;
if (x_46_re <= -7.886014516012344e-222) {
tmp = exp((log(-x_46_re) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im));
} else if (x_46_re <= 2.7192715241158423e-299) {
tmp = exp((y_46_re * log(sqrt((x_46_re * x_46_re) + (x_46_im * x_46_im)))) - (atan2(x_46_im, x_46_re) * y_46_im));
} else if ((x_46_re <= 1.608969993350805e-67) || !(x_46_re <= 0.9295754959825187)) {
tmp = cbrt(pow((pow(x_46_re, y_46_re) / exp(atan2(x_46_im, x_46_re) * y_46_im)), 3.0));
} else {
tmp = exp((y_46_re * log(sqrt((x_46_re * x_46_re) + (x_46_im * x_46_im)))) - (atan2(x_46_im, x_46_re) * y_46_im)) * cbrt(pow(cos((y_46_im * log(sqrt(pow(x_46_re, 2.0) + pow(x_46_im, 2.0)))) + (y_46_re * atan2(x_46_im, x_46_re))), 3.0));
}
return tmp;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
if x.re < -7.88601451601234367e-222Initial program 31.1
Taylor expanded around 0 18.4
Taylor expanded around -inf 4.6
Simplified4.6
if -7.88601451601234367e-222 < x.re < 2.71927152411584229e-299Initial program 33.2
Taylor expanded around 0 18.4
if 2.71927152411584229e-299 < x.re < 1.60896999335080485e-67 or 0.92957549598251865 < x.re Initial program 36.5
Taylor expanded around 0 23.0
Taylor expanded around inf 11.3
rmApplied add-cbrt-cube_binary6411.4
Simplified14.9
if 1.60896999335080485e-67 < x.re < 0.92957549598251865Initial program 19.0
rmApplied add-cbrt-cube_binary6419.0
Simplified19.0
Final simplification11.2
herbie shell --seed 2020253
(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)))))