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_ERROR_FUNCTIONS_H
0010 #define _LIBCPP___CXX03___MATH_ERROR_FUNCTIONS_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 // erf
0025 
0026 inline _LIBCPP_HIDE_FROM_ABI float erf(float __x) _NOEXCEPT { return __builtin_erff(__x); }
0027 
0028 template <class = int>
0029 _LIBCPP_HIDE_FROM_ABI double erf(double __x) _NOEXCEPT {
0030   return __builtin_erf(__x);
0031 }
0032 
0033 inline _LIBCPP_HIDE_FROM_ABI long double erf(long double __x) _NOEXCEPT { return __builtin_erfl(__x); }
0034 
0035 template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
0036 inline _LIBCPP_HIDE_FROM_ABI double erf(_A1 __x) _NOEXCEPT {
0037   return __builtin_erf((double)__x);
0038 }
0039 
0040 // erfc
0041 
0042 inline _LIBCPP_HIDE_FROM_ABI float erfc(float __x) _NOEXCEPT { return __builtin_erfcf(__x); }
0043 
0044 template <class = int>
0045 _LIBCPP_HIDE_FROM_ABI double erfc(double __x) _NOEXCEPT {
0046   return __builtin_erfc(__x);
0047 }
0048 
0049 inline _LIBCPP_HIDE_FROM_ABI long double erfc(long double __x) _NOEXCEPT { return __builtin_erfcl(__x); }
0050 
0051 template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>
0052 inline _LIBCPP_HIDE_FROM_ABI double erfc(_A1 __x) _NOEXCEPT {
0053   return __builtin_erfc((double)__x);
0054 }
0055 
0056 } // namespace __math
0057 
0058 _LIBCPP_END_NAMESPACE_STD
0059 
0060 #endif // _LIBCPP___CXX03___MATH_ERROR_FUNCTIONS_H