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 r109340 = im;
        double r109341 = re;
        double r109342 = atan2(r109340, r109341);
        double r109343 = base;
        double r109344 = log(r109343);
        double r109345 = r109342 * r109344;
        double r109346 = r109341 * r109341;
        double r109347 = r109340 * r109340;
        double r109348 = r109346 + r109347;
        double r109349 = sqrt(r109348);
        double r109350 = log(r109349);
        double r109351 = 0.0;
        double r109352 = r109350 * r109351;
        double r109353 = r109345 - r109352;
        double r109354 = r109344 * r109344;
        double r109355 = r109351 * r109351;
        double r109356 = r109354 + r109355;
        double r109357 = r109353 / r109356;
        return r109357;
}

double f(double re, double im, double base) {
        double r109358 = -1.0;
        double r109359 = im;
        double r109360 = re;
        double r109361 = atan2(r109359, r109360);
        double r109362 = base;
        double r109363 = 0.3333333333333333;
        double r109364 = pow(r109362, r109363);
        double r109365 = 2.0;
        double r109366 = -r109365;
        double r109367 = pow(r109364, r109366);
        double r109368 = r109367 / r109364;
        double r109369 = log(r109368);
        double r109370 = r109361 / r109369;
        double r109371 = r109358 * r109370;
        return r109371;
}

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