Average Error: 32.1 → 0.4
Time: 4.4s
Precision: 64
\[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\]
\[\log \left(\sqrt[3]{{\left(\mathsf{hypot}\left(re, im\right)\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}}\right) \cdot \frac{2}{\sqrt{\log 10}} + \frac{1}{\sqrt{\log 10}} \cdot \log \left(\sqrt[3]{{\left(\mathsf{hypot}\left(re, im\right)\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}}\right)\]
\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}
\log \left(\sqrt[3]{{\left(\mathsf{hypot}\left(re, im\right)\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}}\right) \cdot \frac{2}{\sqrt{\log 10}} + \frac{1}{\sqrt{\log 10}} \cdot \log \left(\sqrt[3]{{\left(\mathsf{hypot}\left(re, im\right)\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}}\right)
double f(double re, double im) {
        double r83667 = re;
        double r83668 = r83667 * r83667;
        double r83669 = im;
        double r83670 = r83669 * r83669;
        double r83671 = r83668 + r83670;
        double r83672 = sqrt(r83671);
        double r83673 = log(r83672);
        double r83674 = 10.0;
        double r83675 = log(r83674);
        double r83676 = r83673 / r83675;
        return r83676;
}

double f(double re, double im) {
        double r83677 = re;
        double r83678 = im;
        double r83679 = hypot(r83677, r83678);
        double r83680 = 1.0;
        double r83681 = 10.0;
        double r83682 = log(r83681);
        double r83683 = sqrt(r83682);
        double r83684 = r83680 / r83683;
        double r83685 = pow(r83679, r83684);
        double r83686 = cbrt(r83685);
        double r83687 = log(r83686);
        double r83688 = 2.0;
        double r83689 = r83688 / r83683;
        double r83690 = r83687 * r83689;
        double r83691 = r83684 * r83687;
        double r83692 = r83690 + r83691;
        return r83692;
}

Error

Bits error versus re

Bits error versus im

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 32.1

    \[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\]
  2. Using strategy rm
  3. Applied hypot-def0.6

    \[\leadsto \frac{\log \color{blue}{\left(\mathsf{hypot}\left(re, im\right)\right)}}{\log 10}\]
  4. Using strategy rm
  5. Applied add-sqr-sqrt0.6

    \[\leadsto \frac{\log \left(\mathsf{hypot}\left(re, im\right)\right)}{\color{blue}{\sqrt{\log 10} \cdot \sqrt{\log 10}}}\]
  6. Applied pow10.6

    \[\leadsto \frac{\log \color{blue}{\left({\left(\mathsf{hypot}\left(re, im\right)\right)}^{1}\right)}}{\sqrt{\log 10} \cdot \sqrt{\log 10}}\]
  7. Applied log-pow0.6

    \[\leadsto \frac{\color{blue}{1 \cdot \log \left(\mathsf{hypot}\left(re, im\right)\right)}}{\sqrt{\log 10} \cdot \sqrt{\log 10}}\]
  8. Applied times-frac0.6

    \[\leadsto \color{blue}{\frac{1}{\sqrt{\log 10}} \cdot \frac{\log \left(\mathsf{hypot}\left(re, im\right)\right)}{\sqrt{\log 10}}}\]
  9. Using strategy rm
  10. Applied add-log-exp0.6

    \[\leadsto \frac{1}{\sqrt{\log 10}} \cdot \color{blue}{\log \left(e^{\frac{\log \left(\mathsf{hypot}\left(re, im\right)\right)}{\sqrt{\log 10}}}\right)}\]
  11. Simplified0.3

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

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

    \[\leadsto \frac{1}{\sqrt{\log 10}} \cdot \color{blue}{\left(\log \left(\sqrt[3]{{\left(\mathsf{hypot}\left(re, im\right)\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}} \cdot \sqrt[3]{{\left(\mathsf{hypot}\left(re, im\right)\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}}\right) + \log \left(\sqrt[3]{{\left(\mathsf{hypot}\left(re, im\right)\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}}\right)\right)}\]
  15. Applied distribute-lft-in0.4

    \[\leadsto \color{blue}{\frac{1}{\sqrt{\log 10}} \cdot \log \left(\sqrt[3]{{\left(\mathsf{hypot}\left(re, im\right)\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}} \cdot \sqrt[3]{{\left(\mathsf{hypot}\left(re, im\right)\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}}\right) + \frac{1}{\sqrt{\log 10}} \cdot \log \left(\sqrt[3]{{\left(\mathsf{hypot}\left(re, im\right)\right)}^{\left(\frac{1}{\sqrt{\log 10}}\right)}}\right)}\]
  16. Simplified0.4

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

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

Reproduce

herbie shell --seed 2019353 +o rules:numerics
(FPCore (re im)
  :name "math.log10 on complex, real part"
  :precision binary64
  (/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))