Average Error: 31.9 → 0.5
Time: 5.0s
Precision: 64
\[\frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}\]
\[\frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(1 \cdot \mathsf{hypot}\left(re, im\right)\right) \cdot 0.0}{\left(\log base \cdot \left(2 \cdot \log \left(\sqrt[3]{base}\right)\right) + \log base \cdot \log \left(\sqrt[3]{base}\right)\right) + 0.0 \cdot 0.0}\]
\frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}
\frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(1 \cdot \mathsf{hypot}\left(re, im\right)\right) \cdot 0.0}{\left(\log base \cdot \left(2 \cdot \log \left(\sqrt[3]{base}\right)\right) + \log base \cdot \log \left(\sqrt[3]{base}\right)\right) + 0.0 \cdot 0.0}
double f(double re, double im, double base) {
        double r83212 = im;
        double r83213 = re;
        double r83214 = atan2(r83212, r83213);
        double r83215 = base;
        double r83216 = log(r83215);
        double r83217 = r83214 * r83216;
        double r83218 = r83213 * r83213;
        double r83219 = r83212 * r83212;
        double r83220 = r83218 + r83219;
        double r83221 = sqrt(r83220);
        double r83222 = log(r83221);
        double r83223 = 0.0;
        double r83224 = r83222 * r83223;
        double r83225 = r83217 - r83224;
        double r83226 = r83216 * r83216;
        double r83227 = r83223 * r83223;
        double r83228 = r83226 + r83227;
        double r83229 = r83225 / r83228;
        return r83229;
}

double f(double re, double im, double base) {
        double r83230 = im;
        double r83231 = re;
        double r83232 = atan2(r83230, r83231);
        double r83233 = base;
        double r83234 = log(r83233);
        double r83235 = r83232 * r83234;
        double r83236 = 1.0;
        double r83237 = hypot(r83231, r83230);
        double r83238 = r83236 * r83237;
        double r83239 = log(r83238);
        double r83240 = 0.0;
        double r83241 = r83239 * r83240;
        double r83242 = r83235 - r83241;
        double r83243 = 2.0;
        double r83244 = cbrt(r83233);
        double r83245 = log(r83244);
        double r83246 = r83243 * r83245;
        double r83247 = r83234 * r83246;
        double r83248 = r83234 * r83245;
        double r83249 = r83247 + r83248;
        double r83250 = r83240 * r83240;
        double r83251 = r83249 + r83250;
        double r83252 = r83242 / r83251;
        return r83252;
}

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

    \[\frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}\]
  2. Using strategy rm
  3. Applied *-un-lft-identity31.9

    \[\leadsto \frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(\sqrt{\color{blue}{1 \cdot \left(re \cdot re + im \cdot im\right)}}\right) \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}\]
  4. Applied sqrt-prod31.9

    \[\leadsto \frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \color{blue}{\left(\sqrt{1} \cdot \sqrt{re \cdot re + im \cdot im}\right)} \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}\]
  5. Simplified31.9

    \[\leadsto \frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(\color{blue}{1} \cdot \sqrt{re \cdot re + im \cdot im}\right) \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}\]
  6. Simplified0.4

    \[\leadsto \frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(1 \cdot \color{blue}{\mathsf{hypot}\left(re, im\right)}\right) \cdot 0.0}{\log base \cdot \log base + 0.0 \cdot 0.0}\]
  7. Using strategy rm
  8. Applied add-cube-cbrt0.4

    \[\leadsto \frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(1 \cdot \mathsf{hypot}\left(re, im\right)\right) \cdot 0.0}{\log base \cdot \log \color{blue}{\left(\left(\sqrt[3]{base} \cdot \sqrt[3]{base}\right) \cdot \sqrt[3]{base}\right)} + 0.0 \cdot 0.0}\]
  9. Applied log-prod0.5

    \[\leadsto \frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(1 \cdot \mathsf{hypot}\left(re, im\right)\right) \cdot 0.0}{\log base \cdot \color{blue}{\left(\log \left(\sqrt[3]{base} \cdot \sqrt[3]{base}\right) + \log \left(\sqrt[3]{base}\right)\right)} + 0.0 \cdot 0.0}\]
  10. Applied distribute-lft-in0.5

    \[\leadsto \frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(1 \cdot \mathsf{hypot}\left(re, im\right)\right) \cdot 0.0}{\color{blue}{\left(\log base \cdot \log \left(\sqrt[3]{base} \cdot \sqrt[3]{base}\right) + \log base \cdot \log \left(\sqrt[3]{base}\right)\right)} + 0.0 \cdot 0.0}\]
  11. Simplified0.5

    \[\leadsto \frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(1 \cdot \mathsf{hypot}\left(re, im\right)\right) \cdot 0.0}{\left(\color{blue}{\log base \cdot \left(2 \cdot \log \left(\sqrt[3]{base}\right)\right)} + \log base \cdot \log \left(\sqrt[3]{base}\right)\right) + 0.0 \cdot 0.0}\]
  12. Final simplification0.5

    \[\leadsto \frac{\tan^{-1}_* \frac{im}{re} \cdot \log base - \log \left(1 \cdot \mathsf{hypot}\left(re, im\right)\right) \cdot 0.0}{\left(\log base \cdot \left(2 \cdot \log \left(\sqrt[3]{base}\right)\right) + \log base \cdot \log \left(\sqrt[3]{base}\right)\right) + 0.0 \cdot 0.0}\]

Reproduce

herbie shell --seed 2019354 +o rules:numerics
(FPCore (re im base)
  :name "math.log/2 on complex, imaginary part"
  :precision binary64
  (/ (- (* (atan2 im re) (log base)) (* (log (sqrt (+ (* re re) (* im im)))) 0.0)) (+ (* (log base) (log base)) (* 0.0 0.0))))