Average Error: 31.5 → 17.9
Time: 1.7s
Precision: binary64
\[\]
\[\]

Error

Bits error versus re

Bits error versus im

Derivation

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

    1. Initial program 43.4

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

      \[\leadsto \]
    3. Simplified12.3

      \[\leadsto \]

    if -4.43594736247992521e37 < re < -6.3388254617832719e-190 or 6.5530138229882175e-228 < re < 2.596063910090653e101

    1. Initial program 18.9

      \[\]

    if -6.3388254617832719e-190 < re < 6.5530138229882175e-228

    1. Initial program 29.7

      \[\]
    2. Taylor expanded around 0 33.2

      \[\leadsto \]

    if 2.596063910090653e101 < re

    1. Initial program 51.9

      \[\]
    2. Taylor expanded around inf 8.3

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

    \[\leadsto \]

Reproduce

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