Average Error: 0.8 → 0.7
Time: 21.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 r864751 = im;
        double r864752 = re;
        double r864753 = atan2(r864751, r864752);
        double r864754 = 10.0;
        double r864755 = log(r864754);
        double r864756 = r864753 / r864755;
        return r864756;
}

double f(double re, double im) {
        double r864757 = im;
        double r864758 = re;
        double r864759 = atan2(r864757, r864758);
        double r864760 = 10.0;
        double r864761 = log(r864760);
        double r864762 = r864759 / r864761;
        double r864763 = expm1(r864762);
        double r864764 = log1p(r864763);
        return r864764;
}

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