\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)\]
Test:
math.cos on complex, real part
Bits:
128 bits
Bits error versus re
Bits error versus im
Time: 9.7 s
Input Error: 0.0
Output Error: 0.1
Log:
Profile: 🕒
\(\left(0.5 \cdot \cos re\right) \cdot e^{\log \left(e^{-im} + e^{im}\right)}\)
  1. Started with
    \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{-im} + e^{im}\right)\]
    0.0
  2. Using strategy rm
    0.0
  3. Applied add-exp-log to get
    \[\left(0.5 \cdot \cos re\right) \cdot \color{red}{\left(e^{-im} + e^{im}\right)} \leadsto \left(0.5 \cdot \cos re\right) \cdot \color{blue}{e^{\log \left(e^{-im} + e^{im}\right)}}\]
    0.1

  4. Removed slow pow expressions

Original test:


(lambda ((re default) (im default))
  #:name "math.cos on complex, real part"
  (* (* 0.5 (cos re)) (+ (exp (- im)) (exp im))))