Average Error: 0.8 → 0.7
Time: 16.8s
Precision: 64
\[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\]
\[\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\tan^{-1}_* \frac{im}{re} \cdot \sqrt{\frac{1}{\log 10}}}{\sqrt{\log 10}}\right)\right)\]
\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}
\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\tan^{-1}_* \frac{im}{re} \cdot \sqrt{\frac{1}{\log 10}}}{\sqrt{\log 10}}\right)\right)
double f(double re, double im) {
        double r38091 = im;
        double r38092 = re;
        double r38093 = atan2(r38091, r38092);
        double r38094 = 10.0;
        double r38095 = log(r38094);
        double r38096 = r38093 / r38095;
        return r38096;
}

double f(double re, double im) {
        double r38097 = im;
        double r38098 = re;
        double r38099 = atan2(r38097, r38098);
        double r38100 = 1.0;
        double r38101 = 10.0;
        double r38102 = log(r38101);
        double r38103 = r38100 / r38102;
        double r38104 = sqrt(r38103);
        double r38105 = r38099 * r38104;
        double r38106 = sqrt(r38102);
        double r38107 = r38105 / r38106;
        double r38108 = expm1(r38107);
        double r38109 = log1p(r38108);
        return r38109;
}

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(\tan^{-1}_* \frac{im}{re} \cdot \sqrt{\frac{1}{\log 10}}\right)}\]
  7. Using strategy rm
  8. Applied log1p-expm1-u0.8

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

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

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

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

Reproduce

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