From c9ec36148e7d255006d732fb16c00c6a64cfa4c9 Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Tue, 29 Nov 2011 11:49:30 -0500 Subject: Replace almost all functions Sin[x] etc. with their C names sin(x) etc. Replace almost all functions Sin[x] etc. with their C names sin(x) etc. already in Kranc instead of via the C preprocessor, because this allows more optimizations in Kranc. Implement some of these optimizations. --- .../GenericFD/src/MathematicaCompat.h | 33 +--------------------- 1 file changed, 1 insertion(+), 32 deletions(-) (limited to 'Auxiliary/Cactus/KrancNumericalTools/GenericFD/src') diff --git a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h index ed63362..0be42d3 100644 --- a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h +++ b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h @@ -1,44 +1,13 @@ - -#define Power(x, y) (pow(x,y)) -#define Sqrt(x) (sqrt(x)) - - #ifdef KRANC_C -# define Abs(x) (fabs(x)) -# define Min(x, y) (fmin(x,y)) -# define Max(x, y) (fmax(x,y)) # define IfThen(x,y,z) ((x) ? (y) : (z)) #else # define Abs(x) (abs(x)) # define Min(x, y) (min(x,y)) # define Max(x, y) (max(x,y)) +# define Sqrt(x) (sqrt(x)) # define IfThen(x,y,z) ((x)*(y) + (1-(x))*(z)) #endif -#define Exp(x) (exp(x)) -#define Log(x) (log(x)) - -#define Sin(x) (sin(x)) -#define Cos(x) (cos(x)) -#define Tan(x) (tan(x)) -#define Sec(x) (1.0/cos(x)) -#define Csc(x) (1.0/sin(x)) -#define Cot(x) (1.0/tan(x)) - -#define ArcSin(x) (asin(x)) -#define ArcCos(x) (acos(x)) -#define ArcTan(x) (atan(x)) -#define ArcSec(x) (cos(1.0/(x))) -#define ArcCsc(x) (sin(1.0/(x))) -#define ArcCot(x) (tan(1.0/(x))) - -#define Sinh(x) (sinh(x)) -#define Cosh(x) (cosh(x)) -#define Tanh(x) (tanh(x)) -#define Sech(x) (1.0/cosh(x)) -#define Csch(x) (1.0/sinh(x)) -#define Coth(x) (1.0/tanh(x)) - #ifdef KRANC_C # define Sign(x) (copysign(1.0,(x))) # define ToReal(x) ((CCTK_REAL)(x)) -- cgit v1.2.3