Average Error: 0.9 → 0.1
Time: 4.2s
Precision: binary64
Cost: 45504
\[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\]
\[\sqrt{\frac{1}{\sqrt{\log 10}}} \cdot \left(\tan^{-1}_* \frac{im}{re} \cdot {\left(\frac{1}{\sqrt{\log 10}}\right)}^{1.5}\right)\]
\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}
\sqrt{\frac{1}{\sqrt{\log 10}}} \cdot \left(\tan^{-1}_* \frac{im}{re} \cdot {\left(\frac{1}{\sqrt{\log 10}}\right)}^{1.5}\right)
(FPCore (re im) :precision binary64 (/ (atan2 im re) (log 10.0)))
(FPCore (re im)
 :precision binary64
 (*
  (sqrt (/ 1.0 (sqrt (log 10.0))))
  (* (atan2 im re) (pow (/ 1.0 (sqrt (log 10.0))) 1.5))))
double code(double re, double im) {
	return atan2(im, re) / log(10.0);
}
double code(double re, double im) {
	return sqrt(1.0 / sqrt(log(10.0))) * (atan2(im, re) * pow((1.0 / sqrt(log(10.0))), 1.5));
}

Error

Bits error versus re

Bits error versus im

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Alternatives

Alternative 1
Error0.8
Cost32640
\[\frac{1}{\sqrt{\log 10}} \cdot \left(\frac{1}{\sqrt{\log 10}} \cdot \tan^{-1}_* \frac{im}{re}\right)\]
Alternative 2
Error0.8
Cost32512
\[\frac{1}{\sqrt{\log 10}} \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\sqrt{\log 10}}\]
Alternative 3
Error0.9
Cost13056
\[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\]
Alternative 4
Error52.5
Cost706
\[\begin{array}{l} \mathbf{if}\;im \leq -8.592122952796341 \cdot 10^{-247}:\\ \;\;\;\;-1\\ \mathbf{elif}\;im \leq 7.689520380570989 \cdot 10^{-140}:\\ \;\;\;\;0\\ \mathbf{else}:\\ \;\;\;\;1\\ \end{array}\]
Alternative 5
Error54.8
Cost385
\[\begin{array}{l} \mathbf{if}\;re \leq 1.428639632053752 \cdot 10^{+82}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;0\\ \end{array}\]
Alternative 6
Error58.2
Cost64
\[1\]

Error

Derivation

  1. Initial program 0.9

    \[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\]
  2. Using strategy rm
  3. Applied add-sqr-sqrt_binary64_4410.9

    \[\leadsto \frac{\tan^{-1}_* \frac{im}{re}}{\color{blue}{\sqrt{\log 10} \cdot \sqrt{\log 10}}}\]
  4. Applied *-un-lft-identity_binary64_4190.9

    \[\leadsto \frac{\color{blue}{1 \cdot \tan^{-1}_* \frac{im}{re}}}{\sqrt{\log 10} \cdot \sqrt{\log 10}}\]
  5. Applied times-frac_binary64_4250.8

    \[\leadsto \color{blue}{\frac{1}{\sqrt{\log 10}} \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\sqrt{\log 10}}}\]
  6. Using strategy rm
  7. Applied div-inv_binary64_4160.8

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

    \[\leadsto \color{blue}{\left(\sqrt{\frac{1}{\sqrt{\log 10}}} \cdot \sqrt{\frac{1}{\sqrt{\log 10}}}\right)} \cdot \left(\tan^{-1}_* \frac{im}{re} \cdot \frac{1}{\sqrt{\log 10}}\right)\]
  10. Applied associate-*l*_binary64_3600.8

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

    \[\leadsto \sqrt{\frac{1}{\sqrt{\log 10}}} \cdot \color{blue}{\left(\tan^{-1}_* \frac{im}{re} \cdot {\left(\frac{1}{\sqrt{\log 10}}\right)}^{1.5}\right)}\]
  12. Simplified0.1

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

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

Reproduce

herbie shell --seed 2021044 
(FPCore (re im)
  :name "math.log10 on complex, imaginary part"
  :precision binary64
  (/ (atan2 im re) (log 10.0)))