Average Error: 31.4 → 0.3
Time: 1.5m
Precision: 64
\[\frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
\[\frac{\tan^{-1}_* \frac{im}{re}}{\log base}\]
\frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot 0}{\log base \cdot \log base + 0 \cdot 0}
\frac{\tan^{-1}_* \frac{im}{re}}{\log base}
double f(double re, double im, double base) {
        double r1597499 = im;
        double r1597500 = re;
        double r1597501 = atan2(r1597499, r1597500);
        double r1597502 = base;
        double r1597503 = log(r1597502);
        double r1597504 = r1597501 * r1597503;
        double r1597505 = r1597500 * r1597500;
        double r1597506 = r1597499 * r1597499;
        double r1597507 = r1597505 + r1597506;
        double r1597508 = sqrt(r1597507);
        double r1597509 = log(r1597508);
        double r1597510 = 0.0;
        double r1597511 = r1597509 * r1597510;
        double r1597512 = r1597504 - r1597511;
        double r1597513 = r1597503 * r1597503;
        double r1597514 = r1597510 * r1597510;
        double r1597515 = r1597513 + r1597514;
        double r1597516 = r1597512 / r1597515;
        return r1597516;
}

double f(double re, double im, double base) {
        double r1597517 = im;
        double r1597518 = re;
        double r1597519 = atan2(r1597517, r1597518);
        double r1597520 = base;
        double r1597521 = log(r1597520);
        double r1597522 = r1597519 / r1597521;
        return r1597522;
}

Error

Bits error versus re

Bits error versus im

Bits error versus base

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 31.4

    \[\frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
  2. Simplified0.3

    \[\leadsto \color{blue}{\frac{\tan^{-1}_* \frac{im}{re}}{\log base}}\]
  3. Using strategy rm
  4. Applied *-un-lft-identity0.3

    \[\leadsto \frac{\color{blue}{1 \cdot \tan^{-1}_* \frac{im}{re}}}{\log base}\]
  5. Applied associate-/l*0.6

    \[\leadsto \color{blue}{\frac{1}{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}}}\]
  6. Using strategy rm
  7. Applied div-inv0.6

    \[\leadsto \frac{1}{\color{blue}{\log base \cdot \frac{1}{\tan^{-1}_* \frac{im}{re}}}}\]
  8. Taylor expanded around 0 0.3

    \[\leadsto \color{blue}{\frac{\tan^{-1}_* \frac{im}{re}}{\log base}}\]
  9. Final simplification0.3

    \[\leadsto \frac{\tan^{-1}_* \frac{im}{re}}{\log base}\]

Reproduce

herbie shell --seed 2019151 
(FPCore (re im base)
  :name "math.log/2 on complex, imaginary part"
  (/ (- (* (atan2 im re) (log base)) (* (log (sqrt (+ (* re re) (* im im)))) 0)) (+ (* (log base) (log base)) (* 0 0))))