diff options
Diffstat (limited to 'mathfuncs_sinh.h')
-rw-r--r-- | mathfuncs_sinh.h | 37 |
1 files changed, 16 insertions, 21 deletions
diff --git a/mathfuncs_sinh.h b/mathfuncs_sinh.h index 04aa446..a8c2ee3 100644 --- a/mathfuncs_sinh.h +++ b/mathfuncs_sinh.h @@ -7,28 +7,23 @@ #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 { - - 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 +#endif // #ifndef MATHFUNCS_SINH_H |