11 #ifndef INCLUDED_IMATHMATH_H
12 #define INCLUDED_IMATHMATH_H
19 IMATH_INTERNAL_NAMESPACE_HEADER_ENTER
37 template <
class T>
struct Math
41 static
T acos (
T x) {
return std::acos (x); }
45 static
T asin (
T x) {
return std::asin (x); }
49 static
T atan (
T x) {
return std::atan (x); }
53 static
T atan2 (
T x,
T y) {
return std::atan2 (x, y); }
57 static
T cos (
T x) {
return std::cos (x); }
61 static
T sin (
T x) {
return std::sin (x); }
65 static
T tan (
T x) {
return std::tan (x); }
69 static
T cosh (
T x) {
return std::cosh (x); }
73 static
T sinh (
T x) {
return std::sinh (x); }
77 static
T tanh (
T x) {
return std::tanh (x); }
81 static
T exp (
T x) {
return std::exp (x); }
89 static
T log10 (
T x) {
return std::log10 (x); }
93 static
T modf (
T x,
T* iptr)
96 T rval (std::modf (
T (x), &ival));
115 static
T fabs (
T x) {
return std::fabs (x); }
123 static
T fmod (
T x,
T y) {
return std::fmod (x, y); }
127 static
T hypot (
T x,
T y) {
return std::hypot (x, y); }
137 if (x * x < std::numeric_limits<T>::epsilon ())
140 return std::sin (x) /
x;
153 return ((x1 >
x2) ? x1 -
x2 :
x2 - x1) <= e;
166 return ((x1 >
x2) ? x1 -
x2 :
x2 - x1) <= e * ((x1 > 0) ? x1 : -x1);
169 IMATH_INTERNAL_NAMESPACE_HEADER_EXIT
171 #endif // INCLUDED_IMATHMATH_H
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool equalWithAbsError(T x1, T x2, T e) IMATH_NOEXCEPT
IMATH_HOSTDEVICE constexpr int floor(T x) IMATH_NOEXCEPT
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool equalWithRelError(T x1, T x2, T e) IMATH_NOEXCEPT
vfloat4 sqrt(const vfloat4 &a)
ImageBuf OIIO_API pow(const ImageBuf &A, cspan< float > B, ROI roi={}, int nthreads=0)
IMATH_HOSTDEVICE constexpr int ceil(T x) IMATH_NOEXCEPT
#define IMATH_DEPRECATED(msg)
IMATH_INTERNAL_NAMESPACE_HEADER_ENTER IMATH_HOSTDEVICE T sinx_over_x(T x)
OIIO_FORCEINLINE T log(const T &v)