/usr/include/cppad/local/acosh.hpp is in cppad 2016.00.00.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | // $Id$
# ifndef CPPAD_ACOSH_HPP
# define CPPAD_ACOSH_HPP
/* --------------------------------------------------------------------------
CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell
CppAD is distributed under multiple licenses. This distribution is under
the terms of the
GNU General Public License Version 3.
A copy of this license is included in the COPYING file of this distribution.
Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
-------------------------------------------------------------------------- */
/*
-------------------------------------------------------------------------------
$begin acosh$$
$spell
acosh
const
Vec
std
cmath
CppAD
$$
$section The Inverse Hyperbolic Cosine Function: acosh$$
$head Syntax$$
$icode%y% = acosh(%x%)%$$
$head Description$$
The inverse hyperbolic cosine function is defined by
$icode%x% == cosh(%y%)%$$.
$head x, y$$
See the $cref/possible types/unary_standard_math/Possible Types/$$
for a unary standard math function.
$head CPPAD_USE_CPLUSPLUS_2011$$
$subhead true$$
If this preprocessor symbol is true ($code 1$$),
and $icode x$$ is an AD type,
this is an $cref/atomic operation/glossary/Operation/Atomic/$$.
$subhead false$$
If this preprocessor symbol is false ($code 0$$),
CppAD uses the representation
$latex \[
\R{acosh} (x) = \log \left( x + \sqrt{ x^2 - 1 } \right)
\] $$
to compute this function.
$head Example$$
$children%
example/acosh.cpp
%$$
The file
$cref acosh.cpp$$
contains an example and test of this function.
It returns true if it succeeds and false otherwise.
$end
-------------------------------------------------------------------------------
*/
# include <cppad/configure.hpp>
# if ! CPPAD_USE_CPLUSPLUS_2011
// BEGIN CppAD namespace
namespace CppAD {
template <class Type>
Type acosh_template(const Type &x)
{ return CppAD::log( x + CppAD::sqrt( x * x - Type(1) ) );
}
inline float acosh(const float &x)
{ return acosh_template(x); }
inline double acosh(const double &x)
{ return acosh_template(x); }
template <class Base>
inline AD<Base> acosh(const AD<Base> &x)
{ return acosh_template(x); }
template <class Base>
inline AD<Base> acosh(const VecAD_reference<Base> &x)
{ return acosh_template( x.ADBase() ); }
} // END CppAD namespace
# endif // CPPAD_USE_CPLUSPLUS_2011
# endif // CPPAD_ACOSH_INCLUDED
|