Average Error: 29.9 → 0.0
Time: 1.0s
Precision: 64
Internal Precision: 576
\[\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.9

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

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

Runtime

Time bar (total: 1.0s)Debug logProfile

herbie shell --seed '#(1071979731 1496239409 439705970 2863295848 982327776 189749553)' +o rules:numerics
(FPCore (re im)
  :name "math.abs on complex"
  (sqrt (+ (* re re) (* im im))))