Stan Math Library  2.20.0
reverse mode automatic differentiation
atanh.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_FUN_ATANH_HPP
2 #define STAN_MATH_PRIM_SCAL_FUN_ATANH_HPP
3 
7 #include <cmath>
8 
9 namespace stan {
10 namespace math {
11 
22 inline double atanh(double x) {
23  if (is_nan(x)) {
24  return x;
25  } else {
26  check_bounded("atanh", "x", x, -1.0, 1.0);
27  return std::atanh(x);
28  }
29 }
30 
38 inline double atanh(int x) {
39  if (is_nan(x)) {
40  return x;
41  } else {
42  check_bounded("atanh", "x", x, -1, 1);
43  return std::atanh(x);
44  }
45 }
46 
47 } // namespace math
48 } // namespace stan
49 #endif
fvar< T > atanh(const fvar< T > &x)
Return inverse hyperbolic tangent of specified value.
Definition: atanh.hpp:22
void check_bounded(const char *function, const char *name, const T_y &y, const T_low &low, const T_high &high)
Check if the value is between the low and high values, inclusively.
var atanh(const var &a)
The inverse hyperbolic tangent function for variables (C99).
Definition: atanh.hpp:58
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

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