Average Error: 0.8 → 0.5
Time: 16.5s
Precision: 64
\[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\]
\[\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{expm1}\left(\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\right)\right)\right)\right)\]
\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}
\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{expm1}\left(\mathsf{expm1}\left(\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\right)\right)\right)\right)
double f(double re, double im) {
        double r850382 = im;
        double r850383 = re;
        double r850384 = atan2(r850382, r850383);
        double r850385 = 10.0;
        double r850386 = log(r850385);
        double r850387 = r850384 / r850386;
        return r850387;
}

double f(double re, double im) {
        double r850388 = im;
        double r850389 = re;
        double r850390 = atan2(r850388, r850389);
        double r850391 = 10.0;
        double r850392 = log(r850391);
        double r850393 = r850390 / r850392;
        double r850394 = expm1(r850393);
        double r850395 = expm1(r850394);
        double r850396 = log1p(r850395);
        double r850397 = log1p(r850396);
        return r850397;
}

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 log1p-expm1-u0.5

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

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

Reproduce

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