4#ifndef TETL_CMATH_TANH_HPP
5#define TETL_CMATH_TANH_HPP
7#include <etl/_config/all.hpp>
9#include <etl/_3rd_party/gcem/gcem.hpp>
10#include <etl/_concepts/integral.hpp>
11#include <etl/_concepts/same_as.hpp>
12#include <etl/_type_traits/is_constant_evaluated.hpp>
18inline constexpr struct tanh {
19 template <
typename Float>
20 [[nodiscard]]
constexpr auto operator()(Float arg)
const noexcept -> Float
23#if __has_builtin(__builtin_tanhf)
24 if constexpr (
etl::same_as<Float,
float>) {
25 return __builtin_tanhf(arg);
28#if __has_builtin(__builtin_tanh)
29 if constexpr (
etl::same_as<Float,
double>) {
30 return __builtin_tanh(arg);
34 return etl::detail::gcem::tanh(arg);
47 return etl::detail::tanh(arg);
51 return etl::detail::tanh(arg);
55 return etl::detail::tanh(arg);
57[[
nodiscard]]
constexpr auto tanh(
long double arg)
noexcept ->
long double
59 return etl::detail::tanh(arg);
63 return etl::detail::tanh(arg);
constexpr auto tanh(float arg) noexcept -> float
Definition tanh.hpp:45
constexpr auto tanhf(float arg) noexcept -> float
Definition tanh.hpp:49
constexpr auto tanh(double arg) noexcept -> double
Definition tanh.hpp:53
constexpr auto tanhl(long double arg) noexcept -> long double
Definition tanh.hpp:61
constexpr auto tanh(long double arg) noexcept -> long double
Definition tanh.hpp:57
Definition adjacent_find.hpp:9
constexpr auto is_constant_evaluated() noexcept -> bool
Detects whether the function call occurs within a constant-evaluated context. Returns true if the eva...
Definition is_constant_evaluated.hpp:17