diff options
author | Erik Schnetter <schnetter@gmail.com> | 2011-11-29 11:49:30 -0500 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2011-11-29 13:50:56 -0500 |
commit | c9ec36148e7d255006d732fb16c00c6a64cfa4c9 (patch) | |
tree | 7ea47ec63f4821b6b1dc354fb4918f9db0200540 /Auxiliary | |
parent | 954963c1b3dd9252f835f675e59c8a1ff0b471ae (diff) |
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.
Diffstat (limited to 'Auxiliary')
-rw-r--r-- | Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h | 33 |
1 files changed, 1 insertions, 32 deletions
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)) |