From e2c8c3f1009ed340571ad4bc92e9b69e55ec0f1e Mon Sep 17 00:00:00 2001 From: rlar Date: Fri, 22 Sep 2017 19:54:02 +0200 Subject: [PATCH] fixup previous commit, FIXME! the defines better should be inlines for savety --- src/spicelib/devices/adms/admst/analogfunction.xml | 4 ++-- src/spicelib/devices/adms/admst/ngspiceMODULE.hxx.xml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/spicelib/devices/adms/admst/analogfunction.xml b/src/spicelib/devices/adms/admst/analogfunction.xml index e6ccd0f4c..9df3a81fc 100644 --- a/src/spicelib/devices/adms/admst/analogfunction.xml +++ b/src/spicelib/devices/adms/admst/analogfunction.xml @@ -76,8 +76,8 @@ inline double _d0_hypot(double x,double y) { return (x)/sqrt((x)*(x)+(y)*(y)); } inline double _d1_hypot(double x,double y) { return (y)/sqrt((x)*(x)+(y)*(y)); } inline double _atan2(double x,double y) { return atan2(x,y); } -inline double _d0_atan2(double x,double y) { return (-(y)/((x)*(x)+(y)*(y))); } -inline double _d1_atan2(double x,double y) { return ((x)/((x)*(x)+(y)*(y))); } +inline double _d0_atan2(double x,double y) { return -y / (x*x + y*y); } +inline double _d1_atan2(double x,double y) { return x / (x*x + y*y); } inline double _max(double x,double y) { return ((x)>(y))?(x):(y); } inline double _d0_max(double x,double y) { return ((x)>(y))?1.0:0.0; } diff --git a/src/spicelib/devices/adms/admst/ngspiceMODULE.hxx.xml b/src/spicelib/devices/adms/admst/ngspiceMODULE.hxx.xml index 52d4a9222..d59f2d85b 100644 --- a/src/spicelib/devices/adms/admst/ngspiceMODULE.hxx.xml +++ b/src/spicelib/devices/adms/admst/ngspiceMODULE.hxx.xml @@ -65,8 +65,8 @@ #define m00_limexp(v00,x) v00 = ((x)<90.0?exp(x):EXP90*(x-89.0)); #define m10_limexp(v10,v00,x) v10 = ((x)<90.0?(v00):EXP90); #define m00_atan2(v00,x,y) v00 = atan2(x,y); -#define m10_atan2(v10,x,y) v10 = (-y/(x*x+y*y)); -#define m11_atan2(v11,x,y) v11 = (x/(x*x+y*y)); +#define m10_atan2(v10,x,y) v10 = (-(y)/((x)*(x)+(y)*(y))); +#define m11_atan2(v11,x,y) v11 = ((x)/((x)*(x)+(y)*(y))); #define m00_acosh(v00,x) v00 = acosh(x); #define m10_acosh(v10,v00,x) v10 = (1.0/(sqrt(x-1)*sqrt(x+1))); #define m00_asinh(v00,x) v00 = asinh(x); @@ -134,8 +134,8 @@ inline double _d0_hypot(double x,double y) { return (x)/sqrt((x)*(x)+(y)*(y)); } inline double _d1_hypot(double x,double y) { return (y)/sqrt((x)*(x)+(y)*(y)); } inline double _atan2(double x,double y) { return atan2(x,y); } -inline double _d0_atan2(double x,double y) { return (-y)/((x)*(x)+(y)*(y)); } -inline double _d1_atan2(double x,double y) { return (x)/((x)*(x)+(y)*(y)); } +inline double _d0_atan2(double x,double y) { return -y / (x*x + y*y); } +inline double _d1_atan2(double x,double y) { return x / (x*x + y*y); } inline double _max(double x,double y) { return ((x)>(y))?(x):(y); } inline double _d0_max(double x,double y) { return ((x)>(y))?1.0:0.0; }