Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:45:16

0001 //  (C) Copyright John Maddock 2005.
0002 //  Use, modification and distribution are subject to the
0003 //  Boost Software License, Version 1.0. (See accompanying file
0004 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 #ifndef BOOST_MATH_COMPLEX_ATAN_INCLUDED
0007 #define BOOST_MATH_COMPLEX_ATAN_INCLUDED
0008 
0009 #ifndef BOOST_MATH_COMPLEX_DETAILS_INCLUDED
0010 #  include <boost/math/complex/details.hpp>
0011 #endif
0012 #ifndef BOOST_MATH_COMPLEX_ATANH_INCLUDED
0013 #  include <boost/math/complex/atanh.hpp>
0014 #endif
0015 
0016 namespace boost{ namespace math{
0017 
0018 template<class T> 
0019 [[deprecated("Replaced by C++11")]] std::complex<T> atan(const std::complex<T>& x)
0020 {
0021    //
0022    // We're using the C99 definition here; atan(z) = -i atanh(iz):
0023    //
0024    if(x.real() == 0)
0025    {
0026       if(x.imag() == 1)
0027          return std::complex<T>(0, std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity() : static_cast<T>(HUGE_VAL));
0028       if(x.imag() == -1)
0029          return std::complex<T>(0, std::numeric_limits<T>::has_infinity ? -std::numeric_limits<T>::infinity() : -static_cast<T>(HUGE_VAL));
0030    }
0031    return ::boost::math::detail::mult_minus_i(::boost::math::atanh(::boost::math::detail::mult_i(x)));
0032 }
0033 
0034 } } // namespaces
0035 
0036 #endif // BOOST_MATH_COMPLEX_ATAN_INCLUDED