]> www.ginac.de Git - ginac.git/blobdiff - ginac/inifcns_trans.cpp
- changed behaviour of numeric::is_rational() and added numeric::is_cinteger()
[ginac.git] / ginac / inifcns_trans.cpp
index 70eccdceaff8cda1f902d812c8d95379606fdd1b..01711a7fa3c9aae70cc9afc536ab651a157d2d34 100644 (file)
@@ -30,7 +30,9 @@
 #include "numeric.h"
 #include "power.h"
 
+#ifndef NO_GINAC_NAMESPACE
 namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
 
 //////////
 // exponential function
@@ -468,10 +470,10 @@ static ex atan2_diff(ex const & y, ex const & x, unsigned diff_param)
     
     if (diff_param==0) {
         // d/dy atan(y,x)
-        return pow(x*(1+y*y/(x*x)),-1);
+        return x*pow(pow(x,2)+pow(y,2),-1);
     }
     // d/dx atan(y,x)
-    return -y*pow(x*x+y*y,-1);
+    return -y*pow(pow(x,2)+pow(y,2),-1);
 }
 
 REGISTER_FUNCTION(atan2, atan2_eval, atan2_evalf, atan2_diff, NULL);
@@ -740,4 +742,6 @@ static ex atanh_diff(ex const & x, unsigned diff_param)
 
 REGISTER_FUNCTION(atanh, atanh_eval, atanh_evalf, atanh_diff, NULL);
 
+#ifndef NO_GINAC_NAMESPACE
 } // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE