5#include "_vectorize.hpp"
16 template<
typename genType>
17 genType log2(genType Value)
19 return std::log(Value) *
static_cast<genType
>(1.4426950408889634073599246810019);
23 template<length_t L,
typename T, qualifier Q,
bool isFloat,
bool Aligned>
28 GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559,
"'log2' only accept floating-point inputs. Include <glm/gtc/integer.hpp> for integer inputs.");
34 template<length_t L,
typename T, qualifier Q,
bool Aligned>
43 template<length_t L,
typename T, qualifier Q,
bool Aligned>
48 return static_cast<T
>(1) /
sqrt(x);
52 template<length_t L,
bool Aligned>
63 tmp = tmp * (1.5f - xhalf * tmp * tmp);
71 template<length_t L,
typename T, qualifier Q>
79 template<length_t L,
typename T, qualifier Q>
87 template<length_t L,
typename T, qualifier Q>
97 template<
typename genType>
98 GLM_FUNC_QUALIFIER genType exp2(genType x)
100 GLM_STATIC_ASSERT(std::numeric_limits<genType>::is_iec559,
"'exp2' only accept floating-point inputs");
102 return std::exp(
static_cast<genType
>(0.69314718055994530941723212145818) * x);
106 template<length_t L,
typename T, qualifier Q>
113 template<
typename genType>
114 GLM_FUNC_QUALIFIER genType log2(genType x)
116 return log2(vec<1, genType>(x)).x;
119 template<length_t L,
typename T, qualifier Q>
127 template<length_t L,
typename T, qualifier Q>
130 GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559,
"'sqrt' only accept floating-point inputs");
135 template<
typename genType>
136 GLM_FUNC_QUALIFIER genType inversesqrt(genType x)
138 return static_cast<genType
>(1) /
sqrt(x);
141 template<length_t L,
typename T, qualifier Q>
144 GLM_STATIC_ASSERT(std::numeric_limits<T>::is_iec559,
"'inversesqrt' only accept floating-point inputs");
149#if GLM_CONFIG_SIMD == GLM_ENABLE
GLM_FUNC_QUALIFIER vec< L, T, Q > sqrt(vec< L, T, Q > const &x)
Definition func_exponential.inl:128
GLM_FUNC_QUALIFIER vec< L, T, Q > pow(vec< L, T, Q > const &base, vec< L, T, Q > const &exponent)
Definition func_exponential.inl:72
GLM_FUNC_QUALIFIER vec< L, T, Q > log(vec< L, T, Q > const &x)
Definition func_exponential.inl:88
GLM_FUNC_QUALIFIER vec< L, T, Q > exp(vec< L, T, Q > const &x)
Definition func_exponential.inl:80
detail namespace with internal helper functions
Definition json.h:249
Core features
Definition common.hpp:21
@ lowp
By default lowp qualifier is also packed.
Definition qualifier.hpp:23
Definition func_exponential.inl:45
Definition func_exponential.inl:25
Definition func_exponential.inl:36
Definition _vectorize.hpp:7
Definition _vectorize.hpp:46
Definition qualifier.hpp:60
Definition qualifier.hpp:35