asinh.hpp 984 B

1234567891011121314151617181920212223242526272829303132
  1. // (C) Copyright John Maddock 2005.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef BOOST_MATH_COMPLEX_ASINH_INCLUDED
  6. #define BOOST_MATH_COMPLEX_ASINH_INCLUDED
  7. #ifndef BOOST_MATH_COMPLEX_DETAILS_INCLUDED
  8. # include <boost/math/complex/details.hpp>
  9. #endif
  10. #ifndef BOOST_MATH_COMPLEX_ASIN_INCLUDED
  11. # include <boost/math/complex/asin.hpp>
  12. #endif
  13. namespace boost{ namespace math{
  14. template<class T>
  15. inline std::complex<T> asinh(const std::complex<T>& x)
  16. {
  17. //
  18. // We use asinh(z) = i asin(-i z);
  19. // Note that C99 defines this the other way around (which is
  20. // to say asin is specified in terms of asinh), this is consistent
  21. // with C99 though:
  22. //
  23. return ::boost::math::detail::mult_i(::boost::math::asin(::boost::math::detail::mult_minus_i(x)));
  24. }
  25. } } // namespaces
  26. #endif // BOOST_MATH_COMPLEX_ASINH_INCLUDED