Average Error: 30.3 → 0.1
Time: 48.4s
Precision: 64
Internal Precision: 4416
\[0.5 \cdot \sqrt{2.0 \cdot \left(\sqrt{re \cdot re - im \cdot im} + re\right)}\]
\[0.5 \cdot \sqrt{2.0 \cdot \left(\sqrt{re + im} \cdot \sqrt{re - im} + re\right)}\]

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.3

    \[0.5 \cdot \sqrt{2.0 \cdot \left(\sqrt{re \cdot re - im \cdot im} + re\right)}\]
  2. Using strategy rm
  3. Applied difference-of-squares30.3

    \[\leadsto 0.5 \cdot \sqrt{2.0 \cdot \left(\sqrt{\color{blue}{\left(re + im\right) \cdot \left(re - im\right)}} + re\right)}\]
  4. Applied sqrt-prod0.1

    \[\leadsto 0.5 \cdot \sqrt{2.0 \cdot \left(\color{blue}{\sqrt{re + im} \cdot \sqrt{re - im}} + re\right)}\]

Runtime

Time bar (total: 48.4s)Debug logProfile

herbie shell --seed 2018206 
(FPCore (re im)
  :name "math.sqrt on complex, imaginary part, im greater than 0 branch"
  (* 0.5 (sqrt (* 2.0 (+ (sqrt (- (* re re) (* im im))) re)))))