7 #if defined(__cplusplus)
10 #pragma pack(push,_CRT_PACKING)
11 #pragma warning(push,3)
12 #pragma push_macro("new")
17 struct _Promote_to_float
20 double, _Ty>::type type;
25 struct _Common_float_type
27 typedef typename _Promote_to_float<_Ty1>::type _Ty1f;
28 typedef typename _Promote_to_float<_Ty2>::type _Ty2f;
33 float>::type>::type type;
38 #define _CRTSPECIAL _CRTIMP
40 #define _GENERIC_MATH1(FUN, CRTTYPE) \
41 extern "C" CRTTYPE double __cdecl FUN(_In_ double); \
42 template<class _Ty> inline \
43 typename _STD enable_if< _STD is_integral<_Ty>::value, double>::type \
46 return (_CSTD FUN((double)_Left)); \
49 #define _GENERIC_MATH1X(FUN, ARG2, CRTTYPE) \
50 extern "C" CRTTYPE double __cdecl FUN(_In_ double, ARG2); \
51 template<class _Ty> inline \
52 typename _STD enable_if< _STD is_integral<_Ty>::value, double>::type \
53 FUN(_Ty _Left, ARG2 _Arg2) \
55 return (_CSTD FUN((double)_Left, _Arg2)); \
58 #define _GENERIC_MATH2_CALL(FUN, CRTTYPE, CALL_OPT) \
59 extern "C" CRTTYPE double CALL_OPT FUN(_In_ double, _In_ double); \
60 template<class _Ty1, \
62 typename _STD enable_if< _STD _Is_numeric<_Ty1>::value \
63 && _STD _Is_numeric<_Ty2>::value, \
64 typename _STD _Common_float_type<_Ty1, _Ty2>::type>::type \
65 FUN(_Ty1 _Left, _Ty2 _Right) \
67 typedef typename _STD _Common_float_type<_Ty1, _Ty2>::type type; \
68 return (_CSTD FUN((type)_Left, (type)_Right)); \
71 #define _GENERIC_MATH2(FUN, CRTTYPE) \
72 _GENERIC_MATH2_CALL(FUN, CRTTYPE, __cdecl)
75 extern "C" double __cdecl
pow(
_In_ double,
_In_ double);
83 typename _STD _Common_float_type<_Ty1, _Ty2>::type>::type
86 typedef typename _STD _Common_float_type<_Ty1, _Ty2>::type type;
87 return (
_CSTD pow(type(_Left), type(_Right)));
91 _GENERIC_MATH1(
acos, _CRTDEFAULT)
92 _GENERIC_MATH1(
asin, _CRTDEFAULT)
93 _GENERIC_MATH1(
atan, _CRTDEFAULT)
94 _GENERIC_MATH2(
atan2, _CRTDEFAULT)
95 _GENERIC_MATH1(
ceil, _CRTSPECIAL)
96 _GENERIC_MATH1(
cos, _CRTDEFAULT)
97 _GENERIC_MATH1(
cosh, _CRTDEFAULT)
98 _GENERIC_MATH1(
exp, _CRTDEFAULT)
100 _GENERIC_MATH1(
floor, _CRTSPECIAL)
101 _GENERIC_MATH2(
fmod, _CRTDEFAULT)
102 _GENERIC_MATH1X(
frexp,
_Out_ int *, _CRTSPECIAL)
103 _GENERIC_MATH1X(
ldexp,
_In_ int, _CRTSPECIAL)
104 _GENERIC_MATH1(
log, _CRTDEFAULT)
105 _GENERIC_MATH1(
log10, _CRTDEFAULT)
108 _GENERIC_MATH1(
sin, _CRTDEFAULT)
109 _GENERIC_MATH1(
sinh, _CRTDEFAULT)
110 _GENERIC_MATH1(
sqrt, _CRTDEFAULT)
111 _GENERIC_MATH1(
tan, _CRTDEFAULT)
112 _GENERIC_MATH1(
tanh, _CRTDEFAULT)
114 #define _GENERIC_MATH1R(FUN, RET, CRTTYPE) \
115 extern "C" CRTTYPE RET __cdecl FUN(_In_ double); \
116 template<class _Ty> inline \
117 typename _STD enable_if< _STD is_integral<_Ty>::value, RET>::type \
120 return (_CSTD FUN((double)_Left)); \
124 inline float _Fma(
float _Left,
float _Middle,
float _Right)
126 return (
_CSTD fmaf(_Left, _Middle, _Right));
129 inline double _Fma(
double _Left,
double _Middle,
double _Right)
131 return (
_CSTD fma(_Left, _Middle, _Right));
134 inline long double _Fma(
long double _Left,
long double _Middle,
long double _Right)
136 return (
_CSTD fmal(_Left, _Middle, _Right));
142 typename _STD _Common_float_type<_Ty1,
143 typename _STD _Common_float_type<_Ty2, _Ty3>::type>::type
144 fma(_Ty1 _Left, _Ty2 _Middle, _Ty3 _Right)
146 typedef typename _STD _Common_float_type<_Ty1,
147 typename _STD _Common_float_type<_Ty2, _Ty3>::type>::type type;
148 return (_Fma((type)_Left, (type)_Middle, (type)_Right));
152 inline float _Remquo(
float _Left,
float _Right,
int *_Pquo)
157 inline double _Remquo(
double _Left,
double _Right,
int *_Pquo)
162 inline long double _Remquo(
long double _Left,
long double _Right,
int *_Pquo)
169 typename _STD _Common_float_type<_Ty1, _Ty2>::type
170 remquo(_Ty1 _Left, _Ty2 _Right,
int *_Pquo)
172 typedef typename _STD _Common_float_type<_Ty1, _Ty2>::type type;
173 return (_Remquo((type)_Left, (type)_Right, _Pquo));
176 _GENERIC_MATH1(
acosh, _CRTSPECIAL)
177 _GENERIC_MATH1(
asinh, _CRTSPECIAL)
178 _GENERIC_MATH1(
atanh, _CRTSPECIAL)
179 _GENERIC_MATH1(
cbrt, _CRTSPECIAL)
180 _GENERIC_MATH2(
copysign, _CRTSPECIAL)
181 _GENERIC_MATH1(
erf, _CRTSPECIAL)
182 _GENERIC_MATH1(
erfc, _CRTSPECIAL)
183 _GENERIC_MATH1(
expm1, _CRTSPECIAL)
184 _GENERIC_MATH1(
exp2, _CRTSPECIAL)
186 _GENERIC_MATH2(
fdim, _CRTSPECIAL)
188 _GENERIC_MATH2(
fmax, _CRTSPECIAL)
189 _GENERIC_MATH2(
fmin, _CRTSPECIAL)
191 _GENERIC_MATH1R(
ilogb,
int, _CRTSPECIAL)
192 _GENERIC_MATH1(
lgamma, _CRTSPECIAL)
193 _GENERIC_MATH1R(
llrint,
long long, _CRTSPECIAL)
194 _GENERIC_MATH1R(
llround,
long long, _CRTSPECIAL)
195 _GENERIC_MATH1(
log1p, _CRTSPECIAL)
196 _GENERIC_MATH1(
log2, _CRTSPECIAL)
197 _GENERIC_MATH1(
logb, _CRTSPECIAL)
198 _GENERIC_MATH1R(
lrint,
long, _CRTSPECIAL)
199 _GENERIC_MATH1R(
lround,
long, _CRTSPECIAL)
205 _GENERIC_MATH1(
rint, _CRTSPECIAL)
206 _GENERIC_MATH1(
round, _CRTSPECIAL)
208 _GENERIC_MATH1X(
scalbn,
_In_ int, _CRTSPECIAL)
209 _GENERIC_MATH1(
tgamma, _CRTSPECIAL)
210 _GENERIC_MATH1(
trunc, _CRTSPECIAL)
214 #pragma pop_macro("new")
#define _Out_
Definition: sal.h:351
#define _C_STD_BEGIN
Definition: yvals.h:557
float atan(float _X) __GPU_ONLY
Calculates the arctangent of the argument
Definition: amp_math.h:325
_CRTIMP double __cdecl fdim(_In_ double _X, _In_ double _Y)
_CRTIMP double __cdecl scalbn(_In_ double _X, _In_ int _Y)
_CRTIMP float __cdecl fmaf(_In_ float _X, _In_ float _Y, _In_ float _Z)
_CRTIMP double __cdecl copysign(_In_ double _X, _In_ double _Y)
_CRTIMP double __cdecl logb(_In_ double _X)
Definition: xtr1common:80
double __cdecl fmod(_In_ double _X, _In_ double _Y)
#define _STD_BEGIN
Definition: yvals.h:553
_CRTIMP long __cdecl lrint(_In_ double _X)
float sqrt(float _X) __GPU_ONLY
Calculates the squre root of the argument
Definition: amp_math.h:1100
_CRTIMP double __cdecl lgamma(_In_ double _X)
float atan2(float _Y, float _X) __GPU_ONLY
Calculates the arctangent of _Y/_X
Definition: amp_math.h:359
_CRTIMP double __cdecl log1p(_In_ double _X)
_CRTIMP double __cdecl fmax(_In_ double _X, _In_ double _Y)
float cosh(float _X) __GPU_ONLY
Calculates the hyperbolic cosine value of the argument
Definition: amp_math.h:443
float sin(float _X) __GPU_ONLY
Calculates the sine value of the argument
Definition: amp_math.h:1010
_CRTIMP double __cdecl ldexp(_In_ double _X, _In_ int _Y)
float exp(float _X) __GPU_ONLY
Calculates the base-e exponential of the argument
Definition: amp_math.h:471
_CRTIMP long double __cdecl fmal(_In_ long double _X, _In_ long double _Y, _In_ long double _Z)
#define _NOEXCEPT
Definition: yvals.h:25
_CRTIMP long long __cdecl llrint(_In_ double _X)
_CRTIMP double __cdecl erf(_In_ double _X)
float tanh(float _X) __GPU_ONLY
Calculates the hyperbolic tangent value of the argument
Definition: amp_math.h:1155
_CRTIMP double __cdecl floor(_In_ double _X)
_CRTIMP double __cdecl round(_In_ double _X)
_CRTIMP double __cdecl atanh(_In_ double _X)
_CRTIMP long __cdecl lround(_In_ double _X)
float sinh(float _X) __GPU_ONLY
Calculates the hyperbolic sine value of the argument
Definition: amp_math.h:1072
float log(float _X) __GPU_ONLY
Calculates the base-e logarithm of the argument
Definition: amp_math.h:774
#define _C_STD_END
Definition: yvals.h:558
_CRTIMP double __cdecl fmin(_In_ double _X, _In_ double _Y)
_CRTIMP double __cdecl log2(_In_ double _X)
#define _In_
Definition: sal.h:314
float acos(float _X) __GPU_ONLY
Calculates the arccosine of the argument
Definition: amp_math.h:269
Definition: xtr1common:66
_CRTIMP double __cdecl scalbln(_In_ double _X, _In_ long _Y)
_CRTIMP double __cdecl cbrt(_In_ double _X)
float asin(float _X) __GPU_ONLY
Calculates the arcsine of the argument
Definition: amp_math.h:297
_CRTIMP double __cdecl remainder(_In_ double _X, _In_ double _Y)
_CRTIMP double __cdecl erfc(_In_ double _X)
_CRTIMP double __cdecl frexp(_In_ double _X, _Out_ int *_Y)
float log10(float _X) __GPU_ONLY
Calculates the base-10 logarithm of the argument
Definition: amp_math.h:802
_CRTIMP double __cdecl asinh(_In_ double _X)
_CRTIMP double __cdecl nexttoward(_In_ double _X, _In_ long double _Y)
_CRTIMP double __cdecl rint(_In_ double _X)
#define __CRTDECL
Definition: crtdefs.h:622
float cos(float _X) __GPU_ONLY
Calculates the cosine of the argument
Definition: amp_math.h:415
#define _STD_END
Definition: yvals.h:554
_CRTIMP double __cdecl fma(_In_ double _X, _In_ double _Y, _In_ double _Z)
_CRTIMP double __cdecl remquo(_In_ double _X, _In_ double _Y, _Out_ int *_Z)
_CRTIMP double __cdecl exp2(_In_ double _X)
_CRTIMP double __cdecl nextafter(_In_ double _X, _In_ double _Y)
_CRTIMP double __cdecl ceil(_In_ double _X)
_CRTIMP double __cdecl acosh(_In_ double _X)
__inline double __CRTDECL hypot(_In_ double _X, _In_ double _Y)
Definition: math.h:555
Definition: xtr1common:94
#define _CSTD
Definition: yvals.h:559
_CRTIMP long double __cdecl remquol(_In_ long double _X, _In_ long double _Y, _Out_ int *_Z)
_CRTIMP long long __cdecl llround(_In_ double _X)
_CRTIMP double __cdecl expm1(_In_ double _X)
float tan(float _X) __GPU_ONLY
Calculates the tangent value of the argument
Definition: amp_math.h:1128
_CRTIMP float __cdecl remquof(_In_ float _X, _In_ float _Y, _Out_ int *_Z)
float pow(float _X, float _Y) __GPU_ONLY
Calculates _X raised to the power of _Y
Definition: amp_math.h:898
_CRTIMP double __cdecl nearbyint(_In_ double _X)
const _Ty & _Right
Definition: algorithm:4087
_CRTIMP double __cdecl tgamma(_In_ double _X)
Definition: xtr1common:306
_CRTIMP double __cdecl trunc(_In_ double _X)
_CRTIMP int __cdecl ilogb(_In_ double _X)