Average Error: 32.2 → 0.3
Time: 4.4s
Precision: 64
\[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\]
\[\frac{1}{\sqrt{\log 10}} \cdot \log \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)\]
\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}
\frac{1}{\sqrt{\log 10}} \cdot \log \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)
double f(double re, double im) {
        double r40480 = re;
        double r40481 = r40480 * r40480;
        double r40482 = im;
        double r40483 = r40482 * r40482;
        double r40484 = r40481 + r40483;
        double r40485 = sqrt(r40484);
        double r40486 = log(r40485);
        double r40487 = 10.0;
        double r40488 = log(r40487);
        double r40489 = r40486 / r40488;
        return r40489;
}

double f(double re, double im) {
        double r40490 = 1.0;
        double r40491 = 10.0;
        double r40492 = log(r40491);
        double r40493 = sqrt(r40492);
        double r40494 = r40490 / r40493;
        double r40495 = re;
        double r40496 = im;
        double r40497 = hypot(r40495, r40496);
        double r40498 = pow(r40497, r40494);
        double r40499 = cbrt(r40498);
        double r40500 = r40499 * r40499;
        double r40501 = r40500 * r40499;
        double r40502 = log(r40501);
        double r40503 = r40494 * r40502;
        return r40503;
}

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.2

    \[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity32.2

    \[\leadsto \frac{\log \left(\sqrt{\color{blue}{1 \cdot \left(re \cdot re + im \cdot im\right)}}\right)}{\log 10}\]
  4. Applied sqrt-prod32.2

    \[\leadsto \frac{\log \color{blue}{\left(\sqrt{1} \cdot \sqrt{re \cdot re + im \cdot im}\right)}}{\log 10}\]
  5. Simplified32.2

    \[\leadsto \frac{\log \left(\color{blue}{1} \cdot \sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\]
  6. Simplified0.6

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

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

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

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

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

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

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

    \[\leadsto \frac{1}{\sqrt{\log 10}} \cdot \color{blue}{\log \left(e^{\frac{\log \left(1 \cdot \mathsf{hypot}\left(re, im\right)\right)}{\sqrt{\log 10}}}\right)}\]
  16. 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)}\]
  17. Using strategy rm
  18. 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)}\]
  19. Final simplification0.3

    \[\leadsto \frac{1}{\sqrt{\log 10}} \cdot \log \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)\]

Reproduce

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