Average Error: 0.8 → 0.7
Time: 14.9s
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 r30083 = im;
        double r30084 = re;
        double r30085 = atan2(r30083, r30084);
        double r30086 = 10.0;
        double r30087 = log(r30086);
        double r30088 = r30085 / r30087;
        return r30088;
}

double f(double re, double im) {
        double r30089 = 1.0;
        double r30090 = 10.0;
        double r30091 = log(r30090);
        double r30092 = sqrt(r30091);
        double r30093 = r30089 / r30092;
        double r30094 = im;
        double r30095 = re;
        double r30096 = atan2(r30094, r30095);
        double r30097 = r30089 / r30091;
        double r30098 = sqrt(r30097);
        double r30099 = r30096 * r30098;
        double r30100 = r30093 * r30099;
        double r30101 = expm1(r30100);
        double r30102 = log1p(r30101);
        return r30102;
}

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 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 2019350 +o rules:numerics
(FPCore (re im)
  :name "math.log10 on complex, imaginary part"
  :precision binary64
  (/ (atan2 im re) (log 10)))