Average Error: 30.9 → 0.3
Time: 10.3s
Precision: binary64
\[\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 \left(\frac{1}{base}\right)}\]
\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 \left(\frac{1}{base}\right)}
(FPCore (re im base)
 :precision binary64
 (/
  (- (* (atan2 im re) (log base)) (* (log (sqrt (+ (* re re) (* im im)))) 0.0))
  (+ (* (log base) (log base)) (* 0.0 0.0))))
(FPCore (re im base)
 :precision binary64
 (- (/ (atan2 im re) (log (/ 1.0 base)))))
double code(double re, double im, double base) {
	return ((atan2(im, re) * log(base)) - (log(sqrt((re * re) + (im * im))) * 0.0)) / ((log(base) * log(base)) + (0.0 * 0.0));
}
double code(double re, double im, double base) {
	return -(atan2(im, re) / log(1.0 / base));
}

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 30.9

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

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

    \[\leadsto \frac{\tan^{-1}_* \frac{im}{re}}{\color{blue}{1 \cdot \log base}}\]
  6. Applied add-cube-cbrt_binary64_4541.7

    \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{\tan^{-1}_* \frac{im}{re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{im}{re}}\right) \cdot \sqrt[3]{\tan^{-1}_* \frac{im}{re}}}}{1 \cdot \log base}\]
  7. Applied times-frac_binary64_4251.7

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

    \[\leadsto \color{blue}{\left(\sqrt[3]{\tan^{-1}_* \frac{im}{re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{im}{re}}\right)} \cdot \frac{\sqrt[3]{\tan^{-1}_* \frac{im}{re}}}{\log base}\]
  9. Using strategy rm
  10. Applied add-cbrt-cube_binary64_4555.8

    \[\leadsto \color{blue}{\sqrt[3]{\left(\left(\sqrt[3]{\tan^{-1}_* \frac{im}{re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{im}{re}}\right) \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{im}{re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{im}{re}}\right)\right) \cdot \left(\sqrt[3]{\tan^{-1}_* \frac{im}{re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{im}{re}}\right)}} \cdot \frac{\sqrt[3]{\tan^{-1}_* \frac{im}{re}}}{\log base}\]
  11. Simplified5.1

    \[\leadsto \sqrt[3]{\color{blue}{{\tan^{-1}_* \frac{im}{re}}^{2}}} \cdot \frac{\sqrt[3]{\tan^{-1}_* \frac{im}{re}}}{\log base}\]
  12. Taylor expanded around inf 0.3

    \[\leadsto \color{blue}{-1 \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\log \left(\frac{1}{base}\right)}}\]
  13. Final simplification0.3

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

Reproduce

herbie shell --seed 2021098 
(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))))