Average Error: 32.7 → 21.4
Time: 1.1m
Precision: 64
Internal Precision: 2112
\[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}\;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 x.re \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \le -0.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 \sin \left(\log x.re \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{if}\;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 x.re \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right) \le 0.8375919897149404:\\ \;\;\;\;\sin \left(y.im \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) + y.re \cdot \tan^{-1}_* \frac{x.im}{x.re}\right) \cdot \frac{{x.re}^{y.re}}{{\left(e^{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}}\right)}^{\left(\sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \left(y.im \cdot \sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}}\right)\right)}}\\ \mathbf{else}:\\ \;\;\;\;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(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re - \log \left(\frac{-1}{x.re}\right) \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

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 3 regimes
  2. if (* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log x.re) y.im) (* (atan2 x.im x.re) y.re)))) < -0.0

    1. Initial program 34.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. Taylor expanded around inf 19.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}{x.re} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]

    if -0.0 < (* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log x.re) y.im) (* (atan2 x.im x.re) y.re)))) < 0.8375919897149404

    1. Initial program 9.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 \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 add-cube-cbrt9.0

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

      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \color{blue}{\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right) \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot y.im\right)}} \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)\]
    5. Using strategy rm
    6. Applied add-cube-cbrt9.0

      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right) \cdot \left(\sqrt[3]{\color{blue}{\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right) \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}}} \cdot y.im\right)} \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)\]
    7. Applied cbrt-prod9.0

      \[\leadsto e^{\log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) \cdot y.re - \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right) \cdot \left(\color{blue}{\left(\sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}}\right)} \cdot y.im\right)} \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)\]
    8. Taylor expanded around inf 9.8

      \[\leadsto e^{\log \color{blue}{x.re} \cdot y.re - \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}\right) \cdot \left(\left(\sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}} \cdot \sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re}}}\right) \cdot y.im\right)} \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)\]
    9. Applied simplify9.8

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

    if 0.8375919897149404 < (* (exp (- (* (log (sqrt (+ (* x.re x.re) (* x.im x.im)))) y.re) (* (atan2 x.im x.re) y.im))) (sin (+ (* (log x.re) y.im) (* (atan2 x.im x.re) y.re))))

    1. Initial program 33.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. Taylor expanded around -inf 24.3

      \[\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 \color{blue}{\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re - \log \left(\frac{-1}{x.re}\right) \cdot y.im\right)}\]
  3. Recombined 3 regimes into one program.

Runtime

Time bar (total: 1.1m)Debug logProfile

herbie shell --seed '#(1072936661 1621281212 3440817831 3219514234 460296804 1258167384)' 
(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)))))