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 -9.423511434206789 \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 -2.2880081199411094 \cdot 10^{-302}:\\
\;\;\;\;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(\frac{-1}{x.im}\right)\right)\\
\mathbf{elif}\;x.im \leq 5.999233792908306 \cdot 10^{-275}:\\
\;\;\;\;\frac{{\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}}{e^{\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.im \leq 8.893872608083424 \cdot 10^{-234}:\\
\;\;\;\;e^{y.re \cdot \log x.im - \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.im \leq 9.796633468730483 \cdot 10^{-206}:\\
\;\;\;\;\frac{{\left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right)}^{y.re}}{e^{\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.im \leq 2.8096680029547107 \cdot 10^{-08}:\\
\;\;\;\;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 1.940140996050804 \cdot 10^{+35}:\\
\;\;\;\;\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) \cdot e^{y.re \cdot \log x.im - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\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 -9.423511434206789e+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 -2.2880081199411094e-302)
(*
(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 (/ -1.0 x.im))))))
(if (<= x.im 5.999233792908306e-275)
(*
(/
(pow (sqrt (+ (* x.re x.re) (* x.im x.im))) y.re)
(exp (* (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.im 8.893872608083424e-234)
(*
(exp (- (* y.re (log x.im)) (* (atan2 x.im x.re) y.im)))
(cbrt (pow (sin (* y.re (atan2 x.im x.re))) 3.0)))
(if (<= x.im 9.796633468730483e-206)
(*
(/
(pow (sqrt (+ (* x.re x.re) (* x.im x.im))) y.re)
(exp (* (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.im 2.8096680029547107e-08)
(*
(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 1.940140996050804e+35)
(*
(sin
(+
(* y.re (atan2 x.im x.re))
(* y.im (log (sqrt (+ (* x.re x.re) (* x.im x.im)))))))
(exp (- (* y.re (log x.im)) (* (atan2 x.im x.re) y.im))))
(*
(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 <= -9.423511434206789e+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 <= -2.2880081199411094e-302) {
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(-1.0 / x_46_im)));
} else if (x_46_im <= 5.999233792908306e-275) {
tmp = (pow(sqrt((x_46_re * x_46_re) + (x_46_im * x_46_im)), y_46_re) / exp(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_im <= 8.893872608083424e-234) {
tmp = exp((y_46_re * log(x_46_im)) - (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_im <= 9.796633468730483e-206) {
tmp = (pow(sqrt((x_46_re * x_46_re) + (x_46_im * x_46_im)), y_46_re) / exp(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_im <= 2.8096680029547107e-08) {
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 <= 1.940140996050804e+35) {
tmp = 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))))) * exp((y_46_re * log(x_46_im)) - (atan2(x_46_im, x_46_re) * y_46_im));
} 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 < -9.4235114342067888e154Initial program 64.0
Taylor expanded around 0 37.6
Taylor expanded around -inf 14.5
if -9.4235114342067888e154 < x.im < -2.2880081199411094e-302Initial program 24.5
Taylor expanded around -inf 20.6
if -2.2880081199411094e-302 < x.im < 5.999233792908306e-275 or 8.89387260808342433e-234 < x.im < 9.7966334687304829e-206Initial program 35.1
Simplified36.7
if 5.999233792908306e-275 < x.im < 8.89387260808342433e-234Initial program 35.8
Taylor expanded around 0 36.3
rmApplied add-cbrt-cube_binary6438.1
Simplified38.1
Taylor expanded around 0 41.3
if 9.7966334687304829e-206 < x.im < 2.80966800295471072e-8Initial program 22.5
Taylor expanded around 0 19.9
if 2.80966800295471072e-8 < x.im < 1.9401409960508038e35Initial program 18.2
Taylor expanded around 0 19.1
if 1.9401409960508038e35 < x.im Initial program 43.6
Taylor expanded around 0 29.5
Taylor expanded around 0 15.7
Final simplification20.4
herbie shell --seed 2021058
(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)))))