Stan Math Library
2.20.0
reverse mode automatic differentiation
stan
math
prim
scal
fun
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
4
#include <
stan/math/prim/meta.hpp
>
5
#include <
stan/math/prim/scal/fun/is_nan.hpp
>
6
#include <
stan/math/prim/scal/err/check_bounded.hpp
>
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
stan::math::atanh
fvar< T > atanh(const fvar< T > &x)
Return inverse hyperbolic tangent of specified value.
Definition:
atanh.hpp:22
stan::math::check_bounded
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.
Definition:
check_bounded.hpp:70
is_nan.hpp
stan
Definition:
log_sum_exp.hpp:8
meta.hpp
stan::math::atanh
var atanh(const var &a)
The inverse hyperbolic tangent function for variables (C99).
Definition:
atanh.hpp:58
check_bounded.hpp
stan::math::is_nan
int is_nan(const fvar< T > &x)
Returns 1 if the input's value is NaN and 0 otherwise.
Definition:
is_nan.hpp:20
[
Stan Home Page
]
© 2011–2018, Stan Development Team.