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 \sin \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 -4.6754114793960554 \cdot 10^{+144}:\\
\;\;\;\;e^{\log \left(-x.re\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{3}}\\
\mathbf{elif}\;x.re \leq -7.152265036082887 \cdot 10^{-122}:\\
\;\;\;\;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 \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\right)\\
\mathbf{elif}\;x.re \leq 1.4724929191929907 \cdot 10^{-173}:\\
\;\;\;\;\left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot 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 72273.62012139842:\\
\;\;\;\;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 \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)\right)\\
\mathbf{elif}\;x.re \leq 3.830449135996521 \cdot 10^{+54}:\\
\;\;\;\;\sqrt[3]{{\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}^{3}} \cdot e^{y.re \cdot \log x.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\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 \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re} + y.im \cdot \log x.re\right)\\
\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)))
(sin
(+
(* (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 -4.6754114793960554e+144)
(*
(exp (- (* (log (- x.re)) y.re) (* (atan2 x.im x.re) y.im)))
(cbrt (pow (sin (* y.re (atan2 x.im x.re))) 3.0)))
(if (<= x.re -7.152265036082887e-122)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin
(+
(* y.re (atan2 x.im x.re))
(* y.im (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))))
(if (<= x.re 1.4724929191929907e-173)
(*
(* y.re (atan2 x.im x.re))
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im))))
(if (<= x.re 72273.62012139842)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin
(+
(* y.re (atan2 x.im x.re))
(* y.im (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))))
(if (<= x.re 3.830449135996521e+54)
(*
(cbrt (pow (sin (* y.re (atan2 x.im x.re))) 3.0))
(exp (- (* y.re (log x.re)) (* (atan2 x.im x.re) y.im))))
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin (+ (* y.re (atan2 x.im x.re)) (* y.im (log x.re)))))))))))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)) * sin((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 <= -4.6754114793960554e+144) {
tmp = exp((log(-x_46_re) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)) * cbrt(pow(sin(y_46_re * atan2(x_46_im, x_46_re)), 3.0));
} else if (x_46_re <= -7.152265036082887e-122) {
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)) * sin((y_46_re * atan2(x_46_im, x_46_re)) + (y_46_im * log(sqrt((x_46_re * x_46_re) + (x_46_im * x_46_im)))));
} else if (x_46_re <= 1.4724929191929907e-173) {
tmp = (y_46_re * atan2(x_46_im, x_46_re)) * 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 <= 72273.62012139842) {
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)) * sin((y_46_re * atan2(x_46_im, x_46_re)) + (y_46_im * log(sqrt((x_46_re * x_46_re) + (x_46_im * x_46_im)))));
} else if (x_46_re <= 3.830449135996521e+54) {
tmp = cbrt(pow(sin(y_46_re * atan2(x_46_im, x_46_re)), 3.0)) * exp((y_46_re * log(x_46_re)) - (atan2(x_46_im, x_46_re) * y_46_im));
} 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)) * sin((y_46_re * atan2(x_46_im, x_46_re)) + (y_46_im * log(x_46_re)));
}
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 < -4.67541147939605539e144Initial program 61.2
rmApplied add-cbrt-cube_binary6461.5
Simplified61.5
Taylor expanded around 0 33.0
Taylor expanded around -inf 16.3
if -4.67541147939605539e144 < x.re < -7.1522650360828873e-122 or 1.47249291919299073e-173 < x.re < 72273.620121398417Initial program 17.2
if -7.1522650360828873e-122 < x.re < 1.47249291919299073e-173Initial program 30.0
rmApplied add-cbrt-cube_binary6436.0
Simplified36.1
Taylor expanded around 0 26.7
Taylor expanded around 0 24.0
if 72273.620121398417 < x.re < 3.8304491359965209e54Initial program 22.7
rmApplied add-cbrt-cube_binary6431.0
Simplified31.0
Taylor expanded around 0 28.9
Taylor expanded around inf 24.7
if 3.8304491359965209e54 < x.re Initial program 49.4
Taylor expanded around inf 31.7
Final simplification22.3
herbie shell --seed 2021044
(FPCore (x.re x.im y.re y.im)
:name "powComplex, imaginary part"
:precision binary64
(* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.im) (* (atan2 x.im x.re) y.re)))))