A (very) few UI improvements
[eigenmath-fx.git] / arccosh.cpp
blobfe4372138c9ee7747d50bdbfa5ea180a6368d814
1 #include "stdafx.h"
2 #include "defs.h"
4 void
5 eval_arccosh(void)
7 push(cadr(p1));
8 eval();
9 arccosh();
12 void
13 arccosh(void)
15 double d;
16 save();
17 p1 = pop();
18 if (car(p1) == symbol(COSH)) {
19 push(cadr(p1));
20 restore();
21 return;
23 if (isdouble(p1)) {
24 d = p1->u.d;
25 if (d < 1.0)
26 stop("arccosh function argument is less than 1.0");
27 d = log(d + sqrt(d * d - 1.0));
28 push_double(d);
29 restore();
30 return;
32 if (isplusone(p1)) {
33 push(zero);
34 restore();
35 return;
37 push_symbol(ARCCOSH);
38 push(p1);
39 list(2);
40 restore();