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^{y.re \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right) - y.im \cdot \tan^{-1}_* \frac{x.im}{x.re}} \cdot \cos \left(y.im \cdot \left(3 \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)\right)
(FPCore (x.re x.im y.re y.im)
: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)))))(FPCore (x.re x.im y.re y.im) :precision binary64 (* (exp (- (* y.re (log (hypot x.im x.re))) (* y.im (atan2 x.im x.re)))) (cos (* y.im (* 3.0 (log (cbrt (hypot x.re x.im))))))))
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((y_46_re * log(hypot(x_46_im, x_46_re))) - (y_46_im * atan2(x_46_im, x_46_re))) * cos(y_46_im * (3.0 * log(cbrt(hypot(x_46_re, x_46_im)))));
}



Bits error versus x.re



Bits error versus x.im



Bits error versus y.re



Bits error versus y.im
Results
Initial program 33.0
Simplified8.7
rmApplied pow1_binary648.7
Applied pow-to-exp_binary648.7
Simplified3.6
Taylor expanded around 0 33.1
Simplified3.7
rmApplied add-cube-cbrt_binary643.7
Applied log-prod_binary643.7
Applied distribute-rgt-in_binary643.7
Applied distribute-rgt-out_binary643.7
Simplified3.7
Final simplification3.7
herbie shell --seed 2021211
(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)))))