diff options
Diffstat (limited to 'Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h')
-rw-r--r-- | Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h index ee6a3b7..2f00da9 100644 --- a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h +++ b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h @@ -31,13 +31,15 @@ #define Tanh(x) (tanh(x)) #ifdef KRANC_C -# define Sign(x) ((x)<0?-1:+1) +# define Sign(x) (copysign(1.0,(x))) # define ToReal(x) ((CCTK_REAL)(x)) #else # define Sign(x) (sgn(x)) # define ToReal(x) (real((x),kind(khalf))) #endif +#if 0 + /* TODO: use fma(x,y,z) to implement fmadd and friends? Note that fma may be unsupported, or may be slow. */ @@ -46,6 +48,7 @@ /* #define fnmadd(x,y,z) (-(z)-(x)*(y)) */ /* #define fnmsub(x,y,z) (+(z)-(x)*(y)) */ +#define fpos(x) (+(x)) #define fneg(x) (-(x)) #define fmul(x,y) ((x)*(y)) #define fdiv(x,y) ((x)/(y)) @@ -65,6 +68,8 @@ #define kpow(x,y) (pow(x,y)) #define ksqrt(x) (sqrt(x)) +#endif + #ifdef KRANC_C # define E M_E # define Pi M_PI |