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(\left(\sqrt[3]{\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 \sqrt[3]{\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) \cdot \sqrt[3]{\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) \cdot e^{\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), -\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 r24444 = x_re;
double r24445 = r24444 * r24444;
double r24446 = x_im;
double r24447 = r24446 * r24446;
double r24448 = r24445 + r24447;
double r24449 = sqrt(r24448);
double r24450 = log(r24449);
double r24451 = y_re;
double r24452 = r24450 * r24451;
double r24453 = atan2(r24446, r24444);
double r24454 = y_im;
double r24455 = r24453 * r24454;
double r24456 = r24452 - r24455;
double r24457 = exp(r24456);
double r24458 = r24450 * r24454;
double r24459 = r24453 * r24451;
double r24460 = r24458 + r24459;
double r24461 = cos(r24460);
double r24462 = r24457 * r24461;
return r24462;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r24463 = x_re;
double r24464 = x_im;
double r24465 = hypot(r24463, r24464);
double r24466 = log(r24465);
double r24467 = y_im;
double r24468 = atan2(r24464, r24463);
double r24469 = y_re;
double r24470 = r24468 * r24469;
double r24471 = fma(r24466, r24467, r24470);
double r24472 = cos(r24471);
double r24473 = cbrt(r24472);
double r24474 = r24473 * r24473;
double r24475 = r24474 * r24473;
double r24476 = r24468 * r24467;
double r24477 = -r24476;
double r24478 = fma(r24469, r24466, r24477);
double r24479 = exp(r24478);
double r24480 = r24475 * r24479;
return r24480;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Initial program 32.4
Simplified9.0
rmApplied add-exp-log9.0
Applied pow-exp9.0
Applied div-exp3.5
Simplified3.5
rmApplied add-cube-cbrt3.5
Final simplification3.5
herbie shell --seed 2019212 +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)))))