Automatic Differentiation
 
Loading...
Searching...
No Matches
acos.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_PRIM_FUN_ACOS_HPP
2#define STAN_MATH_PRIM_FUN_ACOS_HPP
3
15#include <cmath>
16#include <complex>
17
18namespace stan {
19namespace math {
20
28struct acos_fun {
29 template <typename T>
30 static inline auto fun(const T& x) {
31 using std::acos;
32 return acos(x);
33 }
34};
35
44template <typename Container,
48 Container>* = nullptr>
49inline auto acos(const Container& x) {
51}
52
61template <typename Container,
63inline auto acos(const Container& x) {
65 x, [](const auto& v) { return v.array().acos(); });
66}
67
68namespace internal {
76template <typename V>
77inline std::complex<V> complex_acos(const std::complex<V>& x) {
78 return 0.5 * pi() - asin(x);
79}
80} // namespace internal
81
82} // namespace math
83} // namespace stan
84
85#endif
require_not_t< container_type_check_base< is_container, scalar_type_t, TypeCheck, Check... > > require_not_container_st
Require type does not satisfy is_container.
require_t< container_type_check_base< is_container, scalar_type_t, TypeCheck, Check... > > require_container_st
Require type satisfies is_container.
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_acos(const std::complex< V > &x)
Return the arc cosine of the complex argument.
Definition acos.hpp:77
fvar< T > acos(const fvar< T > &x)
Definition acos.hpp:15
static constexpr double pi()
Return the value of pi.
Definition constants.hpp:36
fvar< T > asin(const fvar< T > &x)
Definition asin.hpp:15
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
static auto fun(const T &x)
Definition acos.hpp:30
Structure to wrap acos() so it can be vectorized.
Definition acos.hpp:28
Base template class for vectorization of unary scalar functions defined by a template class F to a sc...