Average Error: 0.9 → 0.7
Time: 22.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 \sqrt{\frac{1}{\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 \sqrt{\frac{1}{\log 10}}\right)\right)\right)
double f(double re, double im) {
        double r44022 = im;
        double r44023 = re;
        double r44024 = atan2(r44022, r44023);
        double r44025 = 10.0;
        double r44026 = log(r44025);
        double r44027 = r44024 / r44026;
        return r44027;
}

double f(double re, double im) {
        double r44028 = 1.0;
        double r44029 = 10.0;
        double r44030 = log(r44029);
        double r44031 = sqrt(r44030);
        double r44032 = r44028 / r44031;
        double r44033 = im;
        double r44034 = re;
        double r44035 = atan2(r44033, r44034);
        double r44036 = r44028 / r44030;
        double r44037 = sqrt(r44036);
        double r44038 = r44035 * r44037;
        double r44039 = r44032 * r44038;
        double r44040 = expm1(r44039);
        double r44041 = log1p(r44040);
        return r44041;
}

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. Taylor expanded around 0 0.7

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

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

Reproduce

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