\[\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - im} - e^{im}\right)\]
Test:
math.sin on complex, imaginary part
Bits:
128 bits
Bits error versus re
Bits error versus im
Time: 28.1 s
Input Error: 24.6
Output Error: 1.0
Log:
Profile: 🕒
\(\log_* (1 + (e^{(\frac{1}{3} * \left({im}^3\right) + \left((\frac{1}{60} * \left({im}^{5}\right) + \left(2 \cdot im\right))_*\right))_* \cdot \left(\left(-0.5\right) \cdot \cos re\right)} - 1)^*)\)
  1. Started with
    \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - im} - e^{im}\right)\]
    24.6
  2. Applied simplify to get
    \[\color{red}{\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - im} - e^{im}\right)} \leadsto \color{blue}{\left(e^{-im} - e^{im}\right) \cdot \left(\cos re \cdot 0.5\right)}\]
    24.6
  3. Applied taylor to get
    \[\left(e^{-im} - e^{im}\right) \cdot \left(\cos re \cdot 0.5\right) \leadsto \left(-\left(\frac{1}{60} \cdot {im}^{5} + \left(2 \cdot im + \frac{1}{3} \cdot {im}^{3}\right)\right)\right) \cdot \left(\cos re \cdot 0.5\right)\]
    0.1
  4. Taylor expanded around 0 to get
    \[\color{red}{\left(-\left(\frac{1}{60} \cdot {im}^{5} + \left(2 \cdot im + \frac{1}{3} \cdot {im}^{3}\right)\right)\right)} \cdot \left(\cos re \cdot 0.5\right) \leadsto \color{blue}{\left(-\left(\frac{1}{60} \cdot {im}^{5} + \left(2 \cdot im + \frac{1}{3} \cdot {im}^{3}\right)\right)\right)} \cdot \left(\cos re \cdot 0.5\right)\]
    0.1
  5. Using strategy rm
    0.1
  6. Applied log1p-expm1-u to get
    \[\color{red}{\left(-\left(\frac{1}{60} \cdot {im}^{5} + \left(2 \cdot im + \frac{1}{3} \cdot {im}^{3}\right)\right)\right) \cdot \left(\cos re \cdot 0.5\right)} \leadsto \color{blue}{\log_* (1 + (e^{\left(-\left(\frac{1}{60} \cdot {im}^{5} + \left(2 \cdot im + \frac{1}{3} \cdot {im}^{3}\right)\right)\right) \cdot \left(\cos re \cdot 0.5\right)} - 1)^*)}\]
    1.0
  7. Applied simplify to get
    \[\log_* (1 + \color{red}{(e^{\left(-\left(\frac{1}{60} \cdot {im}^{5} + \left(2 \cdot im + \frac{1}{3} \cdot {im}^{3}\right)\right)\right) \cdot \left(\cos re \cdot 0.5\right)} - 1)^*}) \leadsto \log_* (1 + \color{blue}{(e^{(\frac{1}{3} * \left({im}^3\right) + \left((\frac{1}{60} * \left({im}^{5}\right) + \left(2 \cdot im\right))_*\right))_* \cdot \left(\left(-0.5\right) \cdot \cos re\right)} - 1)^*})\]
    1.0

Original test:


(lambda ((re default) (im default))
  #:name "math.sin on complex, imaginary part"
  (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im)))
  #:target
  (if (< (fabs im) 1) (- (* (cos re) (+ (+ im (* (* (* 1/6 im) im) im)) (* (* (* (* (* 1/120 im) im) im) im) im)))) (* (* 0.5 (cos re)) (- (exp (- 0 im)) (exp im)))))