\[\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: 15.8 s
Input Error: 0.0
Output Error: 0.1
Log:
Profile: 🕒
\(\left(0.5 \cdot \cos re\right) \cdot \sqrt[3]{{\left(e^{-im} + e^{im}\right)}^3}\)
  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-cbrt-cube 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}{\sqrt[3]{{\left(e^{-im} + e^{im}\right)}^3}}\]
    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))))