Average Error: 42.0 → 31.3
Time: 1.6m
Precision: 64
Ground Truth: 128
\[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)\]
\[\begin{array}{l} \mathbf{if}\;x.im \le -7.962454613450594 \cdot 10^{-271}:\\ \;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-1 \cdot x.im\right)\right) \cdot \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{1 + \left(\frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^2 \cdot {y.im}^2\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\\ \mathbf{if}\;x.im \le 5.686322021148107 \cdot 10^{-261}:\\ \;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)\right) \cdot \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{1 + \left(\frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{\frac{1}{x.im}}{\frac{1}{x.re}}\right)}^2 \cdot {y.im}^2\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)\right) \cdot \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{1 + \left(\frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{\frac{1}{x.im}}{\frac{1}{x.re}}\right)}^2 \cdot {y.im}^2\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\\ \end{array}\]

Error

Bits error versus x.re

Bits error versus x.im

Bits error versus y.re

Bits error versus y.im

Derivation

  1. Split input into 3 regimes.
  2. if x.im < -7.962454613450594e-271

    1. Initial program 43.8

      \[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. Applied simplify 45.5

      \[\leadsto \color{blue}{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)\right) \cdot \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}}\]
    3. Applied taylor 40.4

      \[\leadsto \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)\right) \cdot \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{1 + \left(\frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^2 \cdot {y.im}^2\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\]
    4. Taylor expanded around 0 40.4

      \[\leadsto \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)\right) \cdot \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{\color{blue}{1 + \left(\frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^2 \cdot {y.im}^2\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}}\]
    5. Applied taylor 25.2

      \[\leadsto \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-1 \cdot x.im\right)\right) \cdot \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{1 + \left(\frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^2 \cdot {y.im}^2\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\]
    6. Taylor expanded around -inf 25.2

      \[\leadsto \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \color{blue}{\left(-1 \cdot x.im\right)}\right) \cdot \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{1 + \left(\frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^2 \cdot {y.im}^2\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\]

    if -7.962454613450594e-271 < x.im < 5.686322021148107e-261

    1. Initial program 40.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. Applied simplify 42.5

      \[\leadsto \color{blue}{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)\right) \cdot \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}}\]
    3. Applied taylor 40.0

      \[\leadsto \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)\right) \cdot \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{1 + \left(\frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^2 \cdot {y.im}^2\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\]
    4. Taylor expanded around 0 40.0

      \[\leadsto \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)\right) \cdot \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{\color{blue}{1 + \left(\frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^2 \cdot {y.im}^2\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}}\]
    5. Applied taylor 34.2

      \[\leadsto \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)\right) \cdot \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{1 + \left(\frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{\frac{1}{x.im}}{\frac{1}{x.re}}\right)}^2 \cdot {y.im}^2\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\]
    6. Taylor expanded around inf 34.2

      \[\leadsto \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)\right) \cdot \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{1 + \left(\frac{1}{2} \cdot \color{blue}{\left({\left(\tan^{-1}_* \frac{\frac{1}{x.im}}{\frac{1}{x.re}}\right)}^2 \cdot {y.im}^2\right)} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\]

    if 5.686322021148107e-261 < x.im

    1. Initial program 40.4

      \[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. Applied simplify 42.2

      \[\leadsto \color{blue}{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)\right) \cdot \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{{\left(e^{y.im}\right)}^{\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}}}\]
    3. Applied taylor 37.7

      \[\leadsto \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)\right) \cdot \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{1 + \left(\frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^2 \cdot {y.im}^2\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\]
    4. Taylor expanded around 0 37.7

      \[\leadsto \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)\right) \cdot \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{\color{blue}{1 + \left(\frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{x.im}{x.re}\right)}^2 \cdot {y.im}^2\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}}\]
    5. Applied taylor 37.0

      \[\leadsto \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)\right) \cdot \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{1 + \left(\frac{1}{2} \cdot \left({\left(\tan^{-1}_* \frac{\frac{1}{x.im}}{\frac{1}{x.re}}\right)}^2 \cdot {y.im}^2\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\]
    6. Taylor expanded around inf 37.0

      \[\leadsto \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)\right) \cdot \frac{{\left(\sqrt{{x.im}^2 + x.re \cdot x.re}\right)}^{y.re}}{1 + \left(\frac{1}{2} \cdot \color{blue}{\left({\left(\tan^{-1}_* \frac{\frac{1}{x.im}}{\frac{1}{x.re}}\right)}^2 \cdot {y.im}^2\right)} + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im\right)}\]
  3. Recombined 3 regimes into one program.
  4. Removed slow pow expressions

Runtime

Total time: 1.6m Debug log

Please include this information when filing a bug report:

herbie --seed '#(1477947967 2989302000 4150607639 1563523061 3763939561 2770508328)'
(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)))))