Average Error: 0.8 → 0.5
Time: 13.1s
Precision: 64
\[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\]
\[\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{expm1}\left(\frac{\sqrt{\frac{1}{\log 10}} \cdot \tan^{-1}_* \frac{im}{re}}{\sqrt{\log 10}}\right)\right)\right)\right)\]
\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}
\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{expm1}\left(\frac{\sqrt{\frac{1}{\log 10}} \cdot \tan^{-1}_* \frac{im}{re}}{\sqrt{\log 10}}\right)\right)\right)\right)
double f(double re, double im) {
        double r39892 = im;
        double r39893 = re;
        double r39894 = atan2(r39892, r39893);
        double r39895 = 10.0;
        double r39896 = log(r39895);
        double r39897 = r39894 / r39896;
        return r39897;
}

double f(double re, double im) {
        double r39898 = 1.0;
        double r39899 = 10.0;
        double r39900 = log(r39899);
        double r39901 = r39898 / r39900;
        double r39902 = sqrt(r39901);
        double r39903 = im;
        double r39904 = re;
        double r39905 = atan2(r39903, r39904);
        double r39906 = r39902 * r39905;
        double r39907 = sqrt(r39900);
        double r39908 = r39906 / r39907;
        double r39909 = expm1(r39908);
        double r39910 = expm1(r39909);
        double r39911 = log1p(r39910);
        double r39912 = log1p(r39911);
        return r39912;
}

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 0.8

    \[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt0.8

    \[\leadsto \frac{\tan^{-1}_* \frac{im}{re}}{\color{blue}{\sqrt{\log 10} \cdot \sqrt{\log 10}}}\]
  4. Applied *-un-lft-identity0.8

    \[\leadsto \frac{\color{blue}{1 \cdot \tan^{-1}_* \frac{im}{re}}}{\sqrt{\log 10} \cdot \sqrt{\log 10}}\]
  5. Applied times-frac0.8

    \[\leadsto \color{blue}{\frac{1}{\sqrt{\log 10}} \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\sqrt{\log 10}}}\]
  6. Taylor expanded around 0 0.8

    \[\leadsto \frac{1}{\sqrt{\log 10}} \cdot \color{blue}{\left(\sqrt{\frac{1}{\log 10}} \cdot \tan^{-1}_* \frac{im}{re}\right)}\]
  7. Using strategy rm
  8. Applied log1p-expm1-u0.7

    \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{1}{\sqrt{\log 10}} \cdot \left(\sqrt{\frac{1}{\log 10}} \cdot \tan^{-1}_* \frac{im}{re}\right)\right)\right)}\]
  9. Simplified0.7

    \[\leadsto \mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(\tan^{-1}_* \frac{im}{re} \cdot \frac{\sqrt{\frac{1}{\log 10}}}{\sqrt{\log 10}}\right)}\right)\]
  10. Using strategy rm
  11. Applied log1p-expm1-u0.4

    \[\leadsto \mathsf{log1p}\left(\color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{im}{re} \cdot \frac{\sqrt{\frac{1}{\log 10}}}{\sqrt{\log 10}}\right)\right)\right)}\right)\]
  12. Simplified0.5

    \[\leadsto \mathsf{log1p}\left(\mathsf{log1p}\left(\color{blue}{\mathsf{expm1}\left(\mathsf{expm1}\left(\frac{\tan^{-1}_* \frac{im}{re} \cdot \sqrt{\frac{1}{\log 10}}}{\sqrt{\log 10}}\right)\right)}\right)\right)\]
  13. Final simplification0.5

    \[\leadsto \mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{expm1}\left(\frac{\sqrt{\frac{1}{\log 10}} \cdot \tan^{-1}_* \frac{im}{re}}{\sqrt{\log 10}}\right)\right)\right)\right)\]

Reproduce

herbie shell --seed 2019179 +o rules:numerics
(FPCore (re im)
  :name "math.log10 on complex, imaginary part"
  (/ (atan2 im re) (log 10.0)))