Average Error: 31.6 → 18.3
Time: 2.2s
Precision: binary64
\[\]
\[\]

Error

Bits error versus re

Bits error versus im

Derivation

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

    1. Initial program 42.3

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

      \[\leadsto \]
    3. Simplified11.8

      \[\leadsto \]

    if -6.66181232792173805e32 < re < -4.85032597873741902e-160 or 8.69468551922083389e-226 < re < 2.757432490321271e106

    1. Initial program 18.2

      \[\]

    if -4.85032597873741902e-160 < re < 8.69468551922083389e-226

    1. Initial program 30.9

      \[\]
    2. Taylor expanded around 0 34.5

      \[\leadsto \]

    if 2.757432490321271e106 < re

    1. Initial program 52.6

      \[\]
    2. Taylor expanded around inf 9.2

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

    \[\leadsto \]

Reproduce

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