Average Error: 32.6 → 23.5
Time: 43.1s
Precision: 64
Internal Precision: 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.re \le -4.0890564440273036 \cdot 10^{-209}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\right)\right)\\ \mathbf{elif}\;x.re \le 4.5784384971765045 \cdot 10^{-60}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right) \cdot \sqrt[3]{\sqrt[3]{\sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)} \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)} \cdot \left(\sqrt[3]{\sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)} \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)} \cdot \sqrt[3]{\sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)} \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)}\right)}} \cdot \sin \left(y.im \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \log x.re \cdot y.im\right) \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \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 x.re < -4.0890564440273036e-209

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

      \[\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(-1 \cdot x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]
    3. Simplified19.5

      \[\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(-x.re\right)} \cdot y.im + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\]

    if -4.0890564440273036e-209 < x.re < 4.5784384971765045e-60

    1. Initial program 26.7

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

      \[\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 y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right) \cdot \sqrt[3]{\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)\]
    4. Using strategy rm
    5. Applied add-cbrt-cube26.7

      \[\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 y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right) \cdot \color{blue}{\sqrt[3]{\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right) \cdot \sqrt[3]{\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)\]
    6. Using strategy rm
    7. Applied add-cbrt-cube26.7

      \[\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 y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right) \cdot \sqrt[3]{\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right) \cdot \color{blue}{\sqrt[3]{\left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right) \cdot \sqrt[3]{\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)\]
    8. Using strategy rm
    9. Applied add-cbrt-cube26.7

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

    if 4.5784384971765045e-60 < x.re

    1. Initial program 39.6

      \[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 26.0

      \[\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 - y.im \cdot \log \left(\frac{1}{x.re}\right)\right)}\]
    3. Simplified26.0

      \[\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 x.re \cdot y.im\right)}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification23.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;x.re \le -4.0890564440273036 \cdot 10^{-209}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + y.im \cdot \log \left(-x.re\right)\right)\\ \mathbf{elif}\;x.re \le 4.5784384971765045 \cdot 10^{-60}:\\ \;\;\;\;e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right) \cdot \sqrt[3]{\sqrt[3]{\sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)} \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)} \cdot \left(\sqrt[3]{\sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)} \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)} \cdot \sqrt[3]{\sqrt[3]{\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)} \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im} \cdot \sqrt[3]{\tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\right)}\right)}} \cdot \sin \left(y.im \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) + \tan^{-1}_* \frac{x.im}{x.re} \cdot y.re\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\tan^{-1}_* \frac{x.im}{x.re} \cdot y.re + \log x.re \cdot y.im\right) \cdot e^{y.re \cdot \log \left(\sqrt{x.re \cdot x.re + x.im \cdot x.im}\right) - \tan^{-1}_* \frac{x.im}{x.re} \cdot y.im}\\ \end{array}\]

Runtime

Time bar (total: 43.1s)Debug logProfile

herbie shell --seed 2018346 
(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)))))