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)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 \mathsf{log1p}\left(\left(\sqrt[3]{\mathsf{expm1}\left(\cos \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)} \cdot \sqrt[3]{\mathsf{expm1}\left(\cos \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) \cdot \sqrt[3]{\mathsf{expm1}\left(\cos \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 code(double x_46_re, double x_46_im, double y_46_re, double y_46_im) {
return (exp(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * cos(((log(sqrt(((x_46_re * x_46_re) + (x_46_im * x_46_im)))) * y_46_im) + (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 (exp(((log(hypot(x_46_re, x_46_im)) * y_46_re) - (atan2(x_46_im, x_46_re) * y_46_im))) * log1p(((cbrt(expm1(cos(((log((1.0 * hypot(x_46_re, x_46_im))) * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re))))) * cbrt(expm1(cos(((log((1.0 * hypot(x_46_re, x_46_im))) * y_46_im) + (atan2(x_46_im, x_46_re) * y_46_re)))))) * cbrt(expm1(cos(((log((1.0 * hypot(x_46_re, x_46_im))) * y_46_im) + (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.2
rmApplied *-un-lft-identity33.2
Applied sqrt-prod33.2
Simplified33.2
Simplified19.6
rmApplied hypot-def3.3
rmApplied log1p-expm1-u3.3
rmApplied add-cube-cbrt3.9
Final simplification3.9
herbie shell --seed 2020049 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
:name "powComplex, real part"
:precision binary64
(* (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)))))