Little fix after the last commit (mostly a git fail)
[eigenmath-fx.git] / expsin.cpp
blob6756c8de2ed8ddb542ab3c5fd924082515dc72ff
1 // Do the exponential sine function.
3 #include "stdafx.h"
4 #include "defs.h"
6 void
7 eval_expsin(void)
9 push(cadr(p1));
10 eval();
11 expsin();
14 void
15 expsin(void)
17 save();
19 p1 = pop();
21 push(imaginaryunit);
22 push(p1);
23 multiply();
24 exponential();
25 push(imaginaryunit);
26 divide();
27 push_rational(1, 2);
28 multiply();
30 push(imaginaryunit);
31 negate();
32 push(p1);
33 multiply();
34 exponential();
35 push(imaginaryunit);
36 divide();
37 push_rational(1, 2);
38 multiply();
40 subtract();
42 restore();
45 #if SELFTEST
47 static char *s[] = {
49 "expsin(x)",
50 "1/2*i*exp(-i*x)-1/2*i*exp(i*x)",
53 void
54 test_expsin(void)
56 test(__FILE__, s, sizeof s / sizeof (char *));
59 #endif