]> www.ginac.de Git - cln.git/blob - src/complex/transcendental/cl_C_sinh.cc
Replace unused macro with cl_unused.
[cln.git] / src / complex / transcendental / cl_C_sinh.cc
1 // sinh().
2
3 // General includes.
4 #include "base/cl_sysdep.h"
5
6 // Specification.
7 #include "cln/complex.h"
8
9
10 // Implementation.
11
12 #include "complex/cl_C.h"
13 #include "cln/real.h"
14
15 namespace cln {
16
17 const cl_N sinh (const cl_N& x)
18 {
19 // Methode:
20 // x reell -> klar
21 // x = a+bi -> (complex (* (sinh a) (cos b)) (* (cosh a) (sin b)))
22         if (realp(x)) {
23                 DeclareType(cl_R,x);
24                 return sinh(x);
25         } else {
26                 DeclareType(cl_C,x);
27                 // x=a+bi
28                 var const cl_R& a = realpart(x);
29                 var const cl_R& b = imagpart(x);
30                 var cosh_sinh_t hyp_a = cosh_sinh(a); // cosh(a), sinh(a) errechnen
31                 var cos_sin_t trig_b = cos_sin(b); // cos(b), sin(b) errechnen
32                 // Da b nicht = Fixnum 0 ist, ist auch sin(b) nicht = Fixnum 0.
33                 // cosh(a) /= Fixnum 0.
34                 return complex_C(hyp_a.sinh * trig_b.cos, // sinh(a)*cos(b)
35                                  hyp_a.cosh * trig_b.sin // cosh(a)*sin(b), nicht Fixnum 0
36                                 );
37         }
38 }
39
40 }  // namespace cln