Average Error: 43.4 → 0.7
Time: 12.6s
Precision: binary64
Cost: 33408
\[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)\]
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \sin re \cdot im\]
\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)
\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \sin re \cdot im
(FPCore (re im)
 :precision binary64
 (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))
(FPCore (re im)
 :precision binary64
 (-
  (*
   (* 0.5 (sin re))
   (+
    (* (pow im 7.0) -0.0003968253968253968)
    (+
     (* (pow im 5.0) -0.016666666666666666)
     (* (pow im 3.0) -0.3333333333333333))))
  (* (sin re) im)))
double code(double re, double im) {
	return (0.5 * sin(re)) * (exp(-im) - exp(im));
}
double code(double re, double im) {
	return ((0.5 * sin(re)) * ((pow(im, 7.0) * -0.0003968253968253968) + ((pow(im, 5.0) * -0.016666666666666666) + (pow(im, 3.0) * -0.3333333333333333)))) - (sin(re) * im);
}

Error

Bits error versus re

Bits error versus im

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original43.4
Target0.3
Herbie0.7
\[\begin{array}{l} \mathbf{if}\;\left|im\right| < 1:\\ \;\;\;\;-\sin re \cdot \left(\left(im + \left(\left(0.16666666666666666 \cdot im\right) \cdot im\right) \cdot im\right) + \left(\left(\left(\left(0.008333333333333333 \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right) \cdot im\right)\\ \mathbf{else}:\\ \;\;\;\;\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)\\ \end{array}\]

Alternatives

Alternative 1
Error42.9
Cost101184
\[\frac{\left(0.5 \cdot \sin re\right) \cdot \left({\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right)}^{3} - {\left(0.0003968253968253968 \cdot {im}^{7}\right)}^{3}\right)}{\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) \cdot \left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + \left(\left(0.0003968253968253968 \cdot {im}^{7}\right) \cdot \left(0.0003968253968253968 \cdot {im}^{7}\right) + \left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) \cdot \left(0.0003968253968253968 \cdot {im}^{7}\right)\right)}\]
Alternative 2
Error1.7
Cost100352
\[\sqrt[3]{\left(0.5 \cdot \sin re\right) \cdot \left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968\right)} \cdot \left(\sqrt[3]{\left(0.5 \cdot \sin re\right) \cdot \left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968\right)} \cdot \sqrt[3]{\left(0.5 \cdot \sin re\right) \cdot \left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968\right)}\right)\]
Alternative 3
Error33.3
Cost91392
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \left(\sqrt[3]{\sin re} \cdot \sqrt[3]{\sin re}\right) \cdot \left(im \cdot \left(\sqrt[3]{\sqrt{\sin re}} \cdot \sqrt[3]{\sqrt{\sin re}}\right)\right)\]
Alternative 4
Error1.7
Cost87040
\[\sqrt[3]{\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968} \cdot \left(\left(0.5 \cdot \sin re\right) \cdot \left(\sqrt[3]{\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968} \cdot \sqrt[3]{\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968}\right)\right)\]
Alternative 5
Error43.4
Cost78464
\[\sqrt[3]{\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)} \cdot \left(\sqrt[3]{\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)} \cdot \sqrt[3]{\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)}\right)\]
Alternative 6
Error43.5
Cost71936
\[\frac{\left(0.5 \cdot \sin re\right) \cdot \left({\left(e^{im}\right)}^{-3} - {\left(e^{im}\right)}^{3}\right)}{e^{-im} \cdot e^{-im} + \left(e^{im} \cdot e^{im} + e^{-im} \cdot e^{im}\right)}\]
Alternative 7
Error25.5
Cost66880
\[\sqrt{\left(0.5 \cdot \sin re\right) \cdot \left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968\right)} \cdot \sqrt{\left(0.5 \cdot \sin re\right) \cdot \left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968\right)}\]
Alternative 8
Error1.7
Cost66112
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) + \sqrt[3]{\sin re \cdot \left(-im\right)} \cdot \left(\sqrt[3]{\sin re \cdot \left(-im\right)} \cdot \sqrt[3]{\sin re \cdot \left(-im\right)}\right)\]
Alternative 9
Error1.6
Cost65664
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \left(\sqrt[3]{\sin re} \cdot \sqrt[3]{\sin re}\right) \cdot \left(im \cdot \sqrt[3]{\sin re}\right)\]
Alternative 10
Error43.4
Cost65152
\[\left(0.5 \cdot \sin re\right) \cdot \left(\sqrt[3]{e^{-im} - e^{im}} \cdot \left(\sqrt[3]{e^{-im} - e^{im}} \cdot \sqrt[3]{e^{-im} - e^{im}}\right)\right)\]
Alternative 11
Error22.6
Cost61120
\[\frac{\left(0.5 \cdot \sin re\right) \cdot \left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) \cdot \left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{14} \cdot -1.5747039556563367 \cdot 10^{-07}\right)}{\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + 0.0003968253968253968 \cdot {im}^{7}}\]
Alternative 12
Error33.2
Cost60224
\[\sqrt{\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968} \cdot \left(\left(0.5 \cdot \sin re\right) \cdot \sqrt{\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968}\right)\]
Alternative 13
Error33.5
Cost59264
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - e^{0.6666666666666666 \cdot \log \sin re} \cdot \left(im \cdot \sqrt[3]{\sin re}\right)\]
Alternative 14
Error5.5
Cost59264
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - {\left({\sin re}^{2}\right)}^{0.3333333333333333} \cdot \left(im \cdot \sqrt[3]{\sin re}\right)\]
Alternative 15
Error4.9
Cost59200
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \sqrt[3]{{\sin re}^{2}} \cdot \left(im \cdot \sqrt[3]{\sin re}\right)\]
Alternative 16
Error1.6
Cost59200
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - {\left(\sqrt[3]{\sin re}\right)}^{2} \cdot \left(im \cdot \sqrt[3]{\sin re}\right)\]
Alternative 17
Error43.5
Cost58688
\[\left(0.5 \cdot \sin re\right) \cdot \frac{{\left(e^{im}\right)}^{-3} - {\left(e^{im}\right)}^{3}}{{\left(e^{im}\right)}^{-2} + \left({\left(e^{im}\right)}^{2} + 1\right)}\]
Alternative 18
Error43.4
Cost58432
\[\left(0.5 \cdot \sin re\right) \cdot \left(\left(\sqrt{e^{-im}} + \sqrt{e^{im}}\right) \cdot \left(\sqrt{e^{-im}} - \sqrt{e^{im}}\right)\right)\]
Alternative 19
Error1.7
Cost53056
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) + \sqrt[3]{-im} \cdot \left(\sin re \cdot \left(\sqrt[3]{-im} \cdot \sqrt[3]{-im}\right)\right)\]
Alternative 20
Error25.5
Cost52992
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) + \sqrt{\sin re \cdot \left(-im\right)} \cdot \sqrt{\sin re \cdot \left(-im\right)}\]
Alternative 21
Error1.7
Cost52864
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \sqrt[3]{im} \cdot \left(\sin re \cdot \left(\sqrt[3]{im} \cdot \sqrt[3]{im}\right)\right)\]
Alternative 22
Error33.5
Cost52800
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - {\sin re}^{0.6666666666666666} \cdot \left(im \cdot \sqrt[3]{\sin re}\right)\]
Alternative 23
Error33.0
Cost52736
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \sqrt{\sin re} \cdot \left(im \cdot \sqrt{\sin re}\right)\]
Alternative 24
Error33.2
Cost46464
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) + \sqrt{-im} \cdot \left(\sin re \cdot \sqrt{-im}\right)\]
Alternative 25
Error31.8
Cost46336
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \sqrt{im} \cdot \left(\sin re \cdot \sqrt{im}\right)\]
Alternative 26
Error43.4
Cost45696
\[\left(0.5 \cdot \sin re\right) \cdot \frac{{\left(e^{im}\right)}^{-2} - {\left(e^{im}\right)}^{2}}{e^{-im} + e^{im}}\]
Alternative 27
Error33.9
Cost39872
\[\sqrt[3]{{\left(\left(0.5 \cdot \sin re\right) \cdot \left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968\right)\right)}^{3}}\]
Alternative 28
Error0.7
Cost39872
\[\left(0.5 \cdot \sin re\right) \cdot \left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) - \sqrt[3]{{\left(0.0003968253968253968 \cdot {im}^{7}\right)}^{3}}\right)\]
Alternative 29
Error44.8
Cost38784
\[\log \left(\sqrt{e^{\sin re \cdot \left(e^{-im} - e^{im}\right)}}\right)\]
Alternative 30
Error0.7
Cost33280
\[\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right) - \sin re \cdot \left({im}^{7} \cdot 0.0001984126984126984 + {im}^{5} \cdot 0.008333333333333333\right)\]
Alternative 31
Error43.4
Cost32576
\[\left(0.5 \cdot \sin re\right) \cdot \sqrt[3]{{\left(e^{-im} - e^{im}\right)}^{3}}\]
Alternative 32
Error44.8
Cost32512
\[e^{\log \left(\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)\right)}\]
Alternative 33
Error43.8
Cost32512
\[\left(0.5 \cdot \sin re\right) \cdot \log \left(e^{e^{-im} - e^{im}}\right)\]
Alternative 34
Error0.7
Cost27200
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + \left(im \cdot im\right) \cdot \left(im \cdot -0.3333333333333333\right)\right)\right) - \sin re \cdot im\]
Alternative 35
Error31.5
Cost27008
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - re \cdot im\]
Alternative 36
Error0.7
Cost27008
\[\left(0.5 \cdot \sin re\right) \cdot \left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) + {im}^{7} \cdot -0.0003968253968253968\right)\]
Alternative 37
Error7.7
Cost26880
\[re \cdot \left({im}^{7} \cdot -0.0001984126984126984 + \left({im}^{3} \cdot -0.16666666666666666 - {im}^{5} \cdot 0.008333333333333333\right)\right) - \sin re \cdot im\]
Alternative 38
Error43.4
Cost26304
\[\frac{0.5 \cdot \sin re}{e^{im}} + e^{im} \cdot \left(\sin re \cdot -0.5\right)\]
Alternative 39
Error0.7
Cost20800
\[\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + \left(im \cdot -2 - im \cdot \left(0.3333333333333333 \cdot \left(im \cdot im\right)\right)\right)\right)\right)\]
Alternative 40
Error31.5
Cost20352
\[re \cdot \left({im}^{7} \cdot -0.0001984126984126984 - \left({im}^{5} \cdot 0.008333333333333333 + \left(im + {im}^{3} \cdot 0.16666666666666666\right)\right)\right)\]
Alternative 41
Error0.8
Cost20288
\[\left(0.5 \cdot \sin re\right) \cdot \left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right)\]
Alternative 42
Error43.4
Cost19712
\[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)\]
Alternative 43
Error0.9
Cost13568
\[\left(0.5 \cdot \sin re\right) \cdot \left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right)\]
Alternative 44
Error0.9
Cost13312
\[\sin re \cdot \left({im}^{3} \cdot -0.16666666666666666 - im\right)\]
Alternative 45
Error1.3
Cost6848
\[\left(0.5 \cdot \sin re\right) \cdot \left(im \cdot -2\right)\]
Alternative 46
Error1.3
Cost6656
\[\sin re \cdot \left(-im\right)\]
Alternative 47
Error61.7
Cost64
\[1\]
Alternative 48
Error45.9
Cost64
\[0\]
Alternative 49
Error61.7
Cost64
\[-1\]

