Average Error: 0.8 → 0.7
Time: 20.3s
Precision: 64
\[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\]
\[\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\right)\right)\]
\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}
\mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\right)\right)
double f(double re, double im) {
        double r775496 = im;
        double r775497 = re;
        double r775498 = atan2(r775496, r775497);
        double r775499 = 10.0;
        double r775500 = log(r775499);
        double r775501 = r775498 / r775500;
        return r775501;
}

double f(double re, double im) {
        double r775502 = im;
        double r775503 = re;
        double r775504 = atan2(r775502, r775503);
        double r775505 = 10.0;
        double r775506 = log(r775505);
        double r775507 = r775504 / r775506;
        double r775508 = expm1(r775507);
        double r775509 = log1p(r775508);
        return r775509;
}

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

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

Reproduce

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