Path: blob/main/contrib/llvm-project/libcxx/include/__math/hyperbolic_functions.h
35233 views
//===----------------------------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef _LIBCPP___MATH_HYPERBOLIC_FUNCTIONS_H9#define _LIBCPP___MATH_HYPERBOLIC_FUNCTIONS_H1011#include <__config>12#include <__type_traits/enable_if.h>13#include <__type_traits/is_integral.h>1415#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)16# pragma GCC system_header17#endif1819_LIBCPP_BEGIN_NAMESPACE_STD2021namespace __math {2223// cosh2425inline _LIBCPP_HIDE_FROM_ABI float cosh(float __x) _NOEXCEPT { return __builtin_coshf(__x); }2627template <class = int>28_LIBCPP_HIDE_FROM_ABI double cosh(double __x) _NOEXCEPT {29return __builtin_cosh(__x);30}3132inline _LIBCPP_HIDE_FROM_ABI long double cosh(long double __x) _NOEXCEPT { return __builtin_coshl(__x); }3334template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>35inline _LIBCPP_HIDE_FROM_ABI double cosh(_A1 __x) _NOEXCEPT {36return __builtin_cosh((double)__x);37}3839// sinh4041inline _LIBCPP_HIDE_FROM_ABI float sinh(float __x) _NOEXCEPT { return __builtin_sinhf(__x); }4243template <class = int>44_LIBCPP_HIDE_FROM_ABI double sinh(double __x) _NOEXCEPT {45return __builtin_sinh(__x);46}4748inline _LIBCPP_HIDE_FROM_ABI long double sinh(long double __x) _NOEXCEPT { return __builtin_sinhl(__x); }4950template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>51inline _LIBCPP_HIDE_FROM_ABI double sinh(_A1 __x) _NOEXCEPT {52return __builtin_sinh((double)__x);53}5455// tanh5657inline _LIBCPP_HIDE_FROM_ABI float tanh(float __x) _NOEXCEPT { return __builtin_tanhf(__x); }5859template <class = int>60_LIBCPP_HIDE_FROM_ABI double tanh(double __x) _NOEXCEPT {61return __builtin_tanh(__x);62}6364inline _LIBCPP_HIDE_FROM_ABI long double tanh(long double __x) _NOEXCEPT { return __builtin_tanhl(__x); }6566template <class _A1, __enable_if_t<is_integral<_A1>::value, int> = 0>67inline _LIBCPP_HIDE_FROM_ABI double tanh(_A1 __x) _NOEXCEPT {68return __builtin_tanh((double)__x);69}7071} // namespace __math7273_LIBCPP_END_NAMESPACE_STD7475#endif // _LIBCPP___MATH_HYPERBOLIC_FUNCTIONS_H767778