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



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -1.054865446815132e76Initial program 37.5
Simplified9.7
Taylor expanded in y.im around 0 1.2
Simplified1.2
if -1.054865446815132e76 < y.re Initial program 32.3
Simplified8.2
Applied add-cbrt-cube_binary648.2
Simplified8.2
Applied add-cube-cbrt_binary648.2
Final simplification6.7
herbie shell --seed 2021357
(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)))))