summaryrefslogtreecommitdiffstats
path: root/mathfuncs_asinh.h
blob: 6ea7efd67ad67762408dd3a2dbbfbb1a0caf6a26 (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
35
// -*-C++-*-

#ifndef MATHFUNCS_ASINH_H
#define MATHFUNCS_ASINH_H

#include "mathfuncs_base.h"

#include <cassert>
#include <cmath>



namespace vecmathlib {
  
  template<typename realvec_t>
  realvec_t mathfuncs<realvec_t>::vml_acosh(realvec_t x)
  {
    return log(x + sqrt(x*x - RV(1.0)));
  }
  
  template<typename realvec_t>
  realvec_t mathfuncs<realvec_t>::vml_asinh(realvec_t x)
  {
    return log(x + sqrt(x*x + RV(1.0)));
  }
  
  template<typename realvec_t>
  realvec_t mathfuncs<realvec_t>::vml_atanh(realvec_t x)
  {
    return RV(0.5) * log((RV(1.0) + x) / (RV(1.0) - x));
  }
  
}; // namespace vecmathlib

#endif  // #ifndef MATHFUNCS_ASINH_H
OpenPOWER on IntegriCloud