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)\sqrt[3]{{\left(\log \left(e^{\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)\right)}^{3}} \cdot e^{\mathsf{fma}\left(y.re, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), -y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)}double f(double x_re, double x_im, double y_re, double y_im) {
double r25601 = x_re;
double r25602 = r25601 * r25601;
double r25603 = x_im;
double r25604 = r25603 * r25603;
double r25605 = r25602 + r25604;
double r25606 = sqrt(r25605);
double r25607 = log(r25606);
double r25608 = y_re;
double r25609 = r25607 * r25608;
double r25610 = atan2(r25603, r25601);
double r25611 = y_im;
double r25612 = r25610 * r25611;
double r25613 = r25609 - r25612;
double r25614 = exp(r25613);
double r25615 = r25607 * r25611;
double r25616 = r25610 * r25608;
double r25617 = r25615 + r25616;
double r25618 = cos(r25617);
double r25619 = r25614 * r25618;
return r25619;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r25620 = x_re;
double r25621 = x_im;
double r25622 = hypot(r25620, r25621);
double r25623 = log(r25622);
double r25624 = y_im;
double r25625 = atan2(r25621, r25620);
double r25626 = y_re;
double r25627 = r25625 * r25626;
double r25628 = fma(r25623, r25624, r25627);
double r25629 = cos(r25628);
double r25630 = exp(r25629);
double r25631 = log(r25630);
double r25632 = 3.0;
double r25633 = pow(r25631, r25632);
double r25634 = cbrt(r25633);
double r25635 = r25624 * r25625;
double r25636 = -r25635;
double r25637 = fma(r25626, r25623, r25636);
double r25638 = exp(r25637);
double r25639 = r25634 * r25638;
return r25639;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Initial program 33.4
Simplified8.8
rmApplied add-exp-log8.8
Applied pow-exp8.8
Applied div-exp3.4
Simplified3.4
rmApplied add-cbrt-cube3.4
Simplified3.4
rmApplied add-log-exp3.4
Final simplification3.4
herbie shell --seed 2019195 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
:name "powComplex, real part"
(* (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)))))