When calculating a*a-b*b the form (a-b)*(a+b) is usually more numerically stable.
[u/mrichter/AliRoot.git] / PYTHIA6 / AliPythia6.cxx
index f8c761f..ff98f1e 100644 (file)
@@ -1142,7 +1142,7 @@ void  AliPythia6::Quench()
                //
                // Isotropic decay ????
                Double_t cost = 2. * gRandom->Rndm() - 1.;
-               Double_t sint = TMath::Sqrt(1. - cost * cost);
+               Double_t sint = TMath::Sqrt((1.-cost)*(1.+cost));
                Double_t phis =  2. * TMath::Pi() * gRandom->Rndm();
                
                Double_t pz1 =   pst * cost;