Average Error: 31.3 → 16.9
Time: 1.6s
Precision: binary64
\[\]
\[\]

Error

Bits error versus re

Bits error versus im

Derivation

  1. Split input into 3 regimes
  2. if re < -3.3662080223699987e135

    1. Initial program 58.9

      \[\]
    2. Taylor expanded around -inf 7.1

      \[\leadsto \]
    3. Simplified7.1

      \[\leadsto \]

    if -3.3662080223699987e135 < re < 1.28420524529039342e121

    1. Initial program 20.8

      \[\]

    if 1.28420524529039342e121 < re

    1. Initial program 54.7

      \[\]
    2. Taylor expanded around inf 7.9

      \[\leadsto \]
  3. Recombined 3 regimes into one program.
  4. Final simplification16.9

    \[\leadsto \]

Reproduce

herbie shell --seed 2020180 
(FPCore (re im)
  :name "math.log/1 on complex, real part"
  :precision binary64
  (log (sqrt (+ (* re re) (* im im)))))