diff options
Diffstat (limited to 'mathfuncs_sinh.h')
-rw-r--r-- | mathfuncs_sinh.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/mathfuncs_sinh.h b/mathfuncs_sinh.h new file mode 100644 index 0000000..151cd81 --- /dev/null +++ b/mathfuncs_sinh.h @@ -0,0 +1,35 @@ +// -*-C++-*- + +#ifndef MATHFUNCS_SINH_H +#define MATHFUNCS_SINH_H + +#include "mathfuncs_base.h" + +#include <cassert> +#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 |