Average Error: 31.8 → 0.3
Time: 7.7s
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.7
Cost78464
\[\frac{\sqrt[3]{\frac{1}{\log base}} \cdot \sqrt[3]{\frac{1}{\log base}}}{\sqrt[3]{\frac{1}{\tan^{-1}_* \frac{im}{re}}} \cdot \sqrt[3]{\frac{1}{\tan^{-1}_* \frac{im}{re}}}} \cdot \frac{\sqrt[3]{\frac{1}{\log base}}}{\sqrt[3]{\frac{1}{\tan^{-1}_* \frac{im}{re}}}}\]
Alternative 2
Error1.8
Cost78336
\[\frac{\frac{1}{\sqrt[3]{\log base} \cdot \sqrt[3]{\log base}}}{\sqrt[3]{\frac{1}{\tan^{-1}_* \frac{im}{re}}} \cdot \sqrt[3]{\frac{1}{\tan^{-1}_* \frac{im}{re}}}} \cdot \frac{\frac{1}{\sqrt[3]{\log base}}}{\sqrt[3]{\frac{1}{\tan^{-1}_* \frac{im}{re}}}}\]
Alternative 3
Error1.4
Cost78080
\[\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\sqrt[3]{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}} \cdot \sqrt[3]{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}}} \cdot \frac{\sqrt[3]{1}}{\sqrt[3]{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}}}\]
Alternative 4
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 5
Error32.7
Cost64768
\[\frac{\sqrt[3]{\tan^{-1}_* \frac{im}{re}} \cdot \sqrt[3]{\tan^{-1}_* \frac{im}{re}}}{\sqrt{\log base}} \cdot \frac{\sqrt[3]{\tan^{-1}_* \frac{im}{re}}}{\sqrt{\log base}}\]
Alternative 6
Error31.0
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 7
Error1.4
Cost58752
\[\frac{1}{\sqrt[3]{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}} \cdot \sqrt[3]{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}}} \cdot \frac{1}{\sqrt[3]{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}}}\]
Alternative 8
Error1.4
Cost58624
\[\frac{1}{\sqrt[3]{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}} \cdot \left(\sqrt[3]{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}} \cdot \sqrt[3]{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}}\right)}\]
Alternative 9
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 10
Error32.5
Cost52288
\[\frac{\sqrt[3]{1} \cdot \sqrt[3]{1}}{\sqrt{\frac{1}{\tan^{-1}_* \frac{im}{re}}}} \cdot \frac{\frac{\sqrt[3]{1}}{\log base}}{\sqrt{\frac{1}{\tan^{-1}_* \frac{im}{re}}}}\]
Alternative 11
Error1.6
Cost45824
\[\frac{\sqrt[3]{\frac{1}{\log base}} \cdot \left(\sqrt[3]{\frac{1}{\log base}} \cdot \sqrt[3]{\frac{1}{\log base}}\right)}{\frac{1}{\tan^{-1}_* \frac{im}{re}}}\]
Alternative 12
Error1.4
Cost45696
\[\tan^{-1}_* \frac{im}{re} \cdot \left(\sqrt[3]{\frac{1}{\log base}} \cdot \left(\sqrt[3]{\frac{1}{\log base}} \cdot \sqrt[3]{\frac{1}{\log base}}\right)\right)\]
Alternative 13
Error1.4
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 14
Error1.2
Cost45440
\[\frac{1}{\sqrt[3]{\log base} \cdot \sqrt[3]{\log base}} \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\sqrt[3]{\log base}}\]
Alternative 15
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 16
Error1.2
Cost45312
\[\frac{\frac{\tan^{-1}_* \frac{im}{re}}{\sqrt[3]{\log base} \cdot \sqrt[3]{\log base}}}{\sqrt[3]{\log base}}\]
Alternative 17
Error31.8
Cost39552
\[\frac{\log base \cdot \tan^{-1}_* \frac{im}{re} + \log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot 0}{\log base \cdot \log base}\]
Alternative 18
Error32.9
Cost39104
\[\frac{\frac{1}{\sqrt{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}}}}{\sqrt{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}}}\]
Alternative 19
Error32.9
Cost39104
\[\frac{1}{\sqrt{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}} \cdot \sqrt{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}}}\]
Alternative 20
Error31.0
Cost38976
\[\sqrt{\frac{\tan^{-1}_* \frac{im}{re}}{\log base}} \cdot \sqrt{\frac{\tan^{-1}_* \frac{im}{re}}{\log base}}\]
Alternative 21
Error32.5
Cost32960
\[\frac{1}{\sqrt{\frac{1}{\tan^{-1}_* \frac{im}{re}}}} \cdot \frac{\frac{1}{\log base}}{\sqrt{\frac{1}{\tan^{-1}_* \frac{im}{re}}}}\]
Alternative 22
Error32.4
Cost32832
\[\frac{\frac{\frac{1}{\log base}}{\sqrt{\frac{1}{\tan^{-1}_* \frac{im}{re}}}}}{\sqrt{\frac{1}{\tan^{-1}_* \frac{im}{re}}}}\]
Alternative 23
Error32.1
Cost32640
\[\sqrt{\frac{1}{\log base}} \cdot \left(\tan^{-1}_* \frac{im}{re} \cdot \sqrt{\frac{1}{\log base}}\right)\]
Alternative 24
Error32.2
Cost32512
\[\frac{\frac{1}{\sqrt{\log base}}}{\frac{\sqrt{\log base}}{\tan^{-1}_* \frac{im}{re}}}\]
Alternative 25
Error32.1
Cost32512
\[\frac{1}{\sqrt{\log base}} \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\sqrt{\log base}}\]
Alternative 26
Error32.2
Cost32512
\[\frac{1}{\frac{\sqrt{\log base}}{\frac{\tan^{-1}_* \frac{im}{re}}{\sqrt{\log base}}}}\]
Alternative 27
Error30.8
Cost32448
\[\sqrt{\tan^{-1}_* \frac{im}{re}} \cdot \frac{\sqrt{\tan^{-1}_* \frac{im}{re}}}{\log base}\]
Alternative 28
Error32.1
Cost32384
\[\frac{\frac{\tan^{-1}_* \frac{im}{re}}{\sqrt{\log base}}}{\sqrt{\log base}}\]
Alternative 29
Error7.6
Cost26176
\[\frac{\frac{1}{\log base}}{\sqrt[3]{{\left(\frac{1}{\tan^{-1}_* \frac{im}{re}}\right)}^{3}}}\]
Alternative 30
Error0.7
Cost26048
\[\tan^{-1}_* \frac{im}{re} \cdot \sqrt[3]{{\left(\frac{1}{\log base}\right)}^{3}}\]
Alternative 31
Error7.7
Cost26048
\[\frac{1}{\sqrt[3]{{\left(\frac{\log base}{\tan^{-1}_* \frac{im}{re}}\right)}^{3}}}\]
Alternative 32
Error32.4
Cost25920
\[\tan^{-1}_* \frac{im}{re} \cdot e^{-\log \log base}\]
Alternative 33
Error7.6
Cost25920
\[\sqrt[3]{{\left(\frac{\tan^{-1}_* \frac{im}{re}}{\log base}\right)}^{3}}\]
Alternative 34
Error14.7
Cost25856
\[\log \left(e^{\frac{\tan^{-1}_* \frac{im}{re}}{\log base}}\right)\]
Alternative 35
Error31.6
Cost25856
\[e^{\log \left(\frac{\tan^{-1}_* \frac{im}{re}}{\log base}\right)}\]
Alternative 36
Error11.8
Cost19648
\[\frac{1}{\log \left({base}^{\left(\frac{1}{\tan^{-1}_* \frac{im}{re}}\right)}\right)}\]
Alternative 37
Error0.5
Cost13312
\[\frac{\frac{1}{\log base}}{\frac{1}{\tan^{-1}_* \frac{im}{re}}}\]
Alternative 38
Error0.6
Cost13312
\[\frac{1}{\log base \cdot \frac{1}{\tan^{-1}_* \frac{im}{re}}}\]
Alternative 39
Error0.5
Cost13312
\[\frac{1}{\frac{1}{\frac{\tan^{-1}_* \frac{im}{re}}{\log base}}}\]
Alternative 40
Error0.4
Cost13184
\[\frac{1}{\log base} \cdot \tan^{-1}_* \frac{im}{re}\]
Alternative 41
Error0.5
Cost13184
\[\frac{1}{\frac{\log base}{\tan^{-1}_* \frac{im}{re}}}\]
Alternative 42
Error59.6
Cost64
\[1\]
Alternative 43
Error58.0
Cost64
\[0\]
Alternative 44
Error59.5
Cost64
\[-1\]

Error

Derivation

  1. Initial program 31.8

    \[\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 2021042 
(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))))