Average Error: 33.3 → 3.7
Time: 10.4s
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^{\log \left(1 \cdot \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(\mathsf{expm1}\left(\sin \left(\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot \left(\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}\right)\right) \cdot \sqrt[3]{y.im} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\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 \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(1 \cdot \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(\mathsf{expm1}\left(\sin \left(\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot \left(\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}\right)\right) \cdot \sqrt[3]{y.im} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\right)
double f(double x_re, double x_im, double y_re, double y_im) {
        double r17095 = x_re;
        double r17096 = r17095 * r17095;
        double r17097 = x_im;
        double r17098 = r17097 * r17097;
        double r17099 = r17096 + r17098;
        double r17100 = sqrt(r17099);
        double r17101 = log(r17100);
        double r17102 = y_re;
        double r17103 = r17101 * r17102;
        double r17104 = atan2(r17097, r17095);
        double r17105 = y_im;
        double r17106 = r17104 * r17105;
        double r17107 = r17103 - r17106;
        double r17108 = exp(r17107);
        double r17109 = r17101 * r17105;
        double r17110 = r17104 * r17102;
        double r17111 = r17109 + r17110;
        double r17112 = sin(r17111);
        double r17113 = r17108 * r17112;
        return r17113;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r17114 = 1.0;
        double r17115 = x_re;
        double r17116 = x_im;
        double r17117 = hypot(r17115, r17116);
        double r17118 = r17114 * r17117;
        double r17119 = log(r17118);
        double r17120 = y_re;
        double r17121 = r17119 * r17120;
        double r17122 = atan2(r17116, r17115);
        double r17123 = y_im;
        double r17124 = r17122 * r17123;
        double r17125 = r17121 - r17124;
        double r17126 = exp(r17125);
        double r17127 = log(r17117);
        double r17128 = cbrt(r17123);
        double r17129 = r17128 * r17128;
        double r17130 = r17127 * r17129;
        double r17131 = r17130 * r17128;
        double r17132 = r17122 * r17120;
        double r17133 = r17131 + r17132;
        double r17134 = sin(r17133);
        double r17135 = expm1(r17134);
        double r17136 = log1p(r17135);
        double r17137 = r17126 * r17136;
        return r17137;
}

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.3

    \[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. Using strategy rm
  3. Applied hypot-def19.6

    \[\leadsto 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 \color{blue}{\left(\mathsf{hypot}\left(x.re, x.im\right)\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
  4. Using strategy rm
  5. Applied *-un-lft-identity19.6

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

    \[\leadsto e^{\log \color{blue}{\left(\sqrt{1} \cdot \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(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
  7. Simplified19.6

    \[\leadsto e^{\log \left(\color{blue}{1} \cdot \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(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
  8. Simplified3.4

    \[\leadsto e^{\log \left(1 \cdot \color{blue}{\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(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
  9. Using strategy rm
  10. Applied add-cube-cbrt3.7

    \[\leadsto e^{\log \left(1 \cdot \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(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot \color{blue}{\left(\left(\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}\right) \cdot \sqrt[3]{y.im}\right)} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
  11. Applied associate-*r*3.7

    \[\leadsto e^{\log \left(1 \cdot \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(\color{blue}{\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot \left(\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}\right)\right) \cdot \sqrt[3]{y.im}} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
  12. Using strategy rm
  13. Applied log1p-expm1-u3.7

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

    \[\leadsto e^{\log \left(1 \cdot \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(\mathsf{expm1}\left(\sin \left(\left(\log \left(\mathsf{hypot}\left(x.re, x.im\right)\right) \cdot \left(\sqrt[3]{y.im} \cdot \sqrt[3]{y.im}\right)\right) \cdot \sqrt[3]{y.im} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\right)\right)\]

Reproduce

herbie shell --seed 2020083 +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)))))