Average Error: 32.0 → 0.5
Time: 22.2s
Precision: 64
\[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}\]
\[\frac{\frac{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(re, im\right)\right), \log base, \tan^{-1}_* \frac{im}{re} \cdot 0.0\right)}{\mathsf{hypot}\left(0.0, \log base\right)}}{\sqrt{\sqrt[3]{{\left(\mathsf{hypot}\left(0.0, \log base\right)\right)}^{6}}}}\]
\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}
\frac{\frac{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(re, im\right)\right), \log base, \tan^{-1}_* \frac{im}{re} \cdot 0.0\right)}{\mathsf{hypot}\left(0.0, \log base\right)}}{\sqrt{\sqrt[3]{{\left(\mathsf{hypot}\left(0.0, \log base\right)\right)}^{6}}}}
double f(double re, double im, double base) {
        double r112594 = re;
        double r112595 = r112594 * r112594;
        double r112596 = im;
        double r112597 = r112596 * r112596;
        double r112598 = r112595 + r112597;
        double r112599 = sqrt(r112598);
        double r112600 = log(r112599);
        double r112601 = base;
        double r112602 = log(r112601);
        double r112603 = r112600 * r112602;
        double r112604 = atan2(r112596, r112594);
        double r112605 = 0.0;
        double r112606 = r112604 * r112605;
        double r112607 = r112603 + r112606;
        double r112608 = r112602 * r112602;
        double r112609 = r112605 * r112605;
        double r112610 = r112608 + r112609;
        double r112611 = r112607 / r112610;
        return r112611;
}

double f(double re, double im, double base) {
        double r112612 = re;
        double r112613 = im;
        double r112614 = hypot(r112612, r112613);
        double r112615 = log(r112614);
        double r112616 = base;
        double r112617 = log(r112616);
        double r112618 = atan2(r112613, r112612);
        double r112619 = 0.0;
        double r112620 = r112618 * r112619;
        double r112621 = fma(r112615, r112617, r112620);
        double r112622 = hypot(r112619, r112617);
        double r112623 = r112621 / r112622;
        double r112624 = 6.0;
        double r112625 = pow(r112622, r112624);
        double r112626 = cbrt(r112625);
        double r112627 = sqrt(r112626);
        double r112628 = r112623 / r112627;
        return r112628;
}

Error

Bits error versus re

Bits error versus im

Bits error versus base

Derivation

  1. Initial program 32.0

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

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(re, im\right)\right), \log base, \tan^{-1}_* \frac{im}{re} \cdot 0.0\right)}{\mathsf{fma}\left(\log base, \log base, 0.0 \cdot 0.0\right)}}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt0.5

    \[\leadsto \frac{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(re, im\right)\right), \log base, \tan^{-1}_* \frac{im}{re} \cdot 0.0\right)}{\color{blue}{\sqrt{\mathsf{fma}\left(\log base, \log base, 0.0 \cdot 0.0\right)} \cdot \sqrt{\mathsf{fma}\left(\log base, \log base, 0.0 \cdot 0.0\right)}}}\]
  5. Applied associate-/r*0.4

    \[\leadsto \color{blue}{\frac{\frac{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(re, im\right)\right), \log base, \tan^{-1}_* \frac{im}{re} \cdot 0.0\right)}{\sqrt{\mathsf{fma}\left(\log base, \log base, 0.0 \cdot 0.0\right)}}}{\sqrt{\mathsf{fma}\left(\log base, \log base, 0.0 \cdot 0.0\right)}}}\]
  6. Simplified0.4

    \[\leadsto \frac{\color{blue}{\frac{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(re, im\right)\right), \log base, \tan^{-1}_* \frac{im}{re} \cdot 0.0\right)}{\mathsf{hypot}\left(\log base, 0.0\right)}}}{\sqrt{\mathsf{fma}\left(\log base, \log base, 0.0 \cdot 0.0\right)}}\]
  7. Using strategy rm
  8. Applied *-un-lft-identity0.4

    \[\leadsto \frac{\frac{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(re, im\right)\right), \log base, \tan^{-1}_* \frac{im}{re} \cdot 0.0\right)}{\color{blue}{1 \cdot \mathsf{hypot}\left(\log base, 0.0\right)}}}{\sqrt{\mathsf{fma}\left(\log base, \log base, 0.0 \cdot 0.0\right)}}\]
  9. Applied *-un-lft-identity0.4

    \[\leadsto \frac{\frac{\color{blue}{1 \cdot \mathsf{fma}\left(\log \left(\mathsf{hypot}\left(re, im\right)\right), \log base, \tan^{-1}_* \frac{im}{re} \cdot 0.0\right)}}{1 \cdot \mathsf{hypot}\left(\log base, 0.0\right)}}{\sqrt{\mathsf{fma}\left(\log base, \log base, 0.0 \cdot 0.0\right)}}\]
  10. Applied times-frac0.4

    \[\leadsto \frac{\color{blue}{\frac{1}{1} \cdot \frac{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(re, im\right)\right), \log base, \tan^{-1}_* \frac{im}{re} \cdot 0.0\right)}{\mathsf{hypot}\left(\log base, 0.0\right)}}}{\sqrt{\mathsf{fma}\left(\log base, \log base, 0.0 \cdot 0.0\right)}}\]
  11. Simplified0.4

    \[\leadsto \frac{\color{blue}{1} \cdot \frac{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(re, im\right)\right), \log base, \tan^{-1}_* \frac{im}{re} \cdot 0.0\right)}{\mathsf{hypot}\left(\log base, 0.0\right)}}{\sqrt{\mathsf{fma}\left(\log base, \log base, 0.0 \cdot 0.0\right)}}\]
  12. Simplified0.4

    \[\leadsto \frac{1 \cdot \color{blue}{\frac{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(re, im\right)\right), \log base, \tan^{-1}_* \frac{im}{re} \cdot 0.0\right)}{\mathsf{hypot}\left(0.0, \log base\right)}}}{\sqrt{\mathsf{fma}\left(\log base, \log base, 0.0 \cdot 0.0\right)}}\]
  13. Using strategy rm
  14. Applied add-cbrt-cube0.5

    \[\leadsto \frac{1 \cdot \frac{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(re, im\right)\right), \log base, \tan^{-1}_* \frac{im}{re} \cdot 0.0\right)}{\mathsf{hypot}\left(0.0, \log base\right)}}{\sqrt{\color{blue}{\sqrt[3]{\left(\mathsf{fma}\left(\log base, \log base, 0.0 \cdot 0.0\right) \cdot \mathsf{fma}\left(\log base, \log base, 0.0 \cdot 0.0\right)\right) \cdot \mathsf{fma}\left(\log base, \log base, 0.0 \cdot 0.0\right)}}}}\]
  15. Simplified0.5

    \[\leadsto \frac{1 \cdot \frac{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(re, im\right)\right), \log base, \tan^{-1}_* \frac{im}{re} \cdot 0.0\right)}{\mathsf{hypot}\left(0.0, \log base\right)}}{\sqrt{\sqrt[3]{\color{blue}{{\left(\mathsf{hypot}\left(0.0, \log base\right)\right)}^{6}}}}}\]
  16. Final simplification0.5

    \[\leadsto \frac{\frac{\mathsf{fma}\left(\log \left(\mathsf{hypot}\left(re, im\right)\right), \log base, \tan^{-1}_* \frac{im}{re} \cdot 0.0\right)}{\mathsf{hypot}\left(0.0, \log base\right)}}{\sqrt{\sqrt[3]{{\left(\mathsf{hypot}\left(0.0, \log base\right)\right)}^{6}}}}\]

Reproduce

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