Average Error: 30.7 → 0.4
Time: 1.0m
Precision: 64
Internal Precision: 128
\[\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(\sqrt{re^2 + im^2}^*\right) \cdot \log_* (1 + (e^{\frac{1}{\log base}} - 1)^*)\]

Error

Bits error versus re

Bits error versus im

Bits error versus base

Derivation

  1. Initial program 30.7

    \[\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. Simplified0.3

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

    \[\leadsto \color{blue}{\log \left(\sqrt{re^2 + im^2}^*\right) \cdot \frac{1}{\log base}}\]
  5. Using strategy rm
  6. Applied log1p-expm1-u0.4

    \[\leadsto \log \left(\sqrt{re^2 + im^2}^*\right) \cdot \color{blue}{\log_* (1 + (e^{\frac{1}{\log base}} - 1)^*)}\]
  7. Final simplification0.4

    \[\leadsto \log \left(\sqrt{re^2 + im^2}^*\right) \cdot \log_* (1 + (e^{\frac{1}{\log base}} - 1)^*)\]

Reproduce

herbie shell --seed 2019072 +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))))