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
A (very) few UI improvements
[eigenmath-fx.git]
/
sinh.cpp
blob
2ab0c43217345245410b3bc490c376e4d9e98175
1
// exp(x) - exp(-x)
2
// sinh(x) = ----------------
3
// 2
4
5
#include
"stdafx.h"
6
#include
"defs.h"
7
8
void
9
eval_sinh
(
void
)
10
{
11
push
(
cadr
(
p1
));
12
eval
();
13
ysinh
();
14
}
15
16
void
17
ysinh
(
void
)
18
{
19
save
();
20
yysinh
();
21
restore
();
22
}
23
24
void
25
yysinh
(
void
)
26
{
27
double
d
;
28
p1
=
pop
();
29
if
(
car
(
p1
) ==
symbol
(
ARCSINH
)) {
30
push
(
cadr
(
p1
));
31
return
;
32
}
33
if
(
isdouble
(
p1
)) {
34
d
=
sinh
(
p1
->
u
.
d
);
35
if
(
fabs
(
d
) <
1e-10
)
36
d
=
0.0
;
37
push_double
(
d
);
38
return
;
39
}
40
if
(
iszero
(
p1
)) {
41
push
(
zero
);
42
return
;
43
}
44
push_symbol
(
SINH
);
45
push
(
p1
);
46
list
(
2
);
47
}
48
49
#if SELFTEST
50
51
static char
*
s
[] = {
52
53
"sinh(x)"
,
54
"sinh(x)"
,
55
56
"sinh(0)"
,
57
"0"
,
58
59
"sinh(arcsinh(x))"
,
60
"x"
,
61
};
62
63
void
64
test_sinh
(
void
)
65
{
66
test
(
__FILE__
,
s
,
sizeof
s
/
sizeof
(
char
*));
67
}
68
69
#endif