Error

Derivation

  1. Initial program 43.4

    \[\left(0.5 \cdot \sin re\right) \cdot \left(e^{-im} - e^{im}\right)\]
  2. Taylor expanded around 0 0.7

    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(-\left(0.0003968253968253968 \cdot {im}^{7} + \left(0.016666666666666666 \cdot {im}^{5} + \left(0.3333333333333333 \cdot {im}^{3} + 2 \cdot im\right)\right)\right)\right)}\]
  3. Simplified0.7

    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(\left(\left(im \cdot -2 - 0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) - 0.0003968253968253968 \cdot {im}^{7}\right)}\]
  4. Using strategy rm
  5. Applied sub-neg_binary64_33940.7

    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(\left(\color{blue}{\left(im \cdot -2 + \left(-0.3333333333333333 \cdot {im}^{3}\right)\right)} - 0.016666666666666666 \cdot {im}^{5}\right) - 0.0003968253968253968 \cdot {im}^{7}\right)\]
  6. Applied associate--l+_binary64_33380.7

    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left(\color{blue}{\left(im \cdot -2 + \left(\left(-0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right)\right)} - 0.0003968253968253968 \cdot {im}^{7}\right)\]
  7. Applied associate--l+_binary64_33380.7

    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \color{blue}{\left(im \cdot -2 + \left(\left(\left(-0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) - 0.0003968253968253968 \cdot {im}^{7}\right)\right)}\]
  8. Applied distribute-rgt-in_binary64_33510.7

    \[\leadsto \color{blue}{\left(im \cdot -2\right) \cdot \left(0.5 \cdot \sin re\right) + \left(\left(\left(-0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) - 0.0003968253968253968 \cdot {im}^{7}\right) \cdot \left(0.5 \cdot \sin re\right)}\]
  9. Simplified0.7

    \[\leadsto \color{blue}{\sin re \cdot \left(-im\right)} + \left(\left(\left(-0.3333333333333333 \cdot {im}^{3}\right) - 0.016666666666666666 \cdot {im}^{5}\right) - 0.0003968253968253968 \cdot {im}^{7}\right) \cdot \left(0.5 \cdot \sin re\right)\]
  10. Simplified0.7

    \[\leadsto \sin re \cdot \left(-im\right) + \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right)}\]
  11. Simplified0.7

    \[\leadsto \color{blue}{\left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \sin re \cdot im}\]
  12. Final simplification0.7

    \[\leadsto \left(0.5 \cdot \sin re\right) \cdot \left({im}^{7} \cdot -0.0003968253968253968 + \left({im}^{5} \cdot -0.016666666666666666 + {im}^{3} \cdot -0.3333333333333333\right)\right) - \sin re \cdot im\]

Reproduce

herbie shell --seed 2021042 
(FPCore (re im)
  :name "math.cos on complex, imaginary part"
  :precision binary64

  :herbie-target
  (if (< (fabs im) 1.0) (- (* (sin re) (+ (+ im (* (* (* 0.16666666666666666 im) im) im)) (* (* (* (* (* 0.008333333333333333 im) im) im) im) im)))) (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))

  (* (* 0.5 (sin re)) (- (exp (- im)) (exp im))))