Average Error: 0.9 → 0.7
Time: 3.4s
Precision: 64
\[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\]
\[\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{1}{\sqrt{\log 10}} \cdot \left(\tan^{-1}_* \frac{im}{re} \cdot \frac{1}{\sqrt{\log 10}}\right)\right)\right)\]
\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}
\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{1}{\sqrt{\log 10}} \cdot \left(\tan^{-1}_* \frac{im}{re} \cdot \frac{1}{\sqrt{\log 10}}\right)\right)\right)
double f(double re, double im) {
        double r89726 = im;
        double r89727 = re;
        double r89728 = atan2(r89726, r89727);
        double r89729 = 10.0;
        double r89730 = log(r89729);
        double r89731 = r89728 / r89730;
        return r89731;
}

double f(double re, double im) {
        double r89732 = 1.0;
        double r89733 = 10.0;
        double r89734 = log(r89733);
        double r89735 = sqrt(r89734);
        double r89736 = r89732 / r89735;
        double r89737 = im;
        double r89738 = re;
        double r89739 = atan2(r89737, r89738);
        double r89740 = r89739 * r89736;
        double r89741 = r89736 * r89740;
        double r89742 = expm1(r89741);
        double r89743 = log1p(r89742);
        return r89743;
}

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

    \[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\]
  2. Using strategy rm
  3. Applied log1p-expm1-u0.7

    \[\leadsto \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\right)\right)}\]
  4. Using strategy rm
  5. Applied add-sqr-sqrt0.7

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

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

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

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

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

Reproduce

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