File indexing completed on 2026-05-03 08:13:54
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef _LIBCPP___MATH_INVERSE_TRIGONOMETRIC_FUNCTIONS_H
0010 #define _LIBCPP___MATH_INVERSE_TRIGONOMETRIC_FUNCTIONS_H
0011
0012 #include <__config>
0013 #include <__type_traits/enable_if.h>
0014 #include <__type_traits/is_arithmetic.h>
0015 #include <__type_traits/is_integral.h>
0016 #include <__type_traits/is_same.h>
0017 #include <__type_traits/promote.h>
0018
0019 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0020 # pragma GCC system_header
0021 #endif
0022
0023 _LIBCPP_BEGIN_NAMESPACE_STD
0024
0025 namespace __math {
0026
0027
0028
0029 inline _LIBCPP_HIDE_FROM_ABI float acos(float __x) _NOEXCEPT { return __builtin_acosf(__x); }
0030
0031 template <class = int>
0032 _LIBCPP_HIDE_FROM_ABI double acos(double __x) _NOEXCEPT {
0033 return __builtin_acos(__x);
0034 }
0035
0036 inline _LIBCPP_HIDE_FROM_ABI long double acos(long double __x) _NOEXCEPT { return __builtin_acosl(__x); }
0037
0038 template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
0039 inline _LIBCPP_HIDE_FROM_ABI double acos(_A1 __x) _NOEXCEPT {
0040 return __builtin_acos((double)__x);
0041 }
0042
0043
0044
0045 inline _LIBCPP_HIDE_FROM_ABI float asin(float __x) _NOEXCEPT { return __builtin_asinf(__x); }
0046
0047 template <class = int>
0048 _LIBCPP_HIDE_FROM_ABI double asin(double __x) _NOEXCEPT {
0049 return __builtin_asin(__x);
0050 }
0051
0052 inline _LIBCPP_HIDE_FROM_ABI long double asin(long double __x) _NOEXCEPT { return __builtin_asinl(__x); }
0053
0054 template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
0055 inline _LIBCPP_HIDE_FROM_ABI double asin(_A1 __x) _NOEXCEPT {
0056 return __builtin_asin((double)__x);
0057 }
0058
0059
0060
0061 inline _LIBCPP_HIDE_FROM_ABI float atan(float __x) _NOEXCEPT { return __builtin_atanf(__x); }
0062
0063 template <class = int>
0064 _LIBCPP_HIDE_FROM_ABI double atan(double __x) _NOEXCEPT {
0065 return __builtin_atan(__x);
0066 }
0067
0068 inline _LIBCPP_HIDE_FROM_ABI long double atan(long double __x) _NOEXCEPT { return __builtin_atanl(__x); }
0069
0070 template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
0071 inline _LIBCPP_HIDE_FROM_ABI double atan(_A1 __x) _NOEXCEPT {
0072 return __builtin_atan((double)__x);
0073 }
0074
0075
0076
0077 inline _LIBCPP_HIDE_FROM_ABI float atan2(float __y, float __x) _NOEXCEPT { return __builtin_atan2f(__y, __x); }
0078
0079 template <class = int>
0080 _LIBCPP_HIDE_FROM_ABI double atan2(double __x, double __y) _NOEXCEPT {
0081 return __builtin_atan2(__x, __y);
0082 }
0083
0084 inline _LIBCPP_HIDE_FROM_ABI long double atan2(long double __y, long double __x) _NOEXCEPT {
0085 return __builtin_atan2l(__y, __x);
0086 }
0087
0088 template <class _A1, class _A2, __enable_if_t<is_arithmetic<_A1>::value && is_arithmetic<_A2>::value, int> = 0>
0089 inline _LIBCPP_HIDE_FROM_ABI typename __promote<_A1, _A2>::type atan2(_A1 __y, _A2 __x) _NOEXCEPT {
0090 using __result_type = typename __promote<_A1, _A2>::type;
0091 static_assert(!(_IsSame<_A1, __result_type>::value && _IsSame<_A2, __result_type>::value), "");
0092 return __math::atan2((__result_type)__y, (__result_type)__x);
0093 }
0094
0095 }
0096
0097 _LIBCPP_END_NAMESPACE_STD
0098
0099 #endif