Average Error: 31.0 → 0.3
Time: 9.4s
Precision: binary64
Cost: 13056
\[\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}
(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 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(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

Alternatives

Alternative 1
Error1.8
Cost77696
\[\frac{\sqrt[3]{\tan^{-1}_* \frac{im}{re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{im}{re}}}{\sqrt[3]{\log base} \cdot \sqrt[3]{\log base}} \cdot \frac{\sqrt[3]{\tan^{-1}_* \frac{im}{re}}}{\sqrt[3]{\log base}}\]
Alternative 2
Error31.3
Cost64704
\[\frac{\sqrt{\tan^{-1}_* \frac{im}{re}}}{\sqrt[3]{\log base} \cdot \sqrt[3]{\log base}} \cdot \frac{\sqrt{\tan^{-1}_* \frac{im}{re}}}{\sqrt[3]{\log base}}\]
Alternative 3
Error33.2
Cost58560
\[\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\sqrt{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}}} \cdot \frac{\sqrt[3]{1}}{\sqrt{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}}}\]
Alternative 4
Error1.5
Cost58496
\[\sqrt[3]{\frac{\tan^{-1}_* \frac{im}{re}}{\log base}} \cdot \left(\sqrt[3]{\frac{\tan^{-1}_* \frac{im}{re}}{\log base}} \cdot \sqrt[3]{\frac{\tan^{-1}_* \frac{im}{re}}{\log base}}\right)\]
Alternative 5
Error32.0
Cost51968
\[\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\sqrt{\log base}} \cdot \frac{\sqrt[3]{1}}{\frac{\sqrt{\log base}}{\tan^{-1}_* \frac{im}{re}}}\]
Alternative 6
Error47.7
Cost51776
\[\frac{\sqrt{\tan^{-1}_* \frac{im}{re}}}{\sqrt{\log base}} \cdot \frac{\sqrt{\tan^{-1}_* \frac{im}{re}}}{\sqrt{\log base}}\]
Alternative 7
Error1.5
Cost45696
\[\sqrt[3]{\frac{1}{\log base}} \cdot \left(\tan^{-1}_* \frac{im}{re} \cdot \left(\sqrt[3]{\frac{1}{\log base}} \cdot \sqrt[3]{\frac{1}{\log base}}\right)\right)\]
Alternative 8
Error1.2
Cost45440
\[\frac{\tan^{-1}_* \frac{im}{re}}{\sqrt[3]{\log base}} \cdot \frac{1}{\sqrt[3]{\log base} \cdot \sqrt[3]{\log base}}\]
Alternative 9
Error1.7
Cost45440
\[\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}\]
Alternative 10
Error1.2
Cost45312
\[\frac{\frac{\tan^{-1}_* \frac{im}{re}}{\sqrt[3]{\log base} \cdot \sqrt[3]{\log base}}}{\sqrt[3]{\log base}}\]
Alternative 11
Error31.0
Cost39552
\[\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}\]
Alternative 12
Error33.2
Cost39232
\[\frac{1}{\sqrt{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}}} \cdot \frac{1}{\sqrt{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}}}\]
Alternative 13
Error33.1
Cost39104
\[\frac{\frac{1}{\sqrt{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}}}}{\sqrt{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}}}\]
Alternative 14
Error0.9
Cost39040
\[\frac{\tan^{-1}_* \frac{im}{re}}{\sqrt[3]{\log base}} \cdot \frac{1}{{\left({\log base}^{2}\right)}^{0.3333333333333333}}\]
Alternative 15
Error0.8
Cost38976
\[\frac{\tan^{-1}_* \frac{im}{re}}{\sqrt[3]{\log base}} \cdot \frac{1}{\sqrt[3]{{\log base}^{2}}}\]
Alternative 16
Error31.3
Cost38976
\[\sqrt{\frac{\tan^{-1}_* \frac{im}{re}}{\log base}} \cdot \sqrt{\frac{\tan^{-1}_* \frac{im}{re}}{\log base}}\]
Alternative 17
Error31.9
Cost32640
\[\sqrt{\frac{1}{\log base}} \cdot \left(\tan^{-1}_* \frac{im}{re} \cdot \sqrt{\frac{1}{\log base}}\right)\]
Alternative 18
Error32.1
Cost32576
\[\frac{1}{{\log base}^{0.6666666666666666}} \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\sqrt[3]{\log base}}\]
Alternative 19
Error32.0
Cost32512
\[\frac{1}{\sqrt{\log base} \cdot \frac{\sqrt{\log base}}{\tan^{-1}_* \frac{im}{re}}}\]
Alternative 20
Error32.0
Cost32512
\[\frac{\frac{1}{\sqrt{\log base}}}{\frac{\sqrt{\log base}}{\tan^{-1}_* \frac{im}{re}}}\]
Alternative 21
Error31.9
Cost32512
\[\frac{1}{\sqrt{\log base}} \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\sqrt{\log base}}\]
Alternative 22
Error31.1
Cost32448
\[\frac{\sqrt{\tan^{-1}_* \frac{im}{re}}}{\frac{\log base}{\sqrt{\tan^{-1}_* \frac{im}{re}}}}\]
Alternative 23
Error31.1
Cost32448
\[\sqrt{\tan^{-1}_* \frac{im}{re}} \cdot \frac{\sqrt{\tan^{-1}_* \frac{im}{re}}}{\log base}\]
Alternative 24
Error31.9
Cost32384
\[\frac{\frac{\tan^{-1}_* \frac{im}{re}}{\sqrt{\log base}}}{\sqrt{\log base}}\]
Alternative 25
Error0.8
Cost26048
\[\tan^{-1}_* \frac{im}{re} \cdot \sqrt[3]{{\left(\frac{1}{\log base}\right)}^{3}}\]
Alternative 26
Error7.7
Cost26048
\[\frac{1}{\sqrt[3]{{\left(\frac{\log base}{\tan^{-1}_* \frac{im}{re}}\right)}^{3}}}\]
Alternative 27
Error32.2
Cost25920
\[\tan^{-1}_* \frac{im}{re} \cdot e^{-\log \log base}\]
Alternative 28
Error7.7
Cost25920
\[\sqrt[3]{{\left(\frac{\tan^{-1}_* \frac{im}{re}}{\log base}\right)}^{3}}\]
Alternative 29
Error15.0
Cost25856
\[\log \left(e^{\frac{\tan^{-1}_* \frac{im}{re}}{\log base}}\right)\]
Alternative 30
Error31.9
Cost25856
\[e^{\log \left(\frac{\tan^{-1}_* \frac{im}{re}}{\log base}\right)}\]
Alternative 31
Error12.2
Cost19648
\[\frac{1}{\log \left({base}^{\left(\frac{1}{\tan^{-1}_* \frac{im}{re}}\right)}\right)}\]
Alternative 32
Error0.6
Cost13312
\[\frac{1}{\log base \cdot \frac{1}{\tan^{-1}_* \frac{im}{re}}}\]
Alternative 33
Error0.6
Cost13312
\[\frac{\frac{1}{\log base}}{\frac{1}{\tan^{-1}_* \frac{im}{re}}}\]
Alternative 34
Error0.5
Cost13184
\[\frac{1}{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}}\]
Alternative 35
Error0.4
Cost13184
\[\tan^{-1}_* \frac{im}{re} \cdot \frac{1}{\log base}\]
Alternative 36
Error59.7
Cost64
\[1\]
Alternative 37
Error58.0
Cost64
\[0\]
Alternative 38
Error59.5
Cost64
\[-1\]

Error

Derivation

  1. Initial program 31.0

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

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

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

Reproduce

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