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){\left(e^{\sqrt[3]{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\frac{1}{2}} \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\frac{1}{2}}\right) \cdot y.re - \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right) \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot \sqrt[3]{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\frac{1}{2}} \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\frac{1}{2}}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\right)}^{\left(\sqrt[3]{\log \left({\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\frac{1}{2}} \cdot {\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{\frac{1}{2}}\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)}double f(double x_re, double x_im, double y_re, double y_im) {
double r14294 = x_re;
double r14295 = r14294 * r14294;
double r14296 = x_im;
double r14297 = r14296 * r14296;
double r14298 = r14295 + r14297;
double r14299 = sqrt(r14298);
double r14300 = log(r14299);
double r14301 = y_re;
double r14302 = r14300 * r14301;
double r14303 = atan2(r14296, r14294);
double r14304 = y_im;
double r14305 = r14303 * r14304;
double r14306 = r14302 - r14305;
double r14307 = exp(r14306);
double r14308 = r14300 * r14304;
double r14309 = r14303 * r14301;
double r14310 = r14308 + r14309;
double r14311 = cos(r14310);
double r14312 = r14307 * r14311;
return r14312;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r14313 = x_re;
double r14314 = x_im;
double r14315 = hypot(r14313, r14314);
double r14316 = 0.5;
double r14317 = pow(r14315, r14316);
double r14318 = r14317 * r14317;
double r14319 = log(r14318);
double r14320 = y_re;
double r14321 = r14319 * r14320;
double r14322 = atan2(r14314, r14313);
double r14323 = y_im;
double r14324 = r14322 * r14323;
double r14325 = cbrt(r14324);
double r14326 = r14325 * r14325;
double r14327 = r14326 * r14325;
double r14328 = r14321 - r14327;
double r14329 = cbrt(r14328);
double r14330 = r14321 - r14324;
double r14331 = cbrt(r14330);
double r14332 = r14329 * r14331;
double r14333 = exp(r14332);
double r14334 = pow(r14333, r14331);
return r14334;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
Initial program 33.5
Taylor expanded around 0 19.8
rmApplied add-sqr-sqrt19.8
Applied sqrt-prod19.8
Simplified19.8
Simplified4.4
rmApplied add-cube-cbrt4.4
Applied exp-prod4.4
rmApplied add-cube-cbrt4.4
Final simplification4.4
herbie shell --seed 2020020 +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)))))