• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

Revisionc3e727dfef913c7cf49eaca198f3cf2413ec3690 (tree)
Time2013-10-17 03:24:45
AuthorMikiya Fujii <mikiya.fujii@gmai...>
CommiterMikiya Fujii

Log Message

Hotspots caused by pow is deleted. #31850

git-svn-id: https://svn.sourceforge.jp/svnroot/molds/trunk@1549 1136aad2-a195-0410-b898-f5ea1d11b9d8

Change Summary

Incremental Difference

--- a/src/cndo/Cndo2.cpp
+++ b/src/cndo/Cndo2.cpp
@@ -6262,13 +6262,17 @@ double Cndo2::GetReducedOverlapAOs2ndDerivativeAlphaBeta(int na,
62626262 // see (B.22) in J. A. Pople book.
62636263 double Cndo2::GetAuxiliaryA(int k, double rho) const{
62646264 double value = 0.0;
6265- double temp = 0.0;
6265+ double tmp1 = 0.0;
62666266
62676267 value = exp(-1.0*rho)*static_cast<double>(Factorial(k));
62686268 for(int mu=1; mu<=k+1; mu++){
6269- temp += pow(rho,-1.0*mu)/static_cast<double>(Factorial(k-mu+1));
6269+ double tmp2=rho; // tmp2 = pow(rho,mu)
6270+ for(int nu=1; nu<mu; nu++){
6271+ tmp2 *= rho;
6272+ }
6273+ tmp1 += 1.0/(tmp2*static_cast<double>(Factorial(k-mu+1)));
62706274 }
6271- value *= temp;
6275+ value *= tmp1;
62726276
62736277 return value;
62746278 }
@@ -6288,18 +6292,24 @@ double Cndo2::GetAuxiliaryB(int k, double rho) const{
62886292 double value = 0.0;
62896293 double pre1 = 0.0;
62906294 double pre2 = 0.0;
6291- double temp1 = 0.0;
6292- double temp2 = 0.0;
6295+ double tmp1 = 0.0;
6296+ double tmp2 = 0.0;
62936297
62946298 if(fabs(rho)>0){
62956299 pre1 = -1.0*exp(-1.0*rho);
62966300 pre2 = -1.0*exp(rho);
62976301
62986302 for(int mu=1; mu<=k+1; mu++){
6299- temp1 += pow(rho,-1.0*mu) *static_cast<double>(Factorial(k)/Factorial(k-mu+1)) ;
6300- temp2 += pow(rho,-1.0*mu) *static_cast<double>(Factorial(k)/Factorial(k-mu+1)) *pow(-1.0,k-mu);
6301- }
6302- value = pre1*temp1 + pre2*temp2;
6303+ double tmp3 = rho; // tmp3 = pow(rho,mu)
6304+ for(int nu=1; nu<mu; nu++){
6305+ tmp3 *= rho;
6306+ }
6307+ double tmp4 = -1.0; // tmp4 = pow(-1.0,k-mu)
6308+ if((k-mu)%2==0){tmp4=1.0;}
6309+ tmp1 += static_cast<double>(Factorial(k)/Factorial(k-mu+1)) /tmp3;
6310+ tmp2 += static_cast<double>(Factorial(k)/Factorial(k-mu+1))*tmp4/tmp3;
6311+ }
6312+ value = pre1*tmp1 + pre2*tmp2;
63036313 }
63046314 else{
63056315 if(k%2 == 0){