Average Error: 31.8 → 0.3
Time: 7.2s
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 r53678 = im;
        double r53679 = re;
        double r53680 = atan2(r53678, r53679);
        double r53681 = base;
        double r53682 = log(r53681);
        double r53683 = r53680 * r53682;
        double r53684 = r53679 * r53679;
        double r53685 = r53678 * r53678;
        double r53686 = r53684 + r53685;
        double r53687 = sqrt(r53686);
        double r53688 = log(r53687);
        double r53689 = 0.0;
        double r53690 = r53688 * r53689;
        double r53691 = r53683 - r53690;
        double r53692 = r53682 * r53682;
        double r53693 = r53689 * r53689;
        double r53694 = r53692 + r53693;
        double r53695 = r53691 / r53694;
        return r53695;
}

double f(double re, double im, double base) {
        double r53696 = -1.0;
        double r53697 = im;
        double r53698 = re;
        double r53699 = atan2(r53697, r53698);
        double r53700 = base;
        double r53701 = 0.3333333333333333;
        double r53702 = pow(r53700, r53701);
        double r53703 = 2.0;
        double r53704 = -r53703;
        double r53705 = pow(r53702, r53704);
        double r53706 = r53705 / r53702;
        double r53707 = log(r53706);
        double r53708 = r53699 / r53707;
        double r53709 = r53696 * r53708;
        return r53709;
}

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))))