Index: trunk/MagicSoft/Mars/mbase/MMath.cc
===================================================================
--- trunk/MagicSoft/Mars/mbase/MMath.cc	(revision 8539)
+++ trunk/MagicSoft/Mars/mbase/MMath.cc	(revision 8544)
@@ -1,4 +1,4 @@
 /* ======================================================================== *\
-! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.31 2007-05-10 12:14:54 tbretz Exp $
+! $Name: not supported by cvs2svn $:$Id: MMath.cc,v 1.32 2007-06-11 15:35:14 tbretz Exp $
 ! --------------------------------------------------------------------------
 !
@@ -567,5 +567,5 @@
     if (r==0)
     {
-        x1 = -a/2;
+        x1 = x2 = -a/2;
         return 1;
     }
@@ -710,4 +710,16 @@
         const Double_t rq    = R/TMath::Abs(Q);
 
+        const Double_t t = TMath::ACos(rq/sqrtq)/3;
+
+        static const Double_t sqrt3 = TMath::Sqrt(3.);
+
+        const Double_t s = TMath::Sin(t)*sqrt3;
+        const Double_t c = TMath::Cos(t);
+
+        x1 = 2*sqrtq *      c  - a/3;
+        x2 =  -sqrtq * (s + c) - a/3;
+        x3 =   sqrtq * (s - c) - a/3;
+
+        /* --- Easier to understand but slower ---
         const Double_t th1 = TMath::ACos(rq/sqrtq);
         const Double_t th2 = th1 + TMath::TwoPi();
@@ -717,5 +729,5 @@
         x2 = 2.*sqrtq * TMath::Cos(th2/3.) - a/3.;
         x3 = 2.*sqrtq * TMath::Cos(th3/3.) - a/3.;
-
+        */
         return 3;
     }
Index: trunk/MagicSoft/Mars/mbase/MMath.h
===================================================================
--- trunk/MagicSoft/Mars/mbase/MMath.h	(revision 8539)
+++ trunk/MagicSoft/Mars/mbase/MMath.h	(revision 8544)
@@ -70,5 +70,5 @@
     inline Int_t ModF(Double_t dbl, Double_t &frac) { Double_t rc; frac = modf(dbl, &rc); return TMath::Nint(rc); }
 
-    inline Double_t Sqrt3(Double_t x) { return TMath::Sign(TMath::Power(TMath::Abs(x), 1./3), x); }
+    inline Double_t Sqrt3(Double_t x) { return cbrt(x); }
 
     inline Double_t Sgn(Double_t d) { return d<0 ? -1 : 1; }
