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(\mathsf{hypot}\left(x.re, x.im\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{log1p}\left(\mathsf{expm1}\left(\sin \left(\log \left(\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 r16346 = x_re;
double r16347 = r16346 * r16346;
double r16348 = x_im;
double r16349 = r16348 * r16348;
double r16350 = r16347 + r16349;
double r16351 = sqrt(r16350);
double r16352 = log(r16351);
double r16353 = y_re;
double r16354 = r16352 * r16353;
double r16355 = atan2(r16348, r16346);
double r16356 = y_im;
double r16357 = r16355 * r16356;
double r16358 = r16354 - r16357;
double r16359 = exp(r16358);
double r16360 = r16352 * r16356;
double r16361 = r16355 * r16353;
double r16362 = r16360 + r16361;
double r16363 = sin(r16362);
double r16364 = r16359 * r16363;
return r16364;
}
double f(double x_re, double x_im, double y_re, double y_im) {
double r16365 = x_re;
double r16366 = x_im;
double r16367 = hypot(r16365, r16366);
double r16368 = log(r16367);
double r16369 = y_re;
double r16370 = r16368 * r16369;
double r16371 = atan2(r16366, r16365);
double r16372 = y_im;
double r16373 = cbrt(r16372);
double r16374 = r16373 * r16373;
double r16375 = r16371 * r16374;
double r16376 = r16375 * r16373;
double r16377 = r16370 - r16376;
double r16378 = exp(r16377);
double r16379 = r16368 * r16372;
double r16380 = r16371 * r16369;
double r16381 = r16379 + r16380;
double r16382 = sin(r16381);
double r16383 = expm1(r16382);
double r16384 = log1p(r16383);
double r16385 = r16378 * r16384;
return r16385;
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
Initial program 33.2
rmApplied hypot-def19.3
rmApplied hypot-def3.4
rmApplied add-cube-cbrt3.4
Applied associate-*r*3.4
rmApplied log1p-expm1-u3.4
Final simplification3.4
herbie shell --seed 2020065 +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)))))