Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:13:33

0001 //===----------------------------------------------------------------------===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef _LIBCPP___CXX03___MATH_GAMMA_H
0010 #define _LIBCPP___CXX03___MATH_GAMMA_H
0011 
0012 #include <__cxx03/__config>
0013 #include <__cxx03/__type_traits/enable_if.h>
0014 #include <__cxx03/__type_traits/is_integral.h>
0015 
0016 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0017 #  pragma GCC system_header
0018 #endif
0019 
0020 _LIBCPP_BEGIN_NAMESPACE_STD
0021 
0022 namespace __math {
0023 
0024 // lgamma
0025 
0026 inline _LIBCPP_HIDE_FROM_ABI float lgamma(float __x) _NOEXCEPT { return __builtin_lgammaf(__x); }
0027 
0028 template <class = int>
0029 _LIBCPP_HIDE_FROM_ABI double lgamma(double __x) _NOEXCEPT {
0030   return __builtin_lgamma(__x);
0031 }
0032 
0033 inline _LIBCPP_HIDE_FROM_ABI long double lgamma(long double __x) _NOEXCEPT { return __builtin_lgammal(__x); }
0034 
0035 template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
0036 inline _LIBCPP_HIDE_FROM_ABI double lgamma(_A1 __x) _NOEXCEPT {
0037   return __builtin_lgamma((double)__x);
0038 }
0039 
0040 // nan
0041 
0042 // tgamma
0043 
0044 inline _LIBCPP_HIDE_FROM_ABI float tgamma(float __x) _NOEXCEPT { return __builtin_tgammaf(__x); }
0045 
0046 template <class = int>
0047 _LIBCPP_HIDE_FROM_ABI double tgamma(double __x) _NOEXCEPT {
0048   return __builtin_tgamma(__x);
0049 }
0050 
0051 inline _LIBCPP_HIDE_FROM_ABI long double tgamma(long double __x) _NOEXCEPT { return __builtin_tgammal(__x); }
0052 
0053 template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
0054 inline _LIBCPP_HIDE_FROM_ABI double tgamma(_A1 __x) _NOEXCEPT {
0055   return __builtin_tgamma((double)__x);
0056 }
0057 
0058 } // namespace __math
0059 
0060 _LIBCPP_END_NAMESPACE_STD
0061 
0062 #endif // _LIBCPP___CXX03___MATH_GAMMA_H