Average Error: 0.8 → 0.7
Time: 28.4s
Precision: 64
\[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\]
\[\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\right)\right)\]
\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}
\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\right)\right)
double f(double re, double im) {
        double r1382563 = im;
        double r1382564 = re;
        double r1382565 = atan2(r1382563, r1382564);
        double r1382566 = 10.0;
        double r1382567 = log(r1382566);
        double r1382568 = r1382565 / r1382567;
        return r1382568;
}

double f(double re, double im) {
        double r1382569 = im;
        double r1382570 = re;
        double r1382571 = atan2(r1382569, r1382570);
        double r1382572 = 10.0;
        double r1382573 = log(r1382572);
        double r1382574 = r1382571 / r1382573;
        double r1382575 = expm1(r1382574);
        double r1382576 = log1p(r1382575);
        return r1382576;
}

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. Using strategy rm
  7. Applied div-inv0.8

    \[\leadsto \frac{1}{\sqrt{\log 10}} \cdot \color{blue}{\left(\tan^{-1}_* \frac{im}{re} \cdot \frac{1}{\sqrt{\log 10}}\right)}\]
  8. Applied associate-*r*0.8

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

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

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

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

Reproduce

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