Automatic Differentiation
 
Loading...
Searching...
No Matches
asinh.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_ASINH_HPP
2#define STAN_MATH_PRIM_FUN_ASINH_HPP
3
17#include <cmath>
18#include <complex>
19
20namespace stan {
21namespace math {
22
30struct asinh_fun {
31 template <typename T>
32 static inline auto fun(const T& x) {
33 using std::asinh;
34 return asinh(x);
35 }
36};
37
46template <
47 typename T, require_not_var_matrix_t<T>* = nullptr,
49inline auto asinh(const T& x) {
51}
52
53namespace internal {
61template <typename V>
62inline std::complex<V> complex_asinh(const std::complex<V>& z) {
63 std::complex<double> y_d = asinh(value_of_rec(z));
64 auto y = log(z + sqrt(1 + z * z));
65 return copysign(y, y_d);
66}
67} // namespace internal
68} // namespace math
69} // namespace stan
70
71#endif
require_all_not_t< is_nonscalar_prim_or_rev_kernel_expression< std::decay_t< Types > >... > require_all_not_nonscalar_prim_or_rev_kernel_expression_t
Require none of the types satisfy is_nonscalar_prim_or_rev_kernel_expression.
require_not_t< is_var_matrix< std::decay_t< T > > > require_not_var_matrix_t
Require type does not satisfy is_var_matrix.
std::complex< V > complex_asinh(const std::complex< V > &z)
Return the hyperbolic arc sine of the complex argument.
Definition asinh.hpp:62
double copysign(double a, double_d b)
Definition double_d.hpp:329
double value_of_rec(const fvar< T > &v)
Return the value of the specified variable.
fvar< T > asinh(const fvar< T > &x)
Definition asinh.hpp:15
fvar< T > log(const fvar< T > &x)
Definition log.hpp:15
fvar< T > sqrt(const fvar< T > &x)
Definition sqrt.hpp:17
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Base template class for vectorization of unary scalar functions defined by a template class F to a sc...
static auto fun(const T &x)
Definition asinh.hpp:32
Structure to wrap asinh() so it can be vectorized.
Definition asinh.hpp:30