math.log10 on complex, imaginary part

Percentage Accurate: 98.7% → 99.8%
Time: 2.4s
Alternatives: 2
Speedup: TODO×

Specification

?
\[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10} \]

Your Program's Arguments

Results

Enter valid numbers for all inputs

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 2 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Alternative 1?

\[\frac{-\tan^{-1}_* \frac{im}{re}}{\log 0.1} \]
Derivation
  1. Initial program 98.6%

    \[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10} \]
  2. Step-by-step derivation
    1. frac-2neg98.6%

      \[\leadsto \color{blue}{\frac{-\tan^{-1}_* \frac{im}{re}}{-\log 10}} \]
    2. div-inv98.5%

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

      \[\leadsto \left(-\tan^{-1}_* \frac{im}{re}\right) \cdot \frac{1}{\color{blue}{\log \left(\frac{1}{10}\right)}} \]
    4. metadata-eval99.8%

      \[\leadsto \left(-\tan^{-1}_* \frac{im}{re}\right) \cdot \frac{1}{\log \color{blue}{0.1}} \]
  3. Applied egg-rr99.8%

    \[\leadsto \color{blue}{\left(-\tan^{-1}_* \frac{im}{re}\right) \cdot \frac{1}{\log 0.1}} \]
  4. Step-by-step derivation
    1. associate-*r/99.8%

      \[\leadsto \color{blue}{\frac{\left(-\tan^{-1}_* \frac{im}{re}\right) \cdot 1}{\log 0.1}} \]
    2. *-rgt-identity99.8%

      \[\leadsto \frac{\color{blue}{-\tan^{-1}_* \frac{im}{re}}}{\log 0.1} \]
  5. Simplified99.8%

    \[\leadsto \color{blue}{\frac{-\tan^{-1}_* \frac{im}{re}}{\log 0.1}} \]
  6. Final simplification99.8%

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

Alternative 2?

\[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10} \]
Derivation
  1. Initial program 98.6%

    \[\frac{\tan^{-1}_* \frac{im}{re}}{\log 10} \]
  2. Final simplification98.6%

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

Reproduce

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