Average Error: 32.1 → 17.8
Time: 7.8s
Precision: binary64
\[\]
\[\]

Error

Bits error versus re

Bits error versus im

Bits error versus base

Derivation

  1. Split input into 3 regimes
  2. if re < -1.33764999557969208e66

    1. Initial program 46.4

      \[\]
    2. Using strategy rm
    3. Applied add-cube-cbrt46.4

      \[\leadsto \]
    4. Applied log-prod46.4

      \[\leadsto \]
    5. Applied distribute-lft-in46.4

      \[\leadsto \]
    6. Simplified46.4

      \[\leadsto \]
    7. Taylor expanded around -inf 9.9

      \[\leadsto \]
    8. Simplified9.9

      \[\leadsto \]

    if -1.33764999557969208e66 < re < 3.53919578709125943e32

    1. Initial program 22.7

      \[\]
    2. Using strategy rm
    3. Applied clear-num22.8

      \[\leadsto \]
    4. Simplified22.8

      \[\leadsto \]

    if 3.53919578709125943e32 < re

    1. Initial program 43.5

      \[\]
    2. Using strategy rm
    3. Applied clear-num43.5

      \[\leadsto \]
    4. Simplified43.5

      \[\leadsto \]
    5. Taylor expanded around inf 12.1

      \[\leadsto \]
    6. Simplified12.0

      \[\leadsto \]
  3. Recombined 3 regimes into one program.
  4. Final simplification17.8

    \[\leadsto \]

Reproduce

herbie shell --seed 2020179 
(FPCore (re im base)
  :name "math.log/2 on complex, real part"
  :precision binary64
  (/ (+ (* (log (sqrt (+ (* re re) (* im im)))) (log base)) (* (atan2 im re) 0.0)) (+ (* (log base) (log base)) (* 0.0 0.0))))