|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r66729 - trunk/boost/math/distributions
From: pbristow_at_[hidden]
Date: 2010-11-24 11:50:42
Author: pbristow
Date: 2010-11-24 11:50:41 EST (Wed, 24 Nov 2010)
New Revision: 66729
URL: http://svn.boost.org/trac/boost/changeset/66729
Log:
Corrections
Text files modified:
trunk/boost/math/distributions/inverse_chi_squared.hpp | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Modified: trunk/boost/math/distributions/inverse_chi_squared.hpp
==============================================================================
--- trunk/boost/math/distributions/inverse_chi_squared.hpp (original)
+++ trunk/boost/math/distributions/inverse_chi_squared.hpp 2010-11-24 11:50:41 EST (Wed, 24 Nov 2010)
@@ -146,7 +146,7 @@
if(result < tools::min_value<RealType>())
return 0; // Random variable is near enough infinite.
result = gamma_p_derivative(df/2, result, Policy()) * df * scale/2;
- if(result != 0) // prevent 0 / 0:
+ if(result != 0) // prevent 0 / 0, gamma_p_derivative -> 0 faster than x^2
result /= (x * x);
return result;
} // pdf
@@ -298,7 +298,7 @@
return policies::raise_domain_error<RealType>(
function,
"inverse Chi-Squared distribution only has a variance for degrees of freedom > 4, but got degrees of freedom = %1%.",
- df, Policy()); return 2 * dist.degrees_of_freedom();
+ df, Policy());
}
return 2 * df * df * scale * scale / ((df - 2)*(df - 2) * (df - 4));
} // variance
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