Average Error: 29.3 → 0.0
Time: 1.7s
Precision: 64
Internal Precision: 384
\[\sqrt{re \cdot re + im \cdot im}\]
\[\sqrt{re^2 + im^2}^*\]

Error

Bits error versus re

Bits error versus im

Derivation

  1. Initial program 29.3

    \[\sqrt{re \cdot re + im \cdot im}\]
  2. Applied simplify0.0

    \[\leadsto \color{blue}{\sqrt{re^2 + im^2}^*}\]

Runtime

Time bar (total: 1.7s)Debug logProfile

herbie shell --seed '#(1070258749 1877548225 2229079127 1588002776 3179087814 1886870650)' +o rules:numerics
(FPCore (re im)
  :name "math.abs on complex"
  (sqrt (+ (* re re) (* im im))))