Average Error: 30.4 → 0.7
Time: 16.4s
Precision: 64
Internal Precision: 384
\[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
\[\log \left(e^{\frac{\log \left(\sqrt{re^2 + im^2}^*\right)}{\log base}}\right)\]

Error

Bits error versus re

Bits error versus im

Bits error versus base

Derivation

  1. Initial program 30.4

    \[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right) \cdot \log base + \tan^{-1}_* \frac{im}{re} \cdot 0}{\log base \cdot \log base + 0 \cdot 0}\]
  2. Applied simplify0.4

    \[\leadsto \color{blue}{\frac{\log \left(\sqrt{re^2 + im^2}^*\right)}{\log base}}\]
  3. Using strategy rm
  4. Applied add-log-exp0.7

    \[\leadsto \color{blue}{\log \left(e^{\frac{\log \left(\sqrt{re^2 + im^2}^*\right)}{\log base}}\right)}\]

Runtime

Time bar (total: 16.4s)Debug logProfile

herbie shell --seed '#(1064173506 2580572819 2847706409 4129882574 1125180799 1845288547)' +o rules:numerics
(FPCore (re im base)
  :name "math.log/2 on complex, real part"
  (/ (+ (* (log (sqrt (+ (* re re) (* im im)))) (log base)) (* (atan2 im re) 0)) (+ (* (log base) (log base)) (* 0 0))))