Average Error: 31.6 → 0.3
Time: 17.1s
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 r3054234 = im;
        double r3054235 = re;
        double r3054236 = atan2(r3054234, r3054235);
        double r3054237 = base;
        double r3054238 = log(r3054237);
        double r3054239 = r3054236 * r3054238;
        double r3054240 = r3054235 * r3054235;
        double r3054241 = r3054234 * r3054234;
        double r3054242 = r3054240 + r3054241;
        double r3054243 = sqrt(r3054242);
        double r3054244 = log(r3054243);
        double r3054245 = 0.0;
        double r3054246 = r3054244 * r3054245;
        double r3054247 = r3054239 - r3054246;
        double r3054248 = r3054238 * r3054238;
        double r3054249 = r3054245 * r3054245;
        double r3054250 = r3054248 + r3054249;
        double r3054251 = r3054247 / r3054250;
        return r3054251;
}

double f(double re, double im, double base) {
        double r3054252 = im;
        double r3054253 = re;
        double r3054254 = atan2(r3054252, r3054253);
        double r3054255 = base;
        double r3054256 = log(r3054255);
        double r3054257 = r3054254 / r3054256;
        return r3054257;
}

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.6

    \[\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 pow10.3

    \[\leadsto \frac{\tan^{-1}_* \frac{im}{re}}{\log \color{blue}{\left({base}^{1}\right)}}\]
  5. Applied log-pow0.3

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

    \[\leadsto \frac{\color{blue}{1 \cdot \tan^{-1}_* \frac{im}{re}}}{1 \cdot \log base}\]
  7. Applied times-frac0.3

    \[\leadsto \color{blue}{\frac{1}{1} \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\log base}}\]
  8. Simplified0.3

    \[\leadsto \color{blue}{1} \cdot \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 2019165 +o rules:numerics
(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))))