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}\;y.re \le -2.3684273757276652 \cdot 10^{74} \lor \neg \left(y.re \le 2.22216509311932745 \cdot 10^{-38}\right):\\
\;\;\;\;e^{\log \left(\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right) \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\
\mathbf{else}:\\
\;\;\;\;\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re} \cdot \sqrt[3]{{\left(\cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\right)}^{3}}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\\
\end{array}double f(double x_re, double x_im, double y_re, double y_im) {
double r20157 = x_re;
double r20158 = r20157 * r20157;
double r20159 = x_im;
double r20160 = r20159 * r20159;
double r20161 = r20158 + r20160;
double r20162 = sqrt(r20161);
double r20163 = log(r20162);
double r20164 = y_re;
double r20165 = r20163 * r20164;
double r20166 = atan2(r20159, r20157);
double r20167 = y_im;
double r20168 = r20166 * r20167;
double r20169 = r20165 - r20168;
double r20170 = exp(r20169);
double r20171 = r20163 * r20167;
double r20172 = r20166 * r20164;
double r20173 = r20171 + r20172;
double r20174 = cos(r20173);
double r20175 = r20170 * r20174;
return r20175;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r20176 = y_re;
double r20177 = -2.368427375727665e+74;
bool r20178 = r20176 <= r20177;
double r20179 = 2.2221650931193274e-38;
bool r20180 = r20176 <= r20179;
double r20181 = !r20180;
bool r20182 = r20178 || r20181;
double r20183 = x_re;
double r20184 = x_im;
double r20185 = hypot(r20183, r20184);
double r20186 = log(r20185);
double r20187 = y_im;
double r20188 = atan2(r20184, r20183);
double r20189 = r20188 * r20176;
double r20190 = fma(r20186, r20187, r20189);
double r20191 = cos(r20190);
double r20192 = pow(r20185, r20176);
double r20193 = r20191 * r20192;
double r20194 = log(r20193);
double r20195 = r20188 * r20187;
double r20196 = r20194 - r20195;
double r20197 = exp(r20196);
double r20198 = 3.0;
double r20199 = pow(r20191, r20198);
double r20200 = cbrt(r20199);
double r20201 = r20192 * r20200;
double r20202 = exp(r20195);
double r20203 = r20201 / r20202;
double r20204 = r20182 ? r20197 : r20203;
return r20204;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
if y.re < -2.368427375727665e+74 or 2.2221650931193274e-38 < y.re Initial program 30.4
Simplified14.2
rmApplied add-cbrt-cube14.2
Simplified14.2
rmApplied add-log-exp14.2
rmApplied add-exp-log35.1
Applied add-exp-log35.1
Applied pow-exp35.1
Applied prod-exp35.1
Applied div-exp28.7
Simplified7.9
if -2.368427375727665e+74 < y.re < 2.2221650931193274e-38Initial program 34.6
Simplified5.2
rmApplied add-cbrt-cube5.2
Simplified5.2
Final simplification6.2
herbie shell --seed 2020042 +o rules:numerics
(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)))))