Average Error: 33.2 → 3.5
Time: 32.6s
Precision: 64
\[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^{\left(y.re \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) + y.re \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\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 \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^{\left(y.re \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) + y.re \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)
double f(double x_re, double x_im, double y_re, double y_im) {
        double r528663 = x_re;
        double r528664 = r528663 * r528663;
        double r528665 = x_im;
        double r528666 = r528665 * r528665;
        double r528667 = r528664 + r528666;
        double r528668 = sqrt(r528667);
        double r528669 = log(r528668);
        double r528670 = y_re;
        double r528671 = r528669 * r528670;
        double r528672 = atan2(r528665, r528663);
        double r528673 = y_im;
        double r528674 = r528672 * r528673;
        double r528675 = r528671 - r528674;
        double r528676 = exp(r528675);
        double r528677 = r528669 * r528673;
        double r528678 = r528672 * r528670;
        double r528679 = r528677 + r528678;
        double r528680 = sin(r528679);
        double r528681 = r528676 * r528680;
        return r528681;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r528682 = y_re;
        double r528683 = x_re;
        double r528684 = x_im;
        double r528685 = hypot(r528683, r528684);
        double r528686 = cbrt(r528685);
        double r528687 = log(r528686);
        double r528688 = r528682 * r528687;
        double r528689 = r528686 * r528686;
        double r528690 = log(r528689);
        double r528691 = r528682 * r528690;
        double r528692 = r528688 + r528691;
        double r528693 = atan2(r528684, r528683);
        double r528694 = y_im;
        double r528695 = r528693 * r528694;
        double r528696 = r528692 - r528695;
        double r528697 = exp(r528696);
        double r528698 = log(r528685);
        double r528699 = r528693 * r528682;
        double r528700 = fma(r528694, r528698, r528699);
        double r528701 = sin(r528700);
        double r528702 = r528697 * r528701;
        return r528702;
}

Error

Bits error versus x.re

Bits error versus x.im

Bits error versus y.re

Bits error versus y.im

Derivation

  1. Initial program 33.2

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

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

    \[\leadsto e^{y.re \cdot \log \color{blue}{\left(\left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\]
  5. Applied log-prod3.5

    \[\leadsto e^{y.re \cdot \color{blue}{\left(\log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) + \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\]
  6. Applied distribute-lft-in3.5

    \[\leadsto e^{\color{blue}{\left(y.re \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) + y.re \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right)} - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\]
  7. Final simplification3.5

    \[\leadsto e^{\left(y.re \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right) + y.re \cdot \log \left(\sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)} \cdot \sqrt[3]{\mathsf{hypot}\left(x.re, x.im\right)}\right)\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\mathsf{fma}\left(y.im, \log \left(\mathsf{hypot}\left(x.re, x.im\right)\right), \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\]

Reproduce

herbie shell --seed 2019153 +o rules:numerics
(FPCore (x.re x.im y.re y.im)
  :name "powComplex, imaginary part"
  (* (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)))))