Average Error: 29.8 → 0.0
Time: 1.5s
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.8

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

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

Runtime

Time bar (total: 1.5s)Debug logProfile

herbie shell --seed '#(1064173506 2580572819 2847706409 4129882574 1125180799 1845288547)' +o rules:numerics
(FPCore (re im)
  :name "math.abs on complex"
  (sqrt (+ (* re re) (* im im))))