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(1 \cdot \mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.re - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \mathsf{log1p}\left(\mathsf{expm1}\left(\sin \left(\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot \left(\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}\right)\right) \cdot \sqrt[3]{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 r17095 = x_re;
double r17096 = r17095 * r17095;
double r17097 = x_im;
double r17098 = r17097 * r17097;
double r17099 = r17096 + r17098;
double r17100 = sqrt(r17099);
double r17101 = log(r17100);
double r17102 = y_re;
double r17103 = r17101 * r17102;
double r17104 = atan2(r17097, r17095);
double r17105 = y_im;
double r17106 = r17104 * r17105;
double r17107 = r17103 - r17106;
double r17108 = exp(r17107);
double r17109 = r17101 * r17105;
double r17110 = r17104 * r17102;
double r17111 = r17109 + r17110;
double r17112 = sin(r17111);
double r17113 = r17108 * r17112;
return r17113;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r17114 = 1.0;
double r17115 = x_re;
double r17116 = x_im;
double r17117 = hypot(r17115, r17116);
double r17118 = r17114 * r17117;
double r17119 = log(r17118);
double r17120 = y_re;
double r17121 = r17119 * r17120;
double r17122 = atan2(r17116, r17115);
double r17123 = y_im;
double r17124 = r17122 * r17123;
double r17125 = r17121 - r17124;
double r17126 = exp(r17125);
double r17127 = log(r17117);
double r17128 = cbrt(r17123);
double r17129 = r17128 * r17128;
double r17130 = r17127 * r17129;
double r17131 = r17130 * r17128;
double r17132 = r17122 * r17120;
double r17133 = r17131 + r17132;
double r17134 = sin(r17133);
double r17135 = expm1(r17134);
double r17136 = log1p(r17135);
double r17137 = r17126 * r17136;
return r17137;
}



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 hypot-def19.6
rmApplied *-un-lft-identity19.6
Applied sqrt-prod19.6
Simplified19.6
Simplified3.4
rmApplied add-cube-cbrt3.7
Applied associate-*r*3.7
rmApplied log1p-expm1-u3.7
Final simplification3.7
herbie shell --seed 2020083 +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)))))