Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85103 - trunk/boost/math/distributions
From: john_at_[hidden]
Date: 2013-07-22 07:50:26


Author: johnmaddock
Date: 2013-07-22 07:50:26 EDT (Mon, 22 Jul 2013)
New Revision: 85103
URL: http://svn.boost.org/trac/boost/changeset/85103

Log:
Fix Thomas Luu's approximation.

Text files modified:
   trunk/boost/math/distributions/non_central_chi_squared.hpp | 3 ++-
   1 files changed, 2 insertions(+), 1 deletions(-)

Modified: trunk/boost/math/distributions/non_central_chi_squared.hpp
==============================================================================
--- trunk/boost/math/distributions/non_central_chi_squared.hpp Mon Jul 22 07:49:48 2013 (r85102)
+++ trunk/boost/math/distributions/non_central_chi_squared.hpp 2013-07-22 07:50:26 EDT (Mon, 22 Jul 2013) (r85103)
@@ -468,7 +468,8 @@
             if(guess < 0.005)
             {
                value_type pp = comp ? 1 - p : p;
- guess = pow(pow(value_type(2), (k / 2 - 1)) * exp(l / 2) * pp * k, 2 / k);
+ //guess = pow(pow(value_type(2), (k / 2 - 1)) * exp(l / 2) * pp * k, 2 / k);
+ guess = pow(pow(value_type(2), (k / 2 - 1)) * exp(l / 2) * pp * k * boost::math::tgamma(k / 2, forwarding_policy()), (2 / k));
                if(guess == 0)
                   guess = tools::min_value<value_type>();
             }


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