Average Error: 32.9 → 3.7
Time: 8.5s
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 \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)\]
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 \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)
double f(double x_re, double x_im, double y_re, double y_im) {
        double r15621 = x_re;
        double r15622 = r15621 * r15621;
        double r15623 = x_im;
        double r15624 = r15623 * r15623;
        double r15625 = r15622 + r15624;
        double r15626 = sqrt(r15625);
        double r15627 = log(r15626);
        double r15628 = y_re;
        double r15629 = r15627 * r15628;
        double r15630 = atan2(r15623, r15621);
        double r15631 = y_im;
        double r15632 = r15630 * r15631;
        double r15633 = r15629 - r15632;
        double r15634 = exp(r15633);
        double r15635 = r15627 * r15631;
        double r15636 = r15630 * r15628;
        double r15637 = r15635 + r15636;
        double r15638 = sin(r15637);
        double r15639 = r15634 * r15638;
        return r15639;
}

double f(double x_re, double x_im, double y_re, double y_im) {
        double r15640 = 1.0;
        double r15641 = x_re;
        double r15642 = x_im;
        double r15643 = hypot(r15641, r15642);
        double r15644 = r15640 * r15643;
        double r15645 = log(r15644);
        double r15646 = y_re;
        double r15647 = r15645 * r15646;
        double r15648 = atan2(r15642, r15641);
        double r15649 = y_im;
        double r15650 = r15648 * r15649;
        double r15651 = r15647 - r15650;
        double r15652 = exp(r15651);
        double r15653 = log(r15643);
        double r15654 = cbrt(r15649);
        double r15655 = r15654 * r15654;
        double r15656 = r15653 * r15655;
        double r15657 = r15656 * r15654;
        double r15658 = r15648 * r15646;
        double r15659 = r15657 + r15658;
        double r15660 = sin(r15659);
        double r15661 = r15652 * r15660;
        return r15661;
}

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 32.9

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

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

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

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

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

Reproduce

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