Average Error: 31.0 → 18.6
Time: 34.3s
Precision: 64
Internal Precision: 576
\[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
\[\begin{array}{l} \mathbf{if}\;re \le -7.373796795114872 \cdot 10^{+42}:\\ \;\;\;\;\frac{-1}{\log base} \cdot \log \left(\frac{-1}{re}\right)\\ \mathbf{elif}\;re \le -1.132734653217697 \cdot 10^{-203}:\\ \;\;\;\;\sqrt[3]{\frac{{\left(\log \left(\sqrt{im \cdot im + re \cdot re}\right)\right)}^{3}}{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}}\\ \mathbf{elif}\;re \le 3.4345341339819355 \cdot 10^{-140}:\\ \;\;\;\;\log im \cdot \frac{1}{\log base}\\ \mathbf{elif}\;re \le 9.295499610334908 \cdot 10^{+101}:\\ \;\;\;\;\sqrt[3]{\frac{{\left(\log \left(im \cdot im + re \cdot re\right)\right)}^{3}}{\sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}}} \cdot \sqrt[3]{\frac{\frac{\frac{1}{8}}{\log base}}{\log base}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\log re}{\log base}\\ \end{array}\]

Error

Bits error versus re

Bits error versus im

Bits error versus base

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Split input into 5 regimes
  2. if re < -7.373796795114872e+42

    1. Initial program 42.9

      \[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
    2. Initial simplification42.9

      \[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\log base \cdot \log base}\]
    3. Taylor expanded around -inf 62.8

      \[\leadsto \color{blue}{-1 \cdot \frac{\log \left(\frac{-1}{re}\right)}{\log -1 - \log \left(\frac{-1}{base}\right)}}\]
    4. Simplified10.9

      \[\leadsto \color{blue}{\frac{-1}{\log base} \cdot \log \left(\frac{-1}{re}\right)}\]

    if -7.373796795114872e+42 < re < -1.132734653217697e-203

    1. Initial program 19.3

      \[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
    2. Initial simplification19.3

      \[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\log base \cdot \log base}\]
    3. Using strategy rm
    4. Applied add-cbrt-cube19.4

      \[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\color{blue}{\sqrt[3]{\left(\left(\log base \cdot \log base\right) \cdot \left(\log base \cdot \log base\right)\right) \cdot \left(\log base \cdot \log base\right)}}}\]
    5. Applied add-cbrt-cube19.5

      \[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \color{blue}{\sqrt[3]{\left(\log base \cdot \log base\right) \cdot \log base}}}{\sqrt[3]{\left(\left(\log base \cdot \log base\right) \cdot \left(\log base \cdot \log base\right)\right) \cdot \left(\log base \cdot \log base\right)}}\]
    6. Applied add-cbrt-cube19.6

      \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log \left(\sqrt{re \cdot re + im \cdot im}\right)\right) \cdot \log \left(\sqrt{re \cdot re + im \cdot im}\right)}} \cdot \sqrt[3]{\left(\log base \cdot \log base\right) \cdot \log base}}{\sqrt[3]{\left(\left(\log base \cdot \log base\right) \cdot \left(\log base \cdot \log base\right)\right) \cdot \left(\log base \cdot \log base\right)}}\]
    7. Applied cbrt-unprod19.5

      \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\left(\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log \left(\sqrt{re \cdot re + im \cdot im}\right)\right) \cdot \log \left(\sqrt{re \cdot re + im \cdot im}\right)\right) \cdot \left(\left(\log base \cdot \log base\right) \cdot \log base\right)}}}{\sqrt[3]{\left(\left(\log base \cdot \log base\right) \cdot \left(\log base \cdot \log base\right)\right) \cdot \left(\log base \cdot \log base\right)}}\]
    8. Applied cbrt-undiv19.4

      \[\leadsto \color{blue}{\sqrt[3]{\frac{\left(\left(\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log \left(\sqrt{re \cdot re + im \cdot im}\right)\right) \cdot \log \left(\sqrt{re \cdot re + im \cdot im}\right)\right) \cdot \left(\left(\log base \cdot \log base\right) \cdot \log base\right)}{\left(\left(\log base \cdot \log base\right) \cdot \left(\log base \cdot \log base\right)\right) \cdot \left(\log base \cdot \log base\right)}}}\]
    9. Simplified19.4

      \[\leadsto \sqrt[3]{\color{blue}{\frac{{\left(\log \left(\sqrt{re \cdot re + im \cdot im}\right)\right)}^{3}}{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}}}\]

    if -1.132734653217697e-203 < re < 3.4345341339819355e-140

    1. Initial program 29.5

      \[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
    2. Initial simplification29.5

      \[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\log base \cdot \log base}\]
    3. Using strategy rm
    4. Applied times-frac29.4

      \[\leadsto \color{blue}{\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log base} \cdot \frac{\log base}{\log base}}\]
    5. Simplified29.4

      \[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log base} \cdot \color{blue}{1}\]
    6. Using strategy rm
    7. Applied div-inv29.4

      \[\leadsto \color{blue}{\left(\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \frac{1}{\log base}\right)} \cdot 1\]
    8. Taylor expanded around 0 34.6

      \[\leadsto \left(\log \color{blue}{im} \cdot \frac{1}{\log base}\right) \cdot 1\]

    if 3.4345341339819355e-140 < re < 9.295499610334908e+101

    1. Initial program 16.0

      \[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
    2. Initial simplification16.0

      \[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\log base \cdot \log base}\]
    3. Using strategy rm
    4. Applied add-cbrt-cube16.2

      \[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\color{blue}{\sqrt[3]{\left(\left(\log base \cdot \log base\right) \cdot \left(\log base \cdot \log base\right)\right) \cdot \left(\log base \cdot \log base\right)}}}\]
    5. Applied add-cbrt-cube16.3

      \[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \color{blue}{\sqrt[3]{\left(\log base \cdot \log base\right) \cdot \log base}}}{\sqrt[3]{\left(\left(\log base \cdot \log base\right) \cdot \left(\log base \cdot \log base\right)\right) \cdot \left(\log base \cdot \log base\right)}}\]
    6. Applied add-cbrt-cube16.4

      \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log \left(\sqrt{re \cdot re + im \cdot im}\right)\right) \cdot \log \left(\sqrt{re \cdot re + im \cdot im}\right)}} \cdot \sqrt[3]{\left(\log base \cdot \log base\right) \cdot \log base}}{\sqrt[3]{\left(\left(\log base \cdot \log base\right) \cdot \left(\log base \cdot \log base\right)\right) \cdot \left(\log base \cdot \log base\right)}}\]
    7. Applied cbrt-unprod16.2

      \[\leadsto \frac{\color{blue}{\sqrt[3]{\left(\left(\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log \left(\sqrt{re \cdot re + im \cdot im}\right)\right) \cdot \log \left(\sqrt{re \cdot re + im \cdot im}\right)\right) \cdot \left(\left(\log base \cdot \log base\right) \cdot \log base\right)}}}{\sqrt[3]{\left(\left(\log base \cdot \log base\right) \cdot \left(\log base \cdot \log base\right)\right) \cdot \left(\log base \cdot \log base\right)}}\]
    8. Applied cbrt-undiv16.2

      \[\leadsto \color{blue}{\sqrt[3]{\frac{\left(\left(\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log \left(\sqrt{re \cdot re + im \cdot im}\right)\right) \cdot \log \left(\sqrt{re \cdot re + im \cdot im}\right)\right) \cdot \left(\left(\log base \cdot \log base\right) \cdot \log base\right)}{\left(\left(\log base \cdot \log base\right) \cdot \left(\log base \cdot \log base\right)\right) \cdot \left(\log base \cdot \log base\right)}}}\]
    9. Simplified16.2

      \[\leadsto \sqrt[3]{\color{blue}{\frac{{\left(\log \left(\sqrt{re \cdot re + im \cdot im}\right)\right)}^{3}}{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}}}\]
    10. Using strategy rm
    11. Applied add-cube-cbrt16.3

      \[\leadsto \sqrt[3]{\frac{{\left(\log \left(\sqrt{re \cdot re + im \cdot im}\right)\right)}^{3}}{\color{blue}{\left(\sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}} \cdot \sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}\right) \cdot \sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}}}}\]
    12. Applied pow1/216.3

      \[\leadsto \sqrt[3]{\frac{{\left(\log \color{blue}{\left({\left(re \cdot re + im \cdot im\right)}^{\frac{1}{2}}\right)}\right)}^{3}}{\left(\sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}} \cdot \sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}\right) \cdot \sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}}}\]
    13. Applied log-pow16.3

      \[\leadsto \sqrt[3]{\frac{{\color{blue}{\left(\frac{1}{2} \cdot \log \left(re \cdot re + im \cdot im\right)\right)}}^{3}}{\left(\sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}} \cdot \sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}\right) \cdot \sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}}}\]
    14. Applied unpow-prod-down16.3

      \[\leadsto \sqrt[3]{\frac{\color{blue}{{\frac{1}{2}}^{3} \cdot {\left(\log \left(re \cdot re + im \cdot im\right)\right)}^{3}}}{\left(\sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}} \cdot \sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}\right) \cdot \sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}}}\]
    15. Applied times-frac16.3

      \[\leadsto \sqrt[3]{\color{blue}{\frac{{\frac{1}{2}}^{3}}{\sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}} \cdot \sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}} \cdot \frac{{\left(\log \left(re \cdot re + im \cdot im\right)\right)}^{3}}{\sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}}}}\]
    16. Applied cbrt-prod16.4

      \[\leadsto \color{blue}{\sqrt[3]{\frac{{\frac{1}{2}}^{3}}{\sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}} \cdot \sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}}} \cdot \sqrt[3]{\frac{{\left(\log \left(re \cdot re + im \cdot im\right)\right)}^{3}}{\sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}}}}\]
    17. Simplified16.3

      \[\leadsto \color{blue}{\sqrt[3]{\frac{\frac{\frac{1}{8}}{\log base}}{\log base}}} \cdot \sqrt[3]{\frac{{\left(\log \left(re \cdot re + im \cdot im\right)\right)}^{3}}{\sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}}}\]

    if 9.295499610334908e+101 < re

    1. Initial program 49.8

      \[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
    2. Initial simplification49.8

      \[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base}{\log base \cdot \log base}\]
    3. Using strategy rm
    4. Applied times-frac49.7

      \[\leadsto \color{blue}{\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log base} \cdot \frac{\log base}{\log base}}\]
    5. Simplified49.7

      \[\leadsto \frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log base} \cdot \color{blue}{1}\]
    6. Taylor expanded around inf 9.1

      \[\leadsto \frac{\log \color{blue}{re}}{\log base} \cdot 1\]
  3. Recombined 5 regimes into one program.
  4. Final simplification18.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;re \le -7.373796795114872 \cdot 10^{+42}:\\ \;\;\;\;\frac{-1}{\log base} \cdot \log \left(\frac{-1}{re}\right)\\ \mathbf{elif}\;re \le -1.132734653217697 \cdot 10^{-203}:\\ \;\;\;\;\sqrt[3]{\frac{{\left(\log \left(\sqrt{im \cdot im + re \cdot re}\right)\right)}^{3}}{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}}\\ \mathbf{elif}\;re \le 3.4345341339819355 \cdot 10^{-140}:\\ \;\;\;\;\log im \cdot \frac{1}{\log base}\\ \mathbf{elif}\;re \le 9.295499610334908 \cdot 10^{+101}:\\ \;\;\;\;\sqrt[3]{\frac{{\left(\log \left(im \cdot im + re \cdot re\right)\right)}^{3}}{\sqrt[3]{\frac{\log base \cdot \log base}{\frac{1}{\log base}}}}} \cdot \sqrt[3]{\frac{\frac{\frac{1}{8}}{\log base}}{\log base}}\\ \mathbf{else}:\\ \;\;\;\;\frac{\log re}{\log base}\\ \end{array}\]

Runtime

Time bar (total: 34.3s)Debug logProfile

BaselineHerbieOracleSpan%
Regimes31.118.67.323.852.2%
herbie shell --seed 2018339 
(FPCore (re im base)
  :name "math.log/2 on complex, real part"
  (/ (+ (* (log (sqrt (+ (* re re) (* im im)))) (log base)) (* (atan2 im re) 0)) (+ (* (log base) (log base)) (* 0 0))))