Average Error: 30.5 → 0.4
Time: 20.1s
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}\]
\[\frac{\log \left(\left({\left({\left(\sqrt{\mathsf{hypot}\left(re, im\right)}\right)}^{\left(\sqrt[3]{\frac{1}{3}} \cdot \sqrt[3]{\frac{1}{3}}\right)}\right)}^{\left(\sqrt[3]{\frac{1}{3}}\right)} \cdot \sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}}\right) \cdot \left(\left(\sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}}\right) \cdot \left(\sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}}\right)\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}
\frac{\log \left(\left({\left({\left(\sqrt{\mathsf{hypot}\left(re, im\right)}\right)}^{\left(\sqrt[3]{\frac{1}{3}} \cdot \sqrt[3]{\frac{1}{3}}\right)}\right)}^{\left(\sqrt[3]{\frac{1}{3}}\right)} \cdot \sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}}\right) \cdot \left(\left(\sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}}\right) \cdot \left(\sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}}\right)\right)\right)}{\log base}
double f(double re, double im, double base) {
        double r832377 = re;
        double r832378 = r832377 * r832377;
        double r832379 = im;
        double r832380 = r832379 * r832379;
        double r832381 = r832378 + r832380;
        double r832382 = sqrt(r832381);
        double r832383 = log(r832382);
        double r832384 = base;
        double r832385 = log(r832384);
        double r832386 = r832383 * r832385;
        double r832387 = atan2(r832379, r832377);
        double r832388 = 0.0;
        double r832389 = r832387 * r832388;
        double r832390 = r832386 + r832389;
        double r832391 = r832385 * r832385;
        double r832392 = r832388 * r832388;
        double r832393 = r832391 + r832392;
        double r832394 = r832390 / r832393;
        return r832394;
}

double f(double re, double im, double base) {
        double r832395 = re;
        double r832396 = im;
        double r832397 = hypot(r832395, r832396);
        double r832398 = sqrt(r832397);
        double r832399 = 0.3333333333333333;
        double r832400 = cbrt(r832399);
        double r832401 = r832400 * r832400;
        double r832402 = pow(r832398, r832401);
        double r832403 = pow(r832402, r832400);
        double r832404 = cbrt(r832398);
        double r832405 = r832403 * r832404;
        double r832406 = r832404 * r832404;
        double r832407 = r832406 * r832406;
        double r832408 = r832405 * r832407;
        double r832409 = log(r832408);
        double r832410 = base;
        double r832411 = log(r832410);
        double r832412 = r832409 / r832411;
        return r832412;
}

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 30.5

    \[\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-sqr-sqrt0.4

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

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

    \[\leadsto \frac{\log \left(\color{blue}{\left(\left(\sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}}\right) \cdot \sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}}\right)} \cdot \left(\left(\sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}}\right) \cdot \sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}}\right)\right)}{\log base}\]
  8. Applied swap-sqr0.4

    \[\leadsto \frac{\log \color{blue}{\left(\left(\left(\sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}}\right) \cdot \left(\sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}}\right)\right) \cdot \left(\sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}}\right)\right)}}{\log base}\]
  9. Using strategy rm
  10. Applied pow1/30.4

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

    \[\leadsto \frac{\log \left(\left(\left(\sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}}\right) \cdot \left(\sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}}\right)\right) \cdot \left({\left(\sqrt{\mathsf{hypot}\left(re, im\right)}\right)}^{\color{blue}{\left(\left(\sqrt[3]{\frac{1}{3}} \cdot \sqrt[3]{\frac{1}{3}}\right) \cdot \sqrt[3]{\frac{1}{3}}\right)}} \cdot \sqrt[3]{\sqrt{\mathsf{hypot}\left(re, im\right)}}\right)\right)}{\log base}\]
  13. Applied pow-unpow0.4

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

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

Reproduce

herbie shell --seed 2019152 +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))))