Little fix after the last commit (mostly a git fail)
[eigenmath-fx.git] / cosh.cpp
blobd2e9237ecba3413b837a6b8ae7f1f19bb05cab10
1 // exp(x) + exp(-x)
2 // cosh(x) = ----------------
3 // 2
5 #include "stdafx.h"
6 #include "defs.h"
8 void
9 eval_cosh(void)
11 push(cadr(p1));
12 eval();
13 ycosh();
16 void
17 ycosh(void)
19 save();
20 yycosh();
21 restore();
24 void
25 yycosh(void)
27 double d;
28 p1 = pop();
29 if (car(p1) == symbol(ARCCOSH)) {
30 push(cadr(p1));
31 return;
33 if (isdouble(p1)) {
34 d = cosh(p1->u.d);
35 if (fabs(d) < 1e-10)
36 d = 0.0;
37 push_double(d);
38 return;
40 if (iszero(p1)) {
41 push(one);
42 return;
44 push_symbol(COSH);
45 push(p1);
46 list(2);