\[\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: 11.8 s
Input Error: 24.9
Output Error: 0.5
Log:
Profile: 🕒
\(\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. Started with
    \[\left(0.5 \cdot \cos re\right) \cdot \left(e^{0 - im} - e^{im}\right)\]
    24.9
  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.9
  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.5
  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.5

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)))))