diff options
author | Ian Hinder <ian.hinder@aei.mpg.de> | 2011-11-19 19:38:59 +0100 |
---|---|---|
committer | Ian Hinder <ian.hinder@aei.mpg.de> | 2011-11-19 19:38:59 +0100 |
commit | 5f1fc1a60dff75d4b231dca92efa6e94080fa583 (patch) | |
tree | dd51a1854922ce16ae8249a48f4a8d2a16beec7a | |
parent | beb854b56cd60ec97072d709a064eeafe1633ed1 (diff) |
Add two-argument ArcTan function
-rw-r--r-- | Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h | 1 | ||||
-rw-r--r-- | Tools/CodeGen/CodeGenCactus.m | 1 | ||||
-rw-r--r-- | Tools/CodeGen/Kranc.m | 2 |
3 files changed, 3 insertions, 1 deletions
diff --git a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h index 25ec32c..4be6216 100644 --- a/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h +++ b/Auxiliary/Cactus/KrancNumericalTools/GenericFD/src/MathematicaCompat.h @@ -25,6 +25,7 @@ #define ArcSin(x) (asin(x)) #define ArcCos(x) (acos(x)) #define ArcTan(x) (atan(x)) +#define ArcTan2(x,y) (atan2(y,x)) #define Sinh(x) (sinh(x)) #define Cosh(x) (cosh(x)) diff --git a/Tools/CodeGen/CodeGenCactus.m b/Tools/CodeGen/CodeGenCactus.m index cb88ddd..f206ec3 100644 --- a/Tools/CodeGen/CodeGenCactus.m +++ b/Tools/CodeGen/CodeGenCactus.m @@ -717,6 +717,7 @@ DefFn[ rhs = rhs //. xx_ yy_ - xx_ zz_ -> xx (yy-zz)]; rhs = rhs /. Power[E, power_] -> exp[power]; + rhs = rhs /. ArcTan[x_, y_] -> ArcTan2[x,y]; (* there have been some problems doing the Max/Min replacement via the preprocessor for C, so we do it diff --git a/Tools/CodeGen/Kranc.m b/Tools/CodeGen/Kranc.m index d06c4f9..09becb4 100644 --- a/Tools/CodeGen/Kranc.m +++ b/Tools/CodeGen/Kranc.m @@ -27,7 +27,7 @@ BeginPackage["Kranc`"]; kmadd, kmsub, knmadd, knmsub, kpos, kneg, kadd, ksub, kmul, kdiv, kcos, kfabs, kfmax, kfmin, ksqrt, kexp, klog, kpow, ksin, ktan, dir1, dir2, dir3, dt, dx, dy, dz, t, - khalf, kthird, ktwothird, kfourthird, keightthird}; + khalf, kthird, ktwothird, kfourthird, keightthird, ArcTan2}; (* Helpers.m *) |