Boost logo

Boost-Commit :

From: gautamcool88_at_[hidden]
Date: 2008-07-11 09:59:30


Author: s.gautam
Date: 2008-07-11 09:59:30 EDT (Fri, 11 Jul 2008)
New Revision: 47311
URL: http://svn.boost.org/trac/boost/changeset/47311

Log:
used exp instead of expm1, reduced calls to exp.
Text files modified:
   sandbox/SOC/2008/parrallel_math/boost/math/distributions/gsoc_logistic.hpp | 10 +++++-----
   1 files changed, 5 insertions(+), 5 deletions(-)

Modified: sandbox/SOC/2008/parrallel_math/boost/math/distributions/gsoc_logistic.hpp
==============================================================================
--- sandbox/SOC/2008/parrallel_math/boost/math/distributions/gsoc_logistic.hpp (original)
+++ sandbox/SOC/2008/parrallel_math/boost/math/distributions/gsoc_logistic.hpp 2008-07-11 09:59:30 EDT (Fri, 11 Jul 2008)
@@ -7,8 +7,8 @@
 #include <boost/math/distributions/detail/common_error_handling.hpp>
 #include <boost/math/distributions/complement.hpp>
 #include <boost/math/special_functions/log1p.hpp>
-#include <boost/math/special_functions/expm1.hpp>
 
+#include <cmath>
 #include <boost/math/constants/constants.hpp>
 #include <utility>
 
@@ -92,8 +92,8 @@
         }
       
       
- RealType power=(location-x)/scale;
- return ( 1+expm1(power) )/ ( scale*(2+expm1(power))*(2+expm1(power) ) );
+ RealType exp_term=exp((location-x)/scale);
+ return ( exp_term )/ ( scale*(1+exp_term)*(1+exp_term ) );
       
       
     }
@@ -127,7 +127,7 @@
         }
       
       RealType power=(location-x)/scale;
- return 1/( 2+expm1(power) );
+ return 1/( 1+exp(power) );
     }
     
     template <class RealType, class Policy>
@@ -180,7 +180,7 @@
         return result;
       
       RealType power=(x-location)/scale;
- return 1/( 2+expm1(power) );
+ return 1/( 1+exp(power) );
       
     }
       template <class RealType, class Policy>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk