Average Error: 31.9 → 17.6
Time: 1.6s
Precision: binary64
\[\]
\[\]

Error

Bits error versus re

Bits error versus im

Derivation

  1. Split input into 4 regimes
  2. if re < -1169736649081899.75

    1. Initial program 42.3

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

      \[\leadsto \]
    3. Simplified12.0

      \[\leadsto \]

    if -1169736649081899.75 < re < -5.434411537566742e-154 or 3.29968623641821832e-306 < re < 1.0570666050233334e116

    1. Initial program 19.4

      \[\]

    if -5.434411537566742e-154 < re < 3.29968623641821832e-306

    1. Initial program 30.6

      \[\]
    2. Taylor expanded around 0 34.1

      \[\leadsto \]

    if 1.0570666050233334e116 < re

    1. Initial program 54.9

      \[\]
    2. Taylor expanded around inf 8.3

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

    \[\leadsto \]

Reproduce

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