Average Error: 0.8 → 0.5
Time: 12.8s
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 r46543 = im;
        double r46544 = re;
        double r46545 = atan2(r46543, r46544);
        double r46546 = 10.0;
        double r46547 = log(r46546);
        double r46548 = r46545 / r46547;
        return r46548;
}

double f(double re, double im) {
        double r46549 = im;
        double r46550 = re;
        double r46551 = atan2(r46549, r46550);
        double r46552 = 10.0;
        double r46553 = log(r46552);
        double r46554 = r46551 / r46553;
        double r46555 = expm1(r46554);
        double r46556 = expm1(r46555);
        double r46557 = log1p(r46556);
        double r46558 = log1p(r46557);
        return r46558;
}

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