Average Error: 33.0 → 3.7
Time: 11.9s
Precision: binary64
\[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) \]
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)))));
}

Error

Bits error versus x.re

Bits error versus x.im

Bits error versus y.re

Bits error versus y.im

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 33.0

    \[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) \]
  2. Simplified8.7

    \[\leadsto \color{blue}{\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right)} \]
  3. Using strategy rm
  4. Applied pow1_binary648.7

    \[\leadsto \color{blue}{{\left(\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\right)}^{1}} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
  5. Applied pow-to-exp_binary648.7

    \[\leadsto \color{blue}{e^{\log \left(\frac{{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)}^{y.re}}{e^{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}}\right) \cdot 1}} \cdot \cos \left(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
  6. Simplified3.6

    \[\leadsto e^{\color{blue}{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(\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), y.im, y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right)\right) \]
  7. Taylor expanded around 0 33.1

    \[\leadsto 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 \color{blue}{\cos \left(\log \left(\sqrt{{x.re}^{2} + {x.im}^{2}}\right) \cdot y.im\right)} \]
  8. Simplified3.7

    \[\leadsto 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 \color{blue}{\cos \left(y.im \cdot \log \left(\mathsf{hypot}\left(x.im, x.re\right)\right)\right)} \]
  9. Using strategy rm
  10. Applied add-cube-cbrt_binary643.7

    \[\leadsto 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 \log \color{blue}{\left(\left(\sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)}\right) \cdot \sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)}\right)}\right) \]
  11. Applied log-prod_binary643.7

    \[\leadsto 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 \color{blue}{\left(\log \left(\sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)}\right) + \log \left(\sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)}\right)\right)}\right) \]
  12. Applied distribute-rgt-in_binary643.7

    \[\leadsto 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 \color{blue}{\left(\log \left(\sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)}\right) \cdot y.im + \log \left(\sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)}\right) \cdot y.im\right)} \]
  13. Applied distribute-rgt-out_binary643.7

    \[\leadsto 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 \color{blue}{\left(y.im \cdot \left(\log \left(\sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)}\right) + \log \left(\sqrt[3]{\mathsf{hypot}\left(x.im, x.re\right)}\right)\right)\right)} \]
  14. Simplified3.7

    \[\leadsto 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 \color{blue}{\left(3 \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)}\right) \]
  15. Final simplification3.7

    \[\leadsto 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) \]

Reproduce

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)))))