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 - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)} \cdot \sqrt[3]{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)}\right)\right) \cdot \left(\sqrt[3]{\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right)} \cdot y.im\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((double) (((double) exp(((double) (((double) (((double) log(((double) sqrt(((double) (((double) (x_46_re * x_46_re)) + ((double) (x_46_im * x_46_im)))))))) * y_46_re)) - ((double) (((double) atan2(x_46_im, x_46_re)) * y_46_im)))))) * ((double) sin(((double) (((double) (((double) log(((double) sqrt(((double) (((double) (x_46_re * x_46_re)) + ((double) (x_46_im * x_46_im)))))))) * y_46_im)) + ((double) (((double) atan2(x_46_im, x_46_re)) * y_46_re))))))));
}
double code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return ((double) (((double) exp(((double) (((double) (((double) log(((double) hypot(x_46_re, x_46_im)))) * y_46_re)) - ((double) (((double) atan2(x_46_im, x_46_re)) * y_46_im)))))) * ((double) sin(((double) (((double) (((double) expm1(((double) log1p(((double) (((double) cbrt(((double) log(((double) hypot(x_46_re, x_46_im)))))) * ((double) cbrt(((double) log(((double) hypot(x_46_re, x_46_im)))))))))))) * ((double) (((double) cbrt(((double) log(((double) hypot(x_46_re, x_46_im)))))) * y_46_im)))) + ((double) (((double) atan2(x_46_im, x_46_re)) * y_46_re))))))));
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
Initial program 33.8
rmApplied hypot-def20.1
rmApplied hypot-def3.4
rmApplied add-cube-cbrt3.7
Applied associate-*l*3.7
rmApplied expm1-log1p-u3.7
Final simplification3.7
herbie shell --seed 2020121 +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)))))