Average Error: 0.8 → 0.8
Time: 3.5s
Precision: 64
\[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}\]
\[\frac{1}{\sqrt{\log 10}} \cdot \left(\left(\tan^{-1}_* \frac{im}{re} \cdot \sqrt{\frac{1}{\sqrt{\log 10}}}\right) \cdot \sqrt{\frac{\sqrt[3]{1}}{\sqrt{\log 10}}}\right)\]
\frac{\tan^{-1}_* \frac{im}{re}}{\log 10}
\frac{1}{\sqrt{\log 10}} \cdot \left(\left(\tan^{-1}_* \frac{im}{re} \cdot \sqrt{\frac{1}{\sqrt{\log 10}}}\right) \cdot \sqrt{\frac{\sqrt[3]{1}}{\sqrt{\log 10}}}\right)
double code(double re, double im) {
	return (atan2(im, re) / log(10.0));
}
double code(double re, double im) {
	return ((1.0 / sqrt(log(10.0))) * ((atan2(im, re) * sqrt((1.0 / sqrt(log(10.0))))) * sqrt((cbrt(1.0) / sqrt(log(10.0))))));
}

Error

Bits error versus re

Bits error versus im

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.8

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

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

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

    \[\leadsto \color{blue}{\frac{1}{\sqrt{\log 10}} \cdot \frac{\tan^{-1}_* \frac{im}{re}}{\sqrt{\log 10}}}\]
  6. Taylor expanded around 0 0.8

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

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

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

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

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

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

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

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

Reproduce

herbie shell --seed 2020053 +o rules:numerics
(FPCore (re im)
  :name "math.log10 on complex, imaginary part"
  :precision binary64
  (/ (atan2 im re) (log 10)))