Average Error: 0.0 → 0.0
Time: 1.5m
Precision: 64
Internal Precision: 128
\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)\]
\[\cos re \cdot \left(\frac{\sqrt{0.5}}{\frac{e^{im}}{\sqrt{0.5}}} + e^{im} \cdot 0.5\right)\]

Error

Bits error versus re

Bits error versus im

Derivation

  1. Initial program 0.0

    \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\left(\frac{0.5}{e^{im}} + e^{im} \cdot 0.5\right) \cdot \cos re}\]
  3. Using strategy rm
  4. Applied add-sqr-sqrt0.0

    \[\leadsto \left(\frac{\color{blue}{\sqrt{0.5} \cdot \sqrt{0.5}}}{e^{im}} + e^{im} \cdot 0.5\right) \cdot \cos re\]
  5. Applied associate-/l*0.0

    \[\leadsto \left(\color{blue}{\frac{\sqrt{0.5}}{\frac{e^{im}}{\sqrt{0.5}}}} + e^{im} \cdot 0.5\right) \cdot \cos re\]
  6. Final simplification0.0

    \[\leadsto \cos re \cdot \left(\frac{\sqrt{0.5}}{\frac{e^{im}}{\sqrt{0.5}}} + e^{im} \cdot 0.5\right)\]

Reproduce

herbie shell --seed 2019090 
(FPCore (re im)
  :name "math.cos on complex, real part"
  (* (* 0.5 (cos re)) (+ (exp (- im)) (exp im))))