Average Error: 31.0 → 0.8
Time: 14.9s
Precision: 64
\[\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}\]
\[\sqrt[3]{\frac{\log \left(\mathsf{hypot}\left(re, im\right)\right) \cdot \frac{\sqrt[3]{\log \left(\mathsf{hypot}\left(re, im\right)\right)} \cdot \sqrt[3]{\log \left(\mathsf{hypot}\left(re, im\right)\right)}}{\frac{\log base}{\sqrt[3]{\log \left(\mathsf{hypot}\left(re, im\right)\right)}}}}{\log base} \cdot \frac{\log \left(\mathsf{hypot}\left(re, im\right)\right)}{\log base}}\]
\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}
\sqrt[3]{\frac{\log \left(\mathsf{hypot}\left(re, im\right)\right) \cdot \frac{\sqrt[3]{\log \left(\mathsf{hypot}\left(re, im\right)\right)} \cdot \sqrt[3]{\log \left(\mathsf{hypot}\left(re, im\right)\right)}}{\frac{\log base}{\sqrt[3]{\log \left(\mathsf{hypot}\left(re, im\right)\right)}}}}{\log base} \cdot \frac{\log \left(\mathsf{hypot}\left(re, im\right)\right)}{\log base}}
double f(double re, double im, double base) {
        double r704890 = re;
        double r704891 = r704890 * r704890;
        double r704892 = im;
        double r704893 = r704892 * r704892;
        double r704894 = r704891 + r704893;
        double r704895 = sqrt(r704894);
        double r704896 = log(r704895);
        double r704897 = base;
        double r704898 = log(r704897);
        double r704899 = r704896 * r704898;
        double r704900 = atan2(r704892, r704890);
        double r704901 = 0.0;
        double r704902 = r704900 * r704901;
        double r704903 = r704899 + r704902;
        double r704904 = r704898 * r704898;
        double r704905 = r704901 * r704901;
        double r704906 = r704904 + r704905;
        double r704907 = r704903 / r704906;
        return r704907;
}

double f(double re, double im, double base) {
        double r704908 = re;
        double r704909 = im;
        double r704910 = hypot(r704908, r704909);
        double r704911 = log(r704910);
        double r704912 = cbrt(r704911);
        double r704913 = r704912 * r704912;
        double r704914 = base;
        double r704915 = log(r704914);
        double r704916 = r704915 / r704912;
        double r704917 = r704913 / r704916;
        double r704918 = r704911 * r704917;
        double r704919 = r704918 / r704915;
        double r704920 = r704911 / r704915;
        double r704921 = r704919 * r704920;
        double r704922 = cbrt(r704921);
        return r704922;
}

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.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. Simplified0.4

    \[\leadsto \color{blue}{\frac{\log \left(\mathsf{hypot}\left(re, im\right)\right)}{\log base}}\]
  3. Using strategy rm
  4. Applied add-cbrt-cube0.7

    \[\leadsto \color{blue}{\sqrt[3]{\left(\frac{\log \left(\mathsf{hypot}\left(re, im\right)\right)}{\log base} \cdot \frac{\log \left(\mathsf{hypot}\left(re, im\right)\right)}{\log base}\right) \cdot \frac{\log \left(\mathsf{hypot}\left(re, im\right)\right)}{\log base}}}\]
  5. Using strategy rm
  6. Applied associate-*l/0.7

    \[\leadsto \sqrt[3]{\color{blue}{\frac{\log \left(\mathsf{hypot}\left(re, im\right)\right) \cdot \frac{\log \left(\mathsf{hypot}\left(re, im\right)\right)}{\log base}}{\log base}} \cdot \frac{\log \left(\mathsf{hypot}\left(re, im\right)\right)}{\log base}}\]
  7. Using strategy rm
  8. Applied add-cube-cbrt0.8

    \[\leadsto \sqrt[3]{\frac{\log \left(\mathsf{hypot}\left(re, im\right)\right) \cdot \frac{\color{blue}{\left(\sqrt[3]{\log \left(\mathsf{hypot}\left(re, im\right)\right)} \cdot \sqrt[3]{\log \left(\mathsf{hypot}\left(re, im\right)\right)}\right) \cdot \sqrt[3]{\log \left(\mathsf{hypot}\left(re, im\right)\right)}}}{\log base}}{\log base} \cdot \frac{\log \left(\mathsf{hypot}\left(re, im\right)\right)}{\log base}}\]
  9. Applied associate-/l*0.8

    \[\leadsto \sqrt[3]{\frac{\log \left(\mathsf{hypot}\left(re, im\right)\right) \cdot \color{blue}{\frac{\sqrt[3]{\log \left(\mathsf{hypot}\left(re, im\right)\right)} \cdot \sqrt[3]{\log \left(\mathsf{hypot}\left(re, im\right)\right)}}{\frac{\log base}{\sqrt[3]{\log \left(\mathsf{hypot}\left(re, im\right)\right)}}}}}{\log base} \cdot \frac{\log \left(\mathsf{hypot}\left(re, im\right)\right)}{\log base}}\]
  10. Final simplification0.8

    \[\leadsto \sqrt[3]{\frac{\log \left(\mathsf{hypot}\left(re, im\right)\right) \cdot \frac{\sqrt[3]{\log \left(\mathsf{hypot}\left(re, im\right)\right)} \cdot \sqrt[3]{\log \left(\mathsf{hypot}\left(re, im\right)\right)}}{\frac{\log base}{\sqrt[3]{\log \left(\mathsf{hypot}\left(re, im\right)\right)}}}}{\log base} \cdot \frac{\log \left(\mathsf{hypot}\left(re, im\right)\right)}{\log base}}\]

Reproduce

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