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.im \leq -4.0934041149708724 \cdot 10^{+154}:\\
\;\;\;\;e^{\log \left(-x.im\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;x.im \leq -3.302271378437987 \cdot 10^{-195}:\\
\;\;\;\;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} + \log \left(-x.im\right) \cdot y.im\right)\\
\mathbf{elif}\;x.im \leq -5.812317682129375 \cdot 10^{-227}:\\
\;\;\;\;e^{\log \left(-x.im\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\\
\mathbf{elif}\;x.im \leq 2.3749711864456892 \cdot 10^{-232}:\\
\;\;\;\;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(\left(\sqrt[3]{y.re} \cdot \sqrt[3]{y.re}\right) \cdot \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \sqrt[3]{y.re}\right)\right)\\
\mathbf{elif}\;x.im \leq 8.860112327650189 \cdot 10^{-212}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.re \cdot \log \left(-x.re\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;x.im \leq 9.081701895702835 \cdot 10^{-207}:\\
\;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right) \cdot \left(y.im \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right)} \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.im \leq 8.616224543200037 \cdot 10^{-169}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{elif}\;x.im \leq 3.287617321062957 \cdot 10^{-58}:\\
\;\;\;\;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.im\right)\\
\mathbf{elif}\;x.im \leq 5.905307583074926 \cdot 10^{+146}:\\
\;\;\;\;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(\left|\sqrt[3]{{x.re}^{2} + {x.im}^{2}}\right| \cdot \sqrt{\sqrt[3]{{x.re}^{2} + {x.im}^{2}}}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\sin \left(y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\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.im -4.0934041149708724e+154)
(*
(exp (- (* (log (- x.im)) y.re) (* (atan2 x.im x.re) y.im)))
(sin (* y.re (atan2 x.im x.re))))
(if (<= x.im -3.302271378437987e-195)
(*
(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)) (* (log (- x.im)) y.im))))
(if (<= x.im -5.812317682129375e-227)
(*
(exp (- (* (log (- x.im)) y.re) (* (atan2 x.im x.re) y.im)))
(sin (* y.re (atan2 x.im x.re))))
(if (<= x.im 2.3749711864456892e-232)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(* (atan2 x.im x.re) y.im)))
(sin
(* (* (cbrt y.re) (cbrt y.re)) (* (atan2 x.im x.re) (cbrt y.re)))))
(if (<= x.im 8.860112327650189e-212)
(*
(sin (* y.re (atan2 x.im x.re)))
(exp (- (* y.re (log (- x.re))) (* (atan2 x.im x.re) y.im))))
(if (<= x.im 9.081701895702835e-207)
(*
(exp
(-
(* y.re (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))
(*
(* (cbrt (atan2 x.im x.re)) (cbrt (atan2 x.im x.re)))
(* y.im (cbrt (atan2 x.im x.re))))))
(sin
(+
(* y.re (atan2 x.im x.re))
(* y.im (log (sqrt (+ (* x.re x.re) (* x.im x.im))))))))
(if (<= x.im 8.616224543200037e-169)
(*
(sin (* y.re (atan2 x.im x.re)))
(exp (- (* y.re (log x.im)) (* (atan2 x.im x.re) y.im))))
(if (<= x.im 3.287617321062957e-58)
(*
(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.im)))))
(if (<= x.im 5.905307583074926e+146)
(*
(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
(*
(fabs (cbrt (+ (pow x.re 2.0) (pow x.im 2.0))))
(sqrt (cbrt (+ (pow x.re 2.0) (pow x.im 2.0))))))))))
(*
(sin (* y.re (atan2 x.im x.re)))
(exp
(-
(* y.re (log x.im))
(* (atan2 x.im x.re) y.im))))))))))))))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_im <= -4.0934041149708724e+154) {
tmp = exp((log(-x_46_im) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)) * sin(y_46_re * atan2(x_46_im, x_46_re));
} else if (x_46_im <= -3.302271378437987e-195) {
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)) + (log(-x_46_im) * y_46_im));
} else if (x_46_im <= -5.812317682129375e-227) {
tmp = exp((log(-x_46_im) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im)) * sin(y_46_re * atan2(x_46_im, x_46_re));
} else if (x_46_im <= 2.3749711864456892e-232) {
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((cbrt(y_46_re) * cbrt(y_46_re)) * (atan2(x_46_im, x_46_re) * cbrt(y_46_re)));
} else if (x_46_im <= 8.860112327650189e-212) {
tmp = sin(y_46_re * atan2(x_46_im, x_46_re)) * exp((y_46_re * log(-x_46_re)) - (atan2(x_46_im, x_46_re) * y_46_im));
} else if (x_46_im <= 9.081701895702835e-207) {
tmp = exp((y_46_re * log(sqrt((x_46_re * x_46_re) + (x_46_im * x_46_im)))) - ((cbrt(atan2(x_46_im, x_46_re)) * cbrt(atan2(x_46_im, x_46_re))) * (y_46_im * cbrt(atan2(x_46_im, x_46_re))))) * 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_im <= 8.616224543200037e-169) {
tmp = sin(y_46_re * atan2(x_46_im, x_46_re)) * exp((y_46_re * log(x_46_im)) - (atan2(x_46_im, x_46_re) * y_46_im));
} else if (x_46_im <= 3.287617321062957e-58) {
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_im)));
} else if (x_46_im <= 5.905307583074926e+146) {
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(fabs(cbrt(pow(x_46_re, 2.0) + pow(x_46_im, 2.0))) * sqrt(cbrt(pow(x_46_re, 2.0) + pow(x_46_im, 2.0))))));
} else {
tmp = sin(y_46_re * atan2(x_46_im, x_46_re)) * exp((y_46_re * log(x_46_im)) - (atan2(x_46_im, x_46_re) * y_46_im));
}
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.im < -4.09340411497087238e154 or -3.30227137843798684e-195 < x.im < -5.81231768212937541e-227Initial program 57.9
Taylor expanded around 0 35.5
Taylor expanded around -inf 16.8
Simplified16.8
if -4.09340411497087238e154 < x.im < -3.30227137843798684e-195Initial program 19.7
Taylor expanded around -inf 16.1
if -5.81231768212937541e-227 < x.im < 2.3749711864456892e-232Initial program 35.8
Taylor expanded around 0 31.4
rmApplied add-cube-cbrt_binary6431.4
Applied associate-*l*_binary6431.4
if 2.3749711864456892e-232 < x.im < 8.8601123276501887e-212Initial program 26.2
Taylor expanded around 0 26.8
Taylor expanded around -inf 35.6
Simplified35.6
if 8.8601123276501887e-212 < x.im < 9.0817018957028354e-207Initial program 41.3
rmApplied add-cube-cbrt_binary6441.3
Applied associate-*l*_binary6441.3
Simplified41.3
if 9.0817018957028354e-207 < x.im < 8.6162245432000372e-169 or 5.90530758307492564e146 < x.im Initial program 55.6
Taylor expanded around 0 33.5
Taylor expanded around 0 18.2
if 8.6162245432000372e-169 < x.im < 3.28761732106295729e-58Initial program 20.9
Taylor expanded around 0 19.5
if 3.28761732106295729e-58 < x.im < 5.90530758307492564e146Initial program 17.7
rmApplied add-cube-cbrt_binary6417.7
Applied sqrt-prod_binary6417.7
Simplified17.7
Simplified17.7
Final simplification19.5
herbie shell --seed 2021060
(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)))))