Average Error: 31.8 → 0.3
Time: 7.4s
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}\]
\[-1 \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\log \left(\frac{{\left({base}^{\frac{1}{3}}\right)}^{\left(-2\right)}}{{base}^{\frac{1}{3}}}\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}
-1 \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\log \left(\frac{{\left({base}^{\frac{1}{3}}\right)}^{\left(-2\right)}}{{base}^{\frac{1}{3}}}\right)}
double f(double re, double im, double base) {
        double r101874 = im;
        double r101875 = re;
        double r101876 = atan2(r101874, r101875);
        double r101877 = base;
        double r101878 = log(r101877);
        double r101879 = r101876 * r101878;
        double r101880 = r101875 * r101875;
        double r101881 = r101874 * r101874;
        double r101882 = r101880 + r101881;
        double r101883 = sqrt(r101882);
        double r101884 = log(r101883);
        double r101885 = 0.0;
        double r101886 = r101884 * r101885;
        double r101887 = r101879 - r101886;
        double r101888 = r101878 * r101878;
        double r101889 = r101885 * r101885;
        double r101890 = r101888 + r101889;
        double r101891 = r101887 / r101890;
        return r101891;
}

double f(double re, double im, double base) {
        double r101892 = -1.0;
        double r101893 = im;
        double r101894 = re;
        double r101895 = atan2(r101893, r101894);
        double r101896 = base;
        double r101897 = 0.3333333333333333;
        double r101898 = pow(r101896, r101897);
        double r101899 = 2.0;
        double r101900 = -r101899;
        double r101901 = pow(r101898, r101900);
        double r101902 = r101901 / r101898;
        double r101903 = log(r101902);
        double r101904 = r101895 / r101903;
        double r101905 = r101892 * r101904;
        return r101905;
}

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-log-exp0.3

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

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

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

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

Reproduce

herbie shell --seed 2020001 +o rules:numerics
(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))))