diff options
author | Erik Schnetter <schnetter@gmail.com> | 2015-10-16 13:45:31 -0400 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2015-10-16 13:45:31 -0400 |
commit | 06ddf9a62fd6e991dfcf0bd2abe0941b960cb2bb (patch) | |
tree | 793b48ebee5b9c779c8afd34cc20245c93b9ad9d /mathfuncs_asinh.h | |
parent | 71a4a6821276690eed15df8d2c246be499da1e29 (diff) | |
download | vecmathlib-06ddf9a62fd6e991dfcf0bd2abe0941b960cb2bb.zip vecmathlib-06ddf9a62fd6e991dfcf0bd2abe0941b960cb2bb.tar.gz |
Reformat source code with clang-format
Note: If you have an existing checkout with modifications, then you should:
(1) save your current state on a branch
(2) run clang-format on this branch
(3) compare this branch to a fresh checkout of the clang-formatted master
Since both your branch and master have been formatted with clang-format, this will lead to a very small diff, avoiding spurious changes due to formatting differences.
Diffstat (limited to 'mathfuncs_asinh.h')
-rw-r--r-- | mathfuncs_asinh.h | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/mathfuncs_asinh.h b/mathfuncs_asinh.h index c7be8eb..1197261 100644 --- a/mathfuncs_asinh.h +++ b/mathfuncs_asinh.h @@ -7,36 +7,31 @@ #include <cmath> +namespace vecmathlib { +template <typename realvec_t> +realvec_t mathfuncs<realvec_t>::vml_asinh(realvec_t x) { + // Reduce range + realvec_t r = fabs(x); + r = log(r + sqrt(r * r + RV(1.0))); + r = copysign(r, x); + return r; +} + +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_atanh(realvec_t x) { + // Reduce range + realvec_t r = fabs(x); + r = RV(0.5) * log((RV(1.0) + r) / (RV(1.0) - r)); + r = copysign(r, x); + return r; +} -namespace vecmathlib { - - template<typename realvec_t> - realvec_t mathfuncs<realvec_t>::vml_asinh(realvec_t x) - { - // Reduce range - realvec_t r = fabs(x); - r = log(r + sqrt(r*r + RV(1.0))); - r = copysign(r, x); - return r; - } - - 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_atanh(realvec_t x) - { - // Reduce range - realvec_t r = fabs(x); - r = RV(0.5) * log((RV(1.0) + r) / (RV(1.0) - r)); - r = copysign(r, x); - return r; - } - }; // namespace vecmathlib -#endif // #ifndef MATHFUNCS_ASINH_H +#endif // #ifndef MATHFUNCS_ASINH_H |