repo.or.cz
/
eigenmath-fx.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Little fix after the last commit (mostly a git fail)
[eigenmath-fx.git]
/
expcos.cpp
blob
01f96b7bd5a5c2ba07f27a16c4b640a796a97ef3
1
// Do the exponential cosine function.
2
3
#include
"stdafx.h"
4
#include
"defs.h"
5
6
void
7
eval_expcos
(
void
)
8
{
9
push
(
cadr
(
p1
));
10
eval
();
11
expcos
();
12
}
13
14
void
15
expcos
(
void
)
16
{
17
save
();
18
19
p1
=
pop
();
20
21
push
(
imaginaryunit
);
22
push
(
p1
);
23
multiply
();
24
exponential
();
25
push_rational
(
1
,
2
);
26
multiply
();
27
28
push
(
imaginaryunit
);
29
negate
();
30
push
(
p1
);
31
multiply
();
32
exponential
();
33
push_rational
(
1
,
2
);
34
multiply
();
35
36
add
();
37
38
restore
();
39
}
40
41
#if SELFTEST
42
43
static char
*
s
[] = {
44
45
"expcos(x)"
,
46
"1/2*exp(-i*x)+1/2*exp(i*x)"
,
47
};
48
49
void
50
test_expcos
(
void
)
51
{
52
test
(
__FILE__
,
s
,
sizeof
s
/
sizeof
(
char
*));
53
}
54
55
#endif