Average Error: 31.8 → 0.4
Time: 7.3s
Precision: 64
\[\frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}\]
\[\frac{-\tan^{-1}_* \frac{im}{re}}{-\left(\left(\log base \cdot \frac{1}{3} + \log \left(\sqrt{{\left(\frac{1}{base}\right)}^{\frac{-1}{3}}}\right) \cdot 2\right) + \log \left(\sqrt{{\left(\frac{1}{base}\right)}^{\frac{-1}{3}}}\right) \cdot 2\right)}\]
\frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}
\frac{-\tan^{-1}_* \frac{im}{re}}{-\left(\left(\log base \cdot \frac{1}{3} + \log \left(\sqrt{{\left(\frac{1}{base}\right)}^{\frac{-1}{3}}}\right) \cdot 2\right) + \log \left(\sqrt{{\left(\frac{1}{base}\right)}^{\frac{-1}{3}}}\right) \cdot 2\right)}
double f(double re, double im, double base) {
        double r111345 = im;
        double r111346 = re;
        double r111347 = atan2(r111345, r111346);
        double r111348 = base;
        double r111349 = log(r111348);
        double r111350 = r111347 * r111349;
        double r111351 = r111346 * r111346;
        double r111352 = r111345 * r111345;
        double r111353 = r111351 + r111352;
        double r111354 = sqrt(r111353);
        double r111355 = log(r111354);
        double r111356 = 0.0;
        double r111357 = r111355 * r111356;
        double r111358 = r111350 - r111357;
        double r111359 = r111349 * r111349;
        double r111360 = r111356 * r111356;
        double r111361 = r111359 + r111360;
        double r111362 = r111358 / r111361;
        return r111362;
}

double f(double re, double im, double base) {
        double r111363 = im;
        double r111364 = re;
        double r111365 = atan2(r111363, r111364);
        double r111366 = -r111365;
        double r111367 = base;
        double r111368 = log(r111367);
        double r111369 = 0.3333333333333333;
        double r111370 = r111368 * r111369;
        double r111371 = 1.0;
        double r111372 = r111371 / r111367;
        double r111373 = -0.3333333333333333;
        double r111374 = pow(r111372, r111373);
        double r111375 = sqrt(r111374);
        double r111376 = log(r111375);
        double r111377 = 2.0;
        double r111378 = r111376 * r111377;
        double r111379 = r111370 + r111378;
        double r111380 = r111379 + r111378;
        double r111381 = -r111380;
        double r111382 = r111366 / r111381;
        return r111382;
}

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. Initial program 31.8

    \[\frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}\]
  2. Taylor expanded around inf 0.3

    \[\leadsto \color{blue}{-1 \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\log \left(\frac{1}{base}\right)}}\]
  3. Using strategy rm
  4. Applied add-cube-cbrt0.3

    \[\leadsto -1 \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\log \left(\frac{1}{\color{blue}{\left(\sqrt[3]{base} \cdot \sqrt[3]{base}\right) \cdot \sqrt[3]{base}}}\right)}\]
  5. Applied add-cube-cbrt0.3

    \[\leadsto -1 \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\log \left(\frac{\color{blue}{\left(\sqrt[3]{1} \cdot \sqrt[3]{1}\right) \cdot \sqrt[3]{1}}}{\left(\sqrt[3]{base} \cdot \sqrt[3]{base}\right) \cdot \sqrt[3]{base}}\right)}\]
  6. Applied times-frac0.3

    \[\leadsto -1 \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\log \color{blue}{\left(\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\sqrt[3]{base} \cdot \sqrt[3]{base}} \cdot \frac{\sqrt[3]{1}}{\sqrt[3]{base}}\right)}}\]
  7. Applied log-prod0.4

    \[\leadsto -1 \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\color{blue}{\log \left(\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\sqrt[3]{base} \cdot \sqrt[3]{base}}\right) + \log \left(\frac{\sqrt[3]{1}}{\sqrt[3]{base}}\right)}}\]
  8. Simplified0.4

    \[\leadsto -1 \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\color{blue}{\left(-2\right) \cdot \log \left(\sqrt[3]{base}\right)} + \log \left(\frac{\sqrt[3]{1}}{\sqrt[3]{base}}\right)}\]
  9. Simplified0.4

    \[\leadsto -1 \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\left(-2\right) \cdot \log \left(\sqrt[3]{base}\right) + \color{blue}{\log \left(\frac{1}{\sqrt[3]{base}}\right)}}\]
  10. Taylor expanded around inf 0.3

    \[\leadsto -1 \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\left(-2\right) \cdot \log \color{blue}{\left({\left(\frac{1}{base}\right)}^{\frac{-1}{3}}\right)} + \log \left(\frac{1}{\sqrt[3]{base}}\right)}\]
  11. Using strategy rm
  12. Applied add-sqr-sqrt0.3

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

    \[\leadsto -1 \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\left(-2\right) \cdot \color{blue}{\left(\log \left(\sqrt{{\left(\frac{1}{base}\right)}^{\frac{-1}{3}}}\right) + \log \left(\sqrt{{\left(\frac{1}{base}\right)}^{\frac{-1}{3}}}\right)\right)} + \log \left(\frac{1}{\sqrt[3]{base}}\right)}\]
  14. Applied distribute-lft-in0.3

    \[\leadsto -1 \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\color{blue}{\left(\left(-2\right) \cdot \log \left(\sqrt{{\left(\frac{1}{base}\right)}^{\frac{-1}{3}}}\right) + \left(-2\right) \cdot \log \left(\sqrt{{\left(\frac{1}{base}\right)}^{\frac{-1}{3}}}\right)\right)} + \log \left(\frac{1}{\sqrt[3]{base}}\right)}\]
  15. Applied associate-+l+0.4

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

    \[\leadsto -1 \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\left(-2\right) \cdot \log \left(\sqrt{{\left(\frac{1}{base}\right)}^{\frac{-1}{3}}}\right) + \color{blue}{\left(-\left(\log base \cdot \frac{1}{3} + \log \left(\sqrt{{\left(\frac{1}{base}\right)}^{\frac{-1}{3}}}\right) \cdot 2\right)\right)}}\]
  17. Final simplification0.4

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

Reproduce

herbie shell --seed 2020001 
(FPCore (re im base)
  :name "math.log/2 on complex, imaginary part"
  :precision binary64
  (/ (- (* (atan2 im re) (log base)) (* (log (sqrt (+ (* re re) (* im im)))) 0.0)) (+ (* (log base) (log base)) (* 0.0 0.0))))