Automatic Differentiation
 
Loading...
Searching...
No Matches
sech.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_SECH_HPP
2#define STAN_MATH_PRIM_FUN_SECH_HPP
3
7#include <utility>
8
9namespace stan {
10namespace math {
11
21template <typename T>
22inline auto sech(T&& x) {
23 return inv(cosh(std::forward<T>(x)));
24}
25
26} // namespace math
27} // namespace stan
28
29#endif
fvar< T > cosh(const fvar< T > &x)
Definition cosh.hpp:16
auto sech(T &&x)
Return the hyperbolic secant 1 / cosh(x) of the argument, elementwise for containers.
Definition sech.hpp:22
fvar< T > inv(const fvar< T > &x)
Definition inv.hpp:13
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...