Stan Math Library  2.20.0
reverse mode automatic differentiation
acosh.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_FUN_ACOSH_HPP
2 #define STAN_MATH_PRIM_SCAL_FUN_ACOSH_HPP
3 
8 #include <cmath>
9 
10 namespace stan {
11 namespace math {
12 
21 inline double acosh(double x) {
22  if (is_nan(x)) {
23  return x;
24  } else {
25  check_greater_or_equal("acosh", "x", x, 1.0);
26 #ifdef _WIN32
27  if (is_inf(x))
28  return x;
29 #endif
30  return std::acosh(x);
31  }
32 }
33 
41 inline double acosh(int x) {
42  if (is_nan(x)) {
43  return x;
44  } else {
45  check_greater_or_equal("acosh", "x", x, 1);
46 #ifdef _WIN32
47  if (is_inf(x))
48  return x;
49 #endif
50  return std::acosh(x);
51  }
52 }
53 
54 } // namespace math
55 } // namespace stan
56 #endif
void check_greater_or_equal(const char *function, const char *name, const T_y &y, const T_low &low)
Check if y is greater or equal than low.
var acosh(const var &a)
The inverse hyperbolic cosine function for variables (C99).
Definition: acosh.hpp:61
int is_inf(const fvar< T > &x)
Returns 1 if the input&#39;s value is infinite and 0 otherwise.
Definition: is_inf.hpp:20
int is_nan(const fvar< T > &x)
Returns 1 if the input&#39;s value is NaN and 0 otherwise.
Definition: is_nan.hpp:20
fvar< T > acosh(const fvar< T > &x)
Definition: acosh.hpp:13

     [ Stan Home Page ] © 2011–2018, Stan Development Team.