Average Error: 0.8 → 0.7
Time: 12.4s
Precision: 64
\[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\]
\[\mathsf{log1p}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{im}{re} \cdot \frac{\sqrt{\frac{1}{\log 10}}}{\sqrt{\log 10}}\right)\right)\]
\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}
\mathsf{log1p}\left(\mathsf{expm1}\left(\tan^{-1}_* \frac{im}{re} \cdot \frac{\sqrt{\frac{1}{\log 10}}}{\sqrt{\log 10}}\right)\right)
double f(double re, double im) {
        double r39753 = im;
        double r39754 = re;
        double r39755 = atan2(r39753, r39754);
        double r39756 = 10.0;
        double r39757 = log(r39756);
        double r39758 = r39755 / r39757;
        return r39758;
}

double f(double re, double im) {
        double r39759 = im;
        double r39760 = re;
        double r39761 = atan2(r39759, r39760);
        double r39762 = 1.0;
        double r39763 = 10.0;
        double r39764 = log(r39763);
        double r39765 = r39762 / r39764;
        double r39766 = sqrt(r39765);
        double r39767 = sqrt(r39764);
        double r39768 = r39766 / r39767;
        double r39769 = r39761 * r39768;
        double r39770 = expm1(r39769);
        double r39771 = log1p(r39770);
        return r39771;
}

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. Final simplification0.7

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

Reproduce

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