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]
/
arctanh.cpp
blob
8001da7a6b166d2c96f0e8e210c2ab10218ae2fc
1
#include
"stdafx.h"
2
#include
"defs.h"
3
4
void
5
eval_arctanh
(
void
)
6
{
7
push
(
cadr
(
p1
));
8
eval
();
9
arctanh
();
10
}
11
12
void
13
arctanh
(
void
)
14
{
15
double
d
;
16
save
();
17
p1
=
pop
();
18
if
(
car
(
p1
) ==
symbol
(
TANH
)) {
19
push
(
cadr
(
p1
));
20
restore
();
21
return
;
22
}
23
if
(
isdouble
(
p1
)) {
24
d
=
p1
->
u
.
d
;
25
if
(
d
< -
1.0
||
d
>
1.0
)
26
stop
(
"arctanh function argument is not in the interval [-1,1]"
);
27
d
=
log
((
1.0
+
d
) / (
1.0
-
d
)) /
2.0
;
28
push_double
(
d
);
29
restore
();
30
return
;
31
}
32
if
(
iszero
(
p1
)) {
33
push
(
zero
);
34
restore
();
35
return
;
36
}
37
push_symbol
(
ARCTANH
);
38
push
(
p1
);
39
list
(
2
);
40
restore
();
41
}