Average Error: 30.7 → 0.0
Time: 2.9s
Precision: 64
Internal Precision: 576
\[\log \left(\sqrt{re \cdot re + im \cdot im}\right)\]
\[\log \left(\sqrt{re^2 + im^2}^*\right)\]

Error

Bits error versus re

Bits error versus im

Try it out

  1. Inputs

  2. Original Output:

    Herbie Output:

Derivation

  1. Initial program 30.7

    \[\log \left(\sqrt{re \cdot re + im \cdot im}\right)\]
  2. Applied simplify0.0

    \[\leadsto \color{blue}{\log \left(\sqrt{re^2 + im^2}^*\right)}\]

Runtime

Time bar (total: 2.9s)Debug logProfile

herbie shell --seed '#(1072361757 3390613284 2339397988 1175251238 145061547 3101881848)' +o rules:numerics
(FPCore (re im)
  :name "math.log/1 on complex, real part"
  (log (sqrt (+ (* re re) (* im im)))))