1
#ifndef NUMEXPR_MSVC_FUNCTION_STUBS_HPP
2
#define NUMEXPR_MSVC_FUNCTION_STUBS_HPP
4
/*********************************************************************
5
Numexpr - Fast numerical array expression evaluator for NumPy.
8
Author: See AUTHORS.txt
10
See LICENSE.txt for details about copyright and rights to use.
11
**********************************************************************/
13
/* Declare stub functions for MSVC. It turns out that single precision
14
definitions in <math.h> are actually #define'd and are not usable
15
as function pointers :-/ */
17
#if _MSC_VER < 1400 // 1310 == MSVC 7.1
18
/* Apparently, single precision functions are not included in MSVC 7.1 */
20
#define sqrtf(x) ((float)sqrt((double)(x)))
21
#define sinf(x) ((float)sin((double)(x)))
22
#define cosf(x) ((float)cos((double)(x)))
23
#define tanf(x) ((float)tan((double)(x)))
24
#define asinf(x) ((float)asin((double)(x)))
25
#define acosf(x) ((float)acos((double)(x)))
26
#define atanf(x) ((float)atan((double)(x)))
27
#define sinhf(x) ((float)sinh((double)(x)))
28
#define coshf(x) ((float)cosh((double)(x)))
29
#define tanhf(x) ((float)tanh((double)(x)))
30
#define asinhf(x) ((float)asinh((double)(x)))
31
#define acoshf(x) ((float)acosh((double)(x)))
32
#define atanhf(x) ((float)atanh((double)(x)))
33
#define logf(x) ((float)log((double)(x)))
34
#define log1pf(x) ((float)log1p((double)(x)))
35
#define log10f(x) ((float)log10((double)(x)))
36
#define expf(x) ((float)exp((double)(x)))
37
#define expm1f(x) ((float)expm1((double)(x)))
38
#define fabsf(x) ((float)fabs((double)(x)))
39
#define fmodf(x, y) ((float)fmod((double)(x), (double)(y)))
40
#define atan2f(x, y) ((float)atan2((double)(x), (double)(y)))
42
/* The next are directly called from interp_body.cpp */
43
#define powf(x, y) ((float)pow((double)(x), (double)(y)))
44
#define floorf(x) ((float)floor((double)(x)))
46
#endif // _MSC_VER < 1400
49
/* Now the actual stubs */
51
inline float sqrtf2(float x) {
55
inline float sinf2(float x) {
59
inline float cosf2(float x) {
63
inline float tanf2(float x) {
67
inline float asinf2(float x) {
71
inline float acosf2(float x) {
75
inline float atanf2(float x) {
79
inline float sinhf2(float x) {
83
inline float coshf2(float x) {
87
inline float tanhf2(float x) {
91
inline float asinhf2(float x) {
95
inline float acoshf2(float x) {
99
inline float atanhf2(float x) {
103
inline float logf2(float x) {
107
inline float log1pf2(float x) {
111
inline float log10f2(float x) {
115
inline float expf2(float x) {
119
inline float expm1f2(float x) {
123
inline float fabsf2(float x) {
127
inline float fmodf2(float x, float y) {
131
inline float atan2f2(float x, float y) {
135
#endif // NUMEXPR_MSVC_FUNCTION_STUBS_HPP