27#ifndef _gcem_hypot_HPP
28#define _gcem_hypot_HPP
46 T a = std::max(
abs(x),
abs(y));
48 return a *
sqrt((x / a) * (x / a) + (y / a) * (y / a));
62 return a *
sqrt((x / a) * (x / a) + (y / a) * (y / a) + (z / a) * (z / a));
116template<
typename T1,
typename T2,
typename TC = common_return_t<T1,T2>>
125template<
typename T1,
typename T2,
typename T3,
typename TC = common_return_t<T1,T2,T3>>
131 return hypot_vals_check(
static_cast<TC
>(x),
static_cast<TC
>(y),
static_cast<TC
>(z));
144template<
typename T1,
typename T2>
150 if (std::is_constant_evaluated()) {
153 return std::hypot(x, y);
166template<
typename T1,
typename T2,
typename T3>
169hypot(
const T1 x,
const T2 y,
const T3 z)
172 if (std::is_constant_evaluated()) {
175 return std::hypot(x, y, z);
constexpr TC hypot_type_check(const T1 x, const T2 y) noexcept
Definition hypot.hpp:119
constexpr bool any_nan(const T1 x, const T2 y) noexcept
Definition is_nan.hpp:48
constexpr T hypot_compute(const T x, const T y) noexcept
Definition hypot.hpp:43
constexpr T hypot_vals_check(const T x, const T y) noexcept
Definition hypot.hpp:71
constexpr bool any_inf(const T1 x, const T2 y) noexcept
Definition is_inf.hpp:140
constexpr T abs(const T x) noexcept
Compile-time absolute value function.
Definition abs.hpp:40
std::numeric_limits< T > GCLIM
Definition gcem_options.hpp:74
constexpr common_return_t< T1, T2 > hypot(const T1 x, const T2 y) noexcept
Compile-time Pythagorean addition function.
Definition hypot.hpp:147
constexpr return_t< T > sqrt(const T x) noexcept
Compile-time square-root function.
Definition sqrt.hpp:109
return_t< common_t< T... > > common_return_t
Definition gcem_options.hpp:83