Average Error: 0.8 → 0.7
Time: 11.9s
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 r541583 = im;
        double r541584 = re;
        double r541585 = atan2(r541583, r541584);
        double r541586 = 10.0;
        double r541587 = log(r541586);
        double r541588 = r541585 / r541587;
        return r541588;
}

double f(double re, double im) {
        double r541589 = im;
        double r541590 = re;
        double r541591 = atan2(r541589, r541590);
        double r541592 = 10.0;
        double r541593 = log(r541592);
        double r541594 = r541591 / r541593;
        double r541595 = expm1(r541594);
        double r541596 = log1p(r541595);
        return r541596;
}

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)))