Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ log_cosh() [2/5]

template<typename T , require_arithmetic_t< T > * = nullptr>
double stan::math::log_cosh ( T  x)
inline

Return the natural logarithm of the hyperbolic cosine of the argument, from expm1 for |x| < 1 and from exp(-|x|) above, so that neither branch subtracts two nearly equal numbers or overflows.

The derivative is tanh(x).

Template Parameters
Tarithmetic type
Parameters
xargument
Returns
log(cosh(x))

Definition at line 26 of file log_cosh.hpp.