Average Error: 30.4 → 0.6
Time: 1.1m
Precision: 64
Internal Precision: 576
\[\frac{\log \left(\sqrt{re \cdot re + im \cdot im}\right)}{\log 10}\]
\[\frac{\log \left(\sqrt{re^2 + im^2}^*\right)}{\log 10}\]

Error

Bits error versus re

Bits error versus im

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 30.4

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

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

Runtime

Time bar (total: 1.1m)Debug logProfile

herbie shell --seed 2018296 +o rules:numerics
(FPCore (re im)
  :name "math.log10 on complex, real part"
  (/ (log (sqrt (+ (* re re) (* im im)))) (log 10)))