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)e^{\log \left(e^{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\right) \cdot y.re - \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot \left(\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}\right)\right) \cdot \sqrt[3]{y.im}} \cdot \mathsf{expm1}\left(\mathsf{log1p}\left(\sin \left(\log \left(1 \cdot \mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\right)double f(double x_re, double x_im, double y_re, double y_im) {
double r14664 = x_re;
double r14665 = r14664 * r14664;
double r14666 = x_im;
double r14667 = r14666 * r14666;
double r14668 = r14665 + r14667;
double r14669 = sqrt(r14668);
double r14670 = log(r14669);
double r14671 = y_re;
double r14672 = r14670 * r14671;
double r14673 = atan2(r14666, r14664);
double r14674 = y_im;
double r14675 = r14673 * r14674;
double r14676 = r14672 - r14675;
double r14677 = exp(r14676);
double r14678 = r14670 * r14674;
double r14679 = r14673 * r14671;
double r14680 = r14678 + r14679;
double r14681 = sin(r14680);
double r14682 = r14677 * r14681;
return r14682;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r14683 = x_re;
double r14684 = x_im;
double r14685 = hypot(r14683, r14684);
double r14686 = log(r14685);
double r14687 = exp(r14686);
double r14688 = log(r14687);
double r14689 = y_re;
double r14690 = r14688 * r14689;
double r14691 = atan2(r14684, r14683);
double r14692 = y_im;
double r14693 = cbrt(r14692);
double r14694 = r14693 * r14693;
double r14695 = r14691 * r14694;
double r14696 = r14695 * r14693;
double r14697 = r14690 - r14696;
double r14698 = exp(r14697);
double r14699 = 1.0;
double r14700 = r14699 * r14685;
double r14701 = log(r14700);
double r14702 = r14701 * r14692;
double r14703 = r14691 * r14689;
double r14704 = r14702 + r14703;
double r14705 = sin(r14704);
double r14706 = log1p(r14705);
double r14707 = expm1(r14706);
double r14708 = r14698 * r14707;
return r14708;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
Initial program 33.3
rmApplied *-un-lft-identity33.3
Applied sqrt-prod33.3
Simplified33.3
Simplified19.8
rmApplied add-exp-log19.8
Simplified3.8
rmApplied expm1-log1p-u3.8
rmApplied add-cube-cbrt3.8
Applied associate-*r*3.8
Final simplification3.8
herbie shell --seed 2020057 +o rules:numerics
(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)))))