//! *this file is freware. Use it at your own risk. //! @file hyp.hpp //! @author Dejan D. M. Milosavljevic //! @version 1.0 //! @date 2003 //! Missig hyperbolic functions from standard math library. //! *this file is freware. Use it at your own risk. #ifndef Dh_DDMRM_hyp_HPP_ #define Dh_DDMRM_hyp_HPP_ #include //namespace S_DDMRM //{ //namespace S_math //{ template< typename N_number > inline N_number asinh ( N_number const& x ) { return N_number( log( x+sqrt(x*x+ N_number(1)) ) ); } template< typename N_number > inline N_number acosh ( N_number const& x ) { return N_number( log( x+sqrt(x*x- N_number(1)) ) ); } template< typename N_number > inline N_number atanh ( N_number const& x ) { return N_number( log(( N_number(1)+x)/( N_number(1)-x))/ N_number(2) ); } template< typename N_number > inline N_number sech ( N_number const& x ) { return N_number( N_number(1)/sinh(x) ); } template< typename N_number > inline N_number asech ( N_number const& x ) { return N_number( asinh( N_number(1)/x) ); } template< typename N_number > inline N_number csech ( N_number const& x ) { return N_number( N_number(1)/cosh(x) ); } template< typename N_number > inline N_number acsech ( N_number const& x ) { return N_number( acosh( N_number(1)/x) ); } template< typename N_number > inline N_number ctanh( N_number const& x ) { N_number a = N_number( exp(x) ), b=N_number( exp(-x) ); // optimal ??? return (a+b)/(a-b); } template< typename N_number > inline N_number actanh ( N_number const& x ) { return N_number( 0.5 ) * N_number( log( ( x + N_number(1) ) / ( x - N_number(1) ) ) ); } // } // } #endif