summaryrefslogtreecommitdiffstats
path: root/mathfuncs_sinh.h
blob: 04aa446fbb98f820597cf50ebbb26b95deb14dcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// -*-C++-*-

#ifndef MATHFUNCS_SINH_H
#define MATHFUNCS_SINH_H

#include "mathfuncs_base.h"

#include <cmath>



namespace vecmathlib {
  
  template<typename realvec_t>
  realvec_t mathfuncs<realvec_t>::vml_cosh(realvec_t x)
  {
    return RV(0.5) * (exp(x) + exp(-x));
  }
  
  template<typename realvec_t>
  realvec_t mathfuncs<realvec_t>::vml_sinh(realvec_t x)
  {
    return RV(0.5) * (exp(x) - exp(-x));
  }
  
  template<typename realvec_t>
  realvec_t mathfuncs<realvec_t>::vml_tanh(realvec_t x)
  {
    return sinh(x) / cosh(x);
  }
  
}; // namespace vecmathlib

#endif  // #ifndef MATHFUNCS_SINH_H
OpenPOWER on IntegriCloud