|
Boost-Commit : |
From: john_at_[hidden]
Date: 2008-02-19 11:52:04
Author: johnmaddock
Date: 2008-02-19 11:52:02 EST (Tue, 19 Feb 2008)
New Revision: 43324
URL: http://svn.boost.org/trac/boost/changeset/43324
Log:
Added some fixes to check for iterations >= the limit rather than ==.
Added extra common error handler.
Factored out some generic quantile code.
Killed some warnings in NC Beta.
Added initial non central T.
Fixed a few doc typos.
Added initial NC T tests.
Added:
sandbox/math_toolkit/boost/math/distributions/detail/generic_quantile.hpp (contents, props changed)
sandbox/math_toolkit/boost/math/distributions/non_central_t.hpp (contents, props changed)
sandbox/math_toolkit/libs/math/test/nct.ipp (contents, props changed)
sandbox/math_toolkit/libs/math/test/test_nc_t.cpp (contents, props changed)
Text files modified:
sandbox/math_toolkit/boost/math/distributions/chi_squared.hpp | 2 +-
sandbox/math_toolkit/boost/math/distributions/detail/common_error_handling.hpp | 17 +++++++++++++++++
sandbox/math_toolkit/boost/math/distributions/detail/generic_mode.hpp | 4 ++--
sandbox/math_toolkit/boost/math/distributions/non_central_beta.hpp | 18 +++++++++---------
sandbox/math_toolkit/boost/math/distributions/non_central_chi_squared.hpp | 35 +++++++++--------------------------
sandbox/math_toolkit/boost/math/distributions/students_t.hpp | 2 +-
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_chi_squared.qbk | 15 ++++++++++-----
sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_f.qbk | 4 +---
8 files changed, 50 insertions(+), 47 deletions(-)
Modified: sandbox/math_toolkit/boost/math/distributions/chi_squared.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/chi_squared.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/chi_squared.hpp 2008-02-19 11:52:02 EST (Tue, 19 Feb 2008)
@@ -318,7 +318,7 @@
boost::uintmax_t max_iter = policies::get_max_root_iterations<Policy>();
std::pair<RealType, RealType> r = tools::bracket_and_solve_root(f, hint, RealType(2), false, tol, max_iter, Policy());
RealType result = r.first + (r.second - r.first) / 2;
- if(max_iter == policies::get_max_root_iterations<Policy>())
+ if(max_iter >= policies::get_max_root_iterations<Policy>())
{
policies::raise_evaluation_error<RealType>(function, "Unable to locate solution in a reasonable time:"
" either there is no answer to how many degrees of freedom are required"
Modified: sandbox/math_toolkit/boost/math/distributions/detail/common_error_handling.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/detail/common_error_handling.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/detail/common_error_handling.hpp 2008-02-19 11:52:02 EST (Tue, 19 Feb 2008)
@@ -133,6 +133,23 @@
return true;
}
+template <class RealType, class Policy>
+inline bool check_finite(
+ const char* function,
+ RealType x,
+ RealType* result,
+ const Policy& pol)
+{
+ if(!(boost::math::isfinite)(x))
+ { // Assume scale == 0 is NOT valid for any distribution.
+ *result = policies::raise_domain_error<RealType>(
+ function,
+ "Parameter is %1%, but must be finite !", x, pol);
+ return false;
+ }
+ return true;
+}
+
} // namespace detail
} // namespace math
} // namespace boost
Modified: sandbox/math_toolkit/boost/math/distributions/detail/generic_mode.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/detail/generic_mode.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/detail/generic_mode.hpp 2008-02-19 11:52:02 EST (Tue, 19 Feb 2008)
@@ -74,7 +74,7 @@
upper_bound,
policies::digits<value_type, policy_type>(),
max_iter).first;
- if(max_iter == policies::get_max_root_iterations<policy_type>())
+ if(max_iter >= policies::get_max_root_iterations<policy_type>())
{
return policies::raise_evaluation_error<value_type>(
function,
@@ -127,7 +127,7 @@
upper_bound,
policies::digits<value_type, policy_type>(),
max_iter).first;
- if(max_iter == policies::get_max_root_iterations<policy_type>())
+ if(max_iter >= policies::get_max_root_iterations<policy_type>())
{
return policies::raise_evaluation_error<value_type>(
function,
Added: sandbox/math_toolkit/boost/math/distributions/detail/generic_quantile.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/distributions/detail/generic_quantile.hpp 2008-02-19 11:52:02 EST (Tue, 19 Feb 2008)
@@ -0,0 +1,87 @@
+
+#ifndef BOOST_MATH_DISTIBUTIONS_DETAIL_GENERIC_QUANTILE_HPP
+#define BOOST_MATH_DISTIBUTIONS_DETAIL_GENERIC_QUANTILE_HPP
+
+namespace boost{ namespace math{ namespace detail{
+
+template <class Dist>
+struct generic_quantile_finder
+{
+ typedef typename Dist::value_type value_type;
+ typedef typename Dist::policy_type policy_type;
+
+ generic_quantile_finder(const Dist& d, value_type t, bool c)
+ : dist(d), target(t), comp(c) {}
+
+ value_type operator()(const value_type& x)
+ {
+ return comp ?
+ target - cdf(complement(dist, x))
+ : cdf(dist, x) - target;
+ }
+
+private:
+ Dist dist;
+ value_type target;
+ bool comp;
+};
+
+template <class T, class Policy>
+inline T check_range_result(const T& x, const Policy& pol, const char* function)
+{
+ if((x >= 0) && (x < tools::min_value<T>()))
+ return policies::raise_underflow_error<T>(function, 0, pol);
+ if(x <= -tools::max_value<T>())
+ return -policies::raise_overflow_error<T>(function, 0, pol);
+ if(x >= tools::max_value<T>())
+ return policies::raise_overflow_error<T>(function, 0, pol);
+ return x;
+}
+
+template <class Dist>
+typename Dist::value_type generic_quantile(const Dist& dist, const typename Dist::value_type& p, const typename Dist::value_type& guess, bool comp, const char* function)
+{
+ typedef typename Dist::value_type value_type;
+ typedef typename Dist::policy_type policy_type;
+ typedef typename policies::normalise<
+ policy_type,
+ policies::promote_float<false>,
+ policies::promote_double<false>,
+ policies::discrete_quantile<>,
+ policies::assert_undefined<> >::type forwarding_policy;
+
+ //
+ // Special cases first:
+ //
+ if(p == 0)
+ {
+ return comp
+ ? check_range_result(range(dist).second, forwarding_policy(), function)
+ : check_range_result(range(dist).first, forwarding_policy(), function);
+ }
+ if(p == 1)
+ {
+ return !comp
+ ? check_range_result(range(dist).second, forwarding_policy(), function)
+ : check_range_result(range(dist).first, forwarding_policy(), function);
+ }
+
+ generic_quantile_finder<Dist> f(dist, p, comp);
+ tools::eps_tolerance<value_type> tol(policies::digits<value_type, forwarding_policy>() - 3);
+ boost::uintmax_t max_iter = policies::get_max_root_iterations<forwarding_policy>();
+ std::pair<value_type, value_type> ir = tools::bracket_and_solve_root(
+ f, guess, value_type(2), true, tol, max_iter, forwarding_policy());
+ value_type result = ir.first + (ir.second - ir.first) / 2;
+ if(max_iter >= policies::get_max_root_iterations<forwarding_policy>())
+ {
+ policies::raise_evaluation_error<value_type>(function, "Unable to locate solution in a reasonable time:"
+ " either there is no answer to quantile"
+ " or the answer is infinite. Current best guess is %1%", result, forwarding_policy());
+ }
+ return result;
+}
+
+}}} // namespaces
+
+#endif // BOOST_MATH_DISTIBUTIONS_DETAIL_GENERIC_QUANTILE_HPP
+
Modified: sandbox/math_toolkit/boost/math/distributions/non_central_beta.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/non_central_beta.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/non_central_beta.hpp 2008-02-19 11:52:02 EST (Tue, 19 Feb 2008)
@@ -38,7 +38,7 @@
// Variables come first:
//
boost::uintmax_t max_iter = policies::get_max_series_iterations<Policy>();
- T errtol = ldexp(1.0, -boost::math::policies::digits<T, Policy>());
+ T errtol = ldexp(1.0f, -boost::math::policies::digits<T, Policy>());
T l2 = lam / 2;
//
// k is the starting point for iteration, and is the
@@ -46,7 +46,7 @@
//
int k = itrunc(l2);
// Starting Poisson weight:
- T pois = gamma_p_derivative(k+1, l2, pol);
+ T pois = gamma_p_derivative(T(k+1), l2, pol);
// Starting beta term:
T beta = x < y
? ibeta(a + k, b, x, pol)
@@ -55,7 +55,7 @@
T xterm = x < y
? ibeta_derivative(a + k, b, x, pol)
: ibeta_derivative(b, a + k, y, pol);
- xterm *= (1 - x) / (a + b + k - 1);
+ xterm *= y / (a + b + k - 1);
T poisf(pois), betaf(beta), xtermf(xterm);
T sum = init_val;
@@ -102,7 +102,7 @@
// Variables come first:
//
boost::uintmax_t max_iter = policies::get_max_series_iterations<Policy>();
- T errtol = ldexp(1.0, -boost::math::policies::digits<T, Policy>());
+ T errtol = ldexp(1.0f, -boost::math::policies::digits<T, Policy>());
T l2 = lam / 2;
//
// k is the starting point for iteration, and is the
@@ -110,7 +110,7 @@
//
int k = itrunc(l2);
// Starting Poisson weight:
- T pois = gamma_p_derivative(k+1, l2, pol);
+ T pois = gamma_p_derivative(T(k+1), l2, pol);
// Starting beta term:
T beta = x < y
? ibetac(a + k, b, x, pol)
@@ -119,7 +119,7 @@
T xterm = x < y
? ibeta_derivative(a + k, b, x, pol)
: ibeta_derivative(b, a + k, y, pol);
- xterm *= (1 - x) / (a + b + k - 1);
+ xterm *= y / (a + b + k - 1);
T poisf(pois), betaf(beta), xtermf(xterm);
T sum = init_val;
//
@@ -437,7 +437,7 @@
max_iter, Policy());
value_type result = ir.first + (ir.second - ir.first) / 2;
- if(max_iter == policies::get_max_root_iterations<Policy>())
+ if(max_iter >= policies::get_max_root_iterations<Policy>())
{
policies::raise_evaluation_error<value_type>(function, "Unable to locate solution in a reasonable time:"
" either there is no answer to quantile of the non central beta distribution"
@@ -457,7 +457,7 @@
// Variables come first:
//
boost::uintmax_t max_iter = policies::get_max_series_iterations<Policy>();
- T errtol = ldexp(1.0, -boost::math::policies::digits<T, Policy>());
+ T errtol = ldexp(1.0f, -boost::math::policies::digits<T, Policy>());
T l2 = lam / 2;
//
// k is the starting point for iteration, and is the
@@ -465,7 +465,7 @@
//
int k = itrunc(l2);
// Starting Poisson weight:
- T pois = gamma_p_derivative(k+1, l2, pol);
+ T pois = gamma_p_derivative(T(k+1), l2, pol);
// Starting beta term:
T beta = ibeta_derivative(a + k, b, x, pol);
T sum = 0;
Modified: sandbox/math_toolkit/boost/math/distributions/non_central_chi_squared.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/non_central_chi_squared.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/non_central_chi_squared.hpp 2008-02-19 11:52:02 EST (Tue, 19 Feb 2008)
@@ -20,6 +20,7 @@
#include <boost/math/special_functions/fpclassify.hpp> // isnan.
#include <boost/math/tools/roots.hpp> // for root finding.
#include <boost/math/distributions/detail/generic_mode.hpp>
+#include <boost/math/distributions/detail/generic_quantile.hpp>
namespace boost
{
@@ -427,17 +428,6 @@
&r,
Policy()))
return (RealType)r;
- //
- // Special cases first:
- //
- if(p == 0)
- return comp
- ? policies::raise_overflow_error<RealType>(function, 0, Policy())
- : 0;
- if(p == 1)
- return !comp
- ? policies::raise_overflow_error<RealType>(function, 0, Policy())
- : 0;
value_type b = (l * l) / (k + 3 * l);
value_type c = (k + 3 * l) / (k + 2 * l);
@@ -451,19 +441,12 @@
if(guess < 0)
guess = tools::min_value<value_type>();
- detail::nccs_quantile_functor<value_type, Policy>
- f(non_central_chi_squared_distribution<value_type, Policy>(k, l), p, comp);
- tools::eps_tolerance<value_type> tol(policies::digits<RealType, Policy>());
- boost::uintmax_t max_iter = policies::get_max_root_iterations<Policy>();
- std::pair<value_type, value_type> ir = tools::bracket_and_solve_root(
- f, guess, value_type(2), true, tol, max_iter, Policy());
- value_type result = ir.first + (ir.second - ir.first) / 2;
- if(max_iter == policies::get_max_root_iterations<Policy>())
- {
- policies::raise_evaluation_error<value_type>(function, "Unable to locate solution in a reasonable time:"
- " either there is no answer to quantile of the non central chi squared distribution"
- " or the answer is infinite. Current best guess is %1%", result, Policy());
- }
+ value_type result = detail::generic_quantile(
+ non_central_chi_squared_distribution<value_type, forwarding_policy>(k, l),
+ p,
+ guess,
+ comp,
+ function);
return policies::checked_narrowing_cast<RealType, forwarding_policy>(
result,
function);
@@ -580,7 +563,7 @@
std::pair<RealType, RealType> ir = tools::bracket_and_solve_root(
f, guess, RealType(2), false, tol, max_iter, pol);
RealType result = ir.first + (ir.second - ir.first) / 2;
- if(max_iter == policies::get_max_root_iterations<Policy>())
+ if(max_iter >= policies::get_max_root_iterations<Policy>())
{
policies::raise_evaluation_error<RealType>(function, "Unable to locate solution in a reasonable time:"
" or there is no answer to problem. Current best guess is %1%", result, Policy());
@@ -636,7 +619,7 @@
std::pair<RealType, RealType> ir = tools::bracket_and_solve_root(
f, guess, RealType(2), false, tol, max_iter, pol);
RealType result = ir.first + (ir.second - ir.first) / 2;
- if(max_iter == policies::get_max_root_iterations<Policy>())
+ if(max_iter >= policies::get_max_root_iterations<Policy>())
{
policies::raise_evaluation_error<RealType>(function, "Unable to locate solution in a reasonable time:"
" or there is no answer to problem. Current best guess is %1%", result, Policy());
Added: sandbox/math_toolkit/boost/math/distributions/non_central_t.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/distributions/non_central_t.hpp 2008-02-19 11:52:02 EST (Tue, 19 Feb 2008)
@@ -0,0 +1,752 @@
+// boost\math\distributions\non_central_t.hpp
+
+// Copyright John Maddock 2008.
+
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt
+// or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_MATH_SPECIAL_NON_CENTRAL_T_HPP
+#define BOOST_MATH_SPECIAL_NON_CENTRAL_T_HPP
+
+#include <boost/math/distributions/fwd.hpp>
+#include <boost/math/distributions/non_central_beta.hpp> // for nc beta
+#include <boost/math/distributions/normal.hpp> // for normal CDF and quantile
+#include <boost/math/distributions/detail/generic_quantile.hpp> // quantile
+
+namespace boost
+{
+ namespace math
+ {
+
+ template <class RealType, class Policy>
+ class non_central_t_distribution;
+
+ namespace detail{
+
+ template <class T, class Policy>
+ T non_central_t2_p(T n, T delta, T x, T y, const Policy& pol, T init_val)
+ {
+ BOOST_MATH_STD_USING
+ //
+ // Variables come first:
+ //
+ boost::uintmax_t max_iter = policies::get_max_series_iterations<Policy>();
+ T errtol = ldexp(1.0f, -boost::math::policies::digits<T, Policy>());
+ T d2 = delta * delta / 2;
+ //
+ // k is the starting point for iteration, and is the
+ // maximum of the poisson weighting term:
+ //
+ int k = boost::math::itrunc(d2);
+ // Starting Poisson weight:
+ T pois = gamma_p_derivative(T(k+1), d2, pol)
+ * tgamma_delta_ratio(T(k + 1), T(0.5f))
+ * delta / constants::root_two<T>();
+ // Starting beta term:
+ T beta = x < y
+ ? ibeta(T(k + 1), n / 2, x, pol)
+ : ibetac(n / 2, T(k + 1), y, pol);
+ // Recurance term:
+ T xterm = x < y
+ ? ibeta_derivative(T(k + 1), n / 2, x, pol)
+ : ibeta_derivative(n / 2, T(k + 1), y, pol);
+ xterm *= y / (n / 2 + k);
+ T poisf(pois), betaf(beta), xtermf(xterm);
+ T sum = init_val;
+
+ //
+ // Backwards recursion first, this is the stable
+ // direction for recursion:
+ //
+ int count = 0;
+ for(int i = k; i >= 0; --i)
+ {
+ T term = beta * pois;
+ sum += term;
+ if(fabs(term/sum) < errtol)
+ break;
+ pois *= (i + 0.5f) / d2;
+ beta += xterm;
+ xterm *= (i) / (x * (n / 2 + i - 1));
+ ++count;
+ }
+ for(int i = k + 1; i - k < max_iter; ++i)
+ {
+ poisf *= d2 / (i + 0.5f);
+ xtermf *= (x * (n / 2 + i - 1)) / (i);
+ betaf -= xtermf;
+ T term = poisf * betaf;
+ sum += term;
+ if(fabs(term/sum) < errtol)
+ break;
+ ++count;
+ }
+ return sum;
+ }
+
+ template <class T, class Policy>
+ T non_central_t2_q(T n, T delta, T x, T y, const Policy& pol, T init_val)
+ {
+ BOOST_MATH_STD_USING
+ //
+ // Variables come first:
+ //
+ boost::uintmax_t max_iter = policies::get_max_series_iterations<Policy>();
+ T errtol = ldexp(1.0f, -boost::math::policies::digits<T, Policy>());
+ T d2 = delta * delta / 2;
+ //
+ // k is the starting point for iteration, and is the
+ // maximum of the poisson weighting term:
+ //
+ int k = boost::math::itrunc(d2);
+ // Starting Poisson weight:
+ T pois = gamma_p_derivative(T(k+1), d2, pol)
+ * tgamma_delta_ratio(T(k + 1), T(0.5f))
+ * delta / constants::root_two<T>();
+ // Starting beta term:
+ T beta = x < y
+ ? ibetac(T(k + 1), n / 2, x, pol)
+ : ibeta(n / 2, T(k + 1), y, pol);
+ // Recurance term:
+ T xterm = x < y
+ ? ibeta_derivative(T(k + 1), n / 2, x, pol)
+ : ibeta_derivative(n / 2, T(k + 1), y, pol);
+ xterm *= y / (n / 2 + k);
+ T poisf(pois), betaf(beta), xtermf(xterm);
+ T sum = init_val;
+
+ //
+ // Forward recursion first, this is the stable direction:
+ //
+ int count = 0;
+ for(int i = k + 1; i - k < max_iter; ++i)
+ {
+ poisf *= d2 / (i + 0.5f);
+ xtermf *= (x * (n / 2 + i - 1)) / (i);
+ betaf += xtermf;
+
+ T term = poisf * betaf;
+ sum += term;
+ if(fabs(term/sum) < errtol)
+ break;
+ ++count;
+ }
+ //
+ // Backwards recursion:
+ //
+ for(int i = k; i >= 0; --i)
+ {
+ T term = beta * pois;
+ sum += term;
+ if(fabs(term/sum) < errtol)
+ break;
+ pois *= (i + 0.5f) / d2;
+ beta -= xterm;
+ xterm *= (i) / (x * (n / 2 + i - 1));
+ ++count;
+ }
+ return sum;
+ }
+
+ template <class T, class Policy>
+ T non_central_t_cdf(T n, T delta, T t, bool invert, const Policy& pol)
+ {
+ //
+ // For t < 0 we have to use reflect:
+ //
+ if(t < 0)
+ {
+ t = -t;
+ delta = -delta;
+ invert = !invert;
+ }
+ //
+ // x and y are the corresponding random
+ // variables for the noncentral beta distribution,
+ // with y = 1 - x:
+ //
+ T x = t * t / (n + t * t);
+ T y = n / (n + t * t);
+ T d2 = delta * delta;
+ T a = 0.5f;
+ T b = n / 2;
+ T c = a + b + d2 / 2;
+ //
+ // Crossover point for calculating p or q is the same
+ // as for the noncentral beta:
+ //
+ T cross = 1 - (b / c) * (1 + d2 / (2 * c * c));
+ T result;
+ if(x < cross)
+ {
+ //
+ // Calculate p:
+ //
+ result = non_central_beta_p(a, b, d2, x, y, pol);
+ result = non_central_t2_p(n, delta, x, y, pol, result);
+ result /= 2;
+ result += cdf(boost::math::normal_distribution<T, Policy>(), -delta);
+ }
+ else
+ {
+ //
+ // Calculate q:
+ //
+ invert = !invert;
+ result = non_central_beta_q(a, b, d2, x, y, pol);
+ result = non_central_t2_q(n, delta, x, y, pol, result);
+ result /= 2;
+ }
+ if(invert)
+ result = 1 - result;
+ return result;
+ }
+
+ template <class T, class Policy>
+ T non_central_t_quantile(T v, T delta, T p, T q, const Policy&)
+ {
+ static const char* function = "quantile(non_central_t_distribution<%1%>, %1%)";
+ typedef typename policies::evaluation<T, Policy>::type value_type;
+ typedef typename policies::normalise<
+ Policy,
+ policies::promote_float<false>,
+ policies::promote_double<false>,
+ policies::discrete_quantile<>,
+ policies::assert_undefined<> >::type forwarding_policy;
+
+ T r;
+ if(!detail::check_df(
+ function,
+ v, &r, Policy())
+ ||
+ !detail::check_finite(
+ function,
+ delta,
+ &r,
+ Policy())
+ ||
+ !detail::check_probability(
+ function,
+ p,
+ &r,
+ Policy()))
+ return r;
+
+ value_type mean = delta * sqrt(v / 2) * tgamma_delta_ratio((v - 1) * 0.5f, T(0.5f));
+ value_type var = ((delta * delta + 1) * v) / (v - 2) - mean * mean;
+ value_type guess;
+ if(p < q)
+ guess = quantile(normal_distribution<value_type, forwarding_policy>(mean, var), p);
+ else
+ guess = quantile(complement(normal_distribution<value_type, forwarding_policy>(mean, var), q));
+ value_type result = detail::generic_quantile(
+ non_central_t_distribution<value_type, forwarding_policy>(v, delta),
+ (p < q ? p : q),
+ guess,
+ (p >= q),
+ function);
+ return policies::checked_narrowing_cast<T, forwarding_policy>(
+ result,
+ function);
+ }
+
+ template <class T, class Policy>
+ T non_central_t2_pdf(T n, T delta, T x, T y, const Policy& pol, T init_val)
+ {
+ BOOST_MATH_STD_USING
+ //
+ // Variables come first:
+ //
+ boost::uintmax_t max_iter = policies::get_max_series_iterations<Policy>();
+ T errtol = ldexp(1.0f, -boost::math::policies::digits<T, Policy>());
+ T d2 = delta * delta / 2;
+ //
+ // k is the starting point for iteration, and is the
+ // maximum of the poisson weighting term:
+ //
+ int k = boost::math::itrunc(d2);
+ // Starting Poisson weight:
+ T pois = gamma_p_derivative(T(k+1), d2, pol)
+ * tgamma_delta_ratio(T(k + 1), T(0.5f))
+ * delta / constants::root_two<T>();
+ // Starting beta term:
+ T xterm = x < y
+ ? ibeta_derivative(T(k + 1), n / 2, x, pol)
+ : ibeta_derivative(n / 2, T(k + 1), y, pol);
+ T poisf(pois), xtermf(xterm);
+ T sum = init_val;
+
+ //
+ // Backwards recursion first, this is the stable
+ // direction for recursion:
+ //
+ int count = 0;
+ for(int i = k; i >= 0; --i)
+ {
+ T term = xterm * pois;
+ sum += term;
+ if(fabs(term/sum) < errtol)
+ break;
+ pois *= (i + 0.5f) / d2;
+ xterm *= (i) / (x * (n / 2 + i));
+ ++count;
+ }
+ for(int i = k + 1; i - k < max_iter; ++i)
+ {
+ poisf *= d2 / (i + 0.5f);
+ xtermf *= (x * (n / 2 + i)) / (i);
+ T term = poisf * xtermf;
+ sum += term;
+ if(fabs(term/sum) < errtol)
+ break;
+ ++count;
+ }
+ return sum;
+ }
+
+ template <class T, class Policy>
+ T non_central_t_pdf(T n, T delta, T t, const Policy& pol)
+ {
+ //
+ // For t < 0 we have to use reflect:
+ //
+ if(t < 0)
+ {
+ t = -t;
+ delta = -delta;
+ }
+ //
+ // x and y are the corresponding random
+ // variables for the noncentral beta distribution,
+ // with y = 1 - x:
+ //
+ T x = t * t / (n + t * t);
+ T y = n / (n + t * t);
+ T a = 0.5f;
+ T b = n / 2;
+ T d2 = delta * delta;
+ //
+ // Calculate pdf:
+ //
+ T dt = 2 * n * t / (n * n + 2 * n * t * t + t * t * t * t);
+ T result = non_central_beta_pdf(a, b, d2, x, pol);
+ result = non_central_t2_pdf(n, delta, x, y, pol, result);
+ result *= dt / 2;
+ return result;
+ }
+
+ template <class T, class Policy>
+ T mean(T v, T delta, const Policy& pol)
+ {
+ return delta * sqrt(v / 2) * tgamma_delta_ratio((v - 1) * 0.5f, T(0.5f), pol);
+ }
+
+ template <class T, class Policy>
+ T variance(T v, T delta, const Policy& pol)
+ {
+ T result = ((delta * delta + 1) * v) / (v - 2);
+ T m = mean(v, delta, pol);
+ result -= m * m;
+ return result;
+ }
+
+ template <class T, class Policy>
+ T skewness(T v, T delta, const Policy& pol)
+ {
+ T mean = boost::math::detail::mean(v, delta, pol);
+ T l2 = delta * delta;
+ T var = ((l2 + 1) * v) / (v - 2) - mean * mean;
+ T result = -2 * var;
+ result += v * (l2 + 2 * v - 3) / ((v - 3) * (v - 2));
+ result *= mean;
+ result /= pow(var, T(1.5f));
+ return result;
+ }
+
+ template <class T, class Policy>
+ T kurtosis_excess(T v, T delta, const Policy& pol)
+ {
+ T mean = boost::math::detail::mean(v, delta, pol);
+ T l2 = delta * delta;
+ T var = ((l2 + 1) * v) / (v - 2) - mean * mean;
+ T result = -3 * var;
+ result += v * (l2 * (v + 1) + 3 * (3 * v - 5)) / ((v - 3) * (v - 2));
+ result *= -mean * mean;
+ result += v * v * (l2 * l2 + 6 * l2 + 3) / ((v - 4) * (v - 2));
+ result /= var * var;
+ return result;
+ }
+
+ } // namespace detail
+
+ template <class RealType = double, class Policy = policies::policy<> >
+ class non_central_t_distribution
+ {
+ public:
+ typedef RealType value_type;
+ typedef Policy policy_type;
+
+ non_central_t_distribution(RealType v_, RealType lambda) : v(v_), ncp(lambda)
+ {
+ const char* function = "boost::math::non_central_t_distribution<%1%>::non_central_t_distribution(%1%,%1%)";
+ RealType r;
+ detail::check_df(
+ function,
+ v, &r, Policy());
+ detail::check_finite(
+ function,
+ lambda,
+ &r,
+ Policy());
+ } // non_central_t_distribution constructor.
+
+ RealType degrees_of_freedom() const
+ { // Private data getter function.
+ return v;
+ }
+ RealType non_centrality() const
+ { // Private data getter function.
+ return ncp;
+ }
+ private:
+ // Data member, initialized by constructor.
+ RealType v; // degrees of freedom
+ RealType ncp; // non-centrality parameter
+ }; // template <class RealType, class Policy> class non_central_t_distribution
+
+ typedef non_central_t_distribution<double> non_central_t; // Reserved name of type double.
+
+ // Non-member functions to give properties of the distribution.
+
+ template <class RealType, class Policy>
+ inline const std::pair<RealType, RealType> range(const non_central_t_distribution<RealType, Policy>& /* dist */)
+ { // Range of permissible values for random variable k.
+ using boost::math::tools::max_value;
+ return std::pair<RealType, RealType>(-max_value<RealType>(), max_value<RealType>());
+ }
+
+ template <class RealType, class Policy>
+ inline const std::pair<RealType, RealType> support(const non_central_t_distribution<RealType, Policy>& /* dist */)
+ { // Range of supported values for random variable k.
+ // This is range where cdf rises from 0 to 1, and outside it, the pdf is zero.
+ using boost::math::tools::max_value;
+ return std::pair<RealType, RealType>(-max_value<RealType>(), max_value<RealType>());
+ }
+
+ template <class RealType, class Policy>
+ inline RealType mode(const non_central_t_distribution<RealType, Policy>& dist)
+ { // mode.
+ static const char* function = "mode(non_central_t_distribution<%1%> const&)";
+ RealType v = dist.degrees_of_freedom();
+ RealType l = dist.non_centrality();
+ RealType r;
+ if(!detail::check_df(
+ function,
+ v, &r, Policy())
+ ||
+ !detail::check_finite(
+ function,
+ l,
+ &r,
+ Policy()))
+ return (RealType)r;
+ return detail::generic_find_mode(
+ dist,
+ detail::mean(v, l, Policy()),
+ function);
+ }
+
+ template <class RealType, class Policy>
+ inline RealType mean(const non_central_t_distribution<RealType, Policy>& dist)
+ {
+ BOOST_MATH_STD_USING
+ const char* function = "mean(const non_central_t_distribution<%1%>&)";
+ typedef typename policies::evaluation<RealType, Policy>::type value_type;
+ typedef typename policies::normalise<
+ Policy,
+ policies::promote_float<false>,
+ policies::promote_double<false>,
+ policies::discrete_quantile<>,
+ policies::assert_undefined<> >::type forwarding_policy;
+ RealType v = dist.degrees_of_freedom();
+ RealType l = dist.non_centrality();
+ RealType r;
+ if(!detail::check_df(
+ function,
+ v, &r, Policy())
+ ||
+ !detail::check_finite(
+ function,
+ l,
+ &r,
+ Policy()))
+ return (RealType)r;
+ if(v <= 1)
+ return policies::raise_domain_error<RealType>(
+ function,
+ "The non central t distribution has no defined mean for degrees of freedom <= 1: got v=%1%.", v, Policy());
+ // return l * sqrt(v / 2) * tgamma_delta_ratio((v - 1) * 0.5f, RealType(0.5f));
+ return policies::checked_narrowing_cast<RealType, forwarding_policy>(
+ detail::mean(static_cast<value_type>(v), static_cast<value_type>(l), forwarding_policy()), function);
+
+ } // mean
+
+ template <class RealType, class Policy>
+ inline RealType variance(const non_central_t_distribution<RealType, Policy>& dist)
+ { // variance.
+ const char* function = "variance(const non_central_t_distribution<%1%>&)";
+ typedef typename policies::evaluation<RealType, Policy>::type value_type;
+ typedef typename policies::normalise<
+ Policy,
+ policies::promote_float<false>,
+ policies::promote_double<false>,
+ policies::discrete_quantile<>,
+ policies::assert_undefined<> >::type forwarding_policy;
+ BOOST_MATH_STD_USING
+ RealType v = dist.degrees_of_freedom();
+ RealType l = dist.non_centrality();
+ RealType r;
+ if(!detail::check_df(
+ function,
+ v, &r, Policy())
+ ||
+ !detail::check_finite(
+ function,
+ l,
+ &r,
+ Policy()))
+ return (RealType)r;
+ if(v <= 2)
+ return policies::raise_domain_error<RealType>(
+ function,
+ "The non central t distribution has no defined variance for degrees of freedom <= 2: got v=%1%.", v, Policy());
+ return policies::checked_narrowing_cast<RealType, forwarding_policy>(
+ detail::variance(static_cast<value_type>(v), static_cast<value_type>(l), forwarding_policy()), function);
+ }
+
+ // RealType standard_deviation(const non_central_t_distribution<RealType, Policy>& dist)
+ // standard_deviation provided by derived accessors.
+
+ template <class RealType, class Policy>
+ inline RealType skewness(const non_central_t_distribution<RealType, Policy>& dist)
+ { // skewness = sqrt(l).
+ const char* function = "skewness(const non_central_t_distribution<%1%>&)";
+ typedef typename policies::evaluation<RealType, Policy>::type value_type;
+ typedef typename policies::normalise<
+ Policy,
+ policies::promote_float<false>,
+ policies::promote_double<false>,
+ policies::discrete_quantile<>,
+ policies::assert_undefined<> >::type forwarding_policy;
+ RealType v = dist.degrees_of_freedom();
+ RealType l = dist.non_centrality();
+ RealType r;
+ if(!detail::check_df(
+ function,
+ v, &r, Policy())
+ ||
+ !detail::check_finite(
+ function,
+ l,
+ &r,
+ Policy()))
+ return (RealType)r;
+ if(v <= 3)
+ return policies::raise_domain_error<RealType>(
+ function,
+ "The non central t distribution has no defined skewness for degrees of freedom <= 3: got v=%1%.", v, Policy());;
+ return policies::checked_narrowing_cast<RealType, forwarding_policy>(
+ detail::skewness(static_cast<value_type>(v), static_cast<value_type>(l), forwarding_policy()), function);
+ }
+
+ template <class RealType, class Policy>
+ inline RealType kurtosis_excess(const non_central_t_distribution<RealType, Policy>& dist)
+ {
+ const char* function = "kurtosis_excess(const non_central_t_distribution<%1%>&)";
+ typedef typename policies::evaluation<RealType, Policy>::type value_type;
+ typedef typename policies::normalise<
+ Policy,
+ policies::promote_float<false>,
+ policies::promote_double<false>,
+ policies::discrete_quantile<>,
+ policies::assert_undefined<> >::type forwarding_policy;
+ RealType v = dist.degrees_of_freedom();
+ RealType l = dist.non_centrality();
+ RealType r;
+ if(!detail::check_df(
+ function,
+ v, &r, Policy())
+ ||
+ !detail::check_finite(
+ function,
+ l,
+ &r,
+ Policy()))
+ return (RealType)r;
+ if(v <= 4)
+ return policies::raise_domain_error<RealType>(
+ function,
+ "The non central t distribution has no defined kurtosis for degrees of freedom <= 4: got v=%1%.", v, Policy());;
+ return policies::checked_narrowing_cast<RealType, forwarding_policy>(
+ detail::kurtosis_excess(static_cast<value_type>(v), static_cast<value_type>(l), forwarding_policy()), function);
+ } // kurtosis_excess
+
+ template <class RealType, class Policy>
+ inline RealType kurtosis(const non_central_t_distribution<RealType, Policy>& dist)
+ {
+ return kurtosis_excess(dist) + 3;
+ }
+
+ template <class RealType, class Policy>
+ inline RealType pdf(const non_central_t_distribution<RealType, Policy>& dist, const RealType& t)
+ { // Probability Density/Mass Function.
+ const char* function = "cdf(non_central_t_distribution<%1%>, %1%)";
+ typedef typename policies::evaluation<RealType, Policy>::type value_type;
+ typedef typename policies::normalise<
+ Policy,
+ policies::promote_float<false>,
+ policies::promote_double<false>,
+ policies::discrete_quantile<>,
+ policies::assert_undefined<> >::type forwarding_policy;
+
+ RealType v = dist.degrees_of_freedom();
+ RealType l = dist.non_centrality();
+ RealType r;
+ if(!detail::check_df(
+ function,
+ v, &r, Policy())
+ ||
+ !detail::check_finite(
+ function,
+ l,
+ &r,
+ Policy())
+ ||
+ !detail::check_x(
+ function,
+ t,
+ &r,
+ Policy()))
+ return (RealType)r;
+ return policies::checked_narrowing_cast<RealType, forwarding_policy>(
+ detail::non_central_t_pdf(static_cast<value_type>(v),
+ static_cast<value_type>(l),
+ static_cast<value_type>(t),
+ Policy()),
+ function);
+ } // pdf
+
+ template <class RealType, class Policy>
+ RealType cdf(const non_central_t_distribution<RealType, Policy>& dist, const RealType& x)
+ {
+ const char* function = "boost::math::non_central_t_distribution<%1%>::cdf(%1%)";
+ typedef typename policies::evaluation<RealType, Policy>::type value_type;
+ typedef typename policies::normalise<
+ Policy,
+ policies::promote_float<false>,
+ policies::promote_double<false>,
+ policies::discrete_quantile<>,
+ policies::assert_undefined<> >::type forwarding_policy;
+
+ RealType v = dist.degrees_of_freedom();
+ RealType l = dist.non_centrality();
+ RealType r;
+ if(!detail::check_df(
+ function,
+ v, &r, Policy())
+ ||
+ !detail::check_finite(
+ function,
+ l,
+ &r,
+ Policy())
+ ||
+ !detail::check_x(
+ function,
+ x,
+ &r,
+ Policy()))
+ return (RealType)r;
+
+ return policies::checked_narrowing_cast<RealType, forwarding_policy>(
+ detail::non_central_t_cdf(
+ static_cast<value_type>(v),
+ static_cast<value_type>(l),
+ static_cast<value_type>(x),
+ false, Policy()),
+ function);
+ } // cdf
+
+ template <class RealType, class Policy>
+ RealType cdf(const complemented2_type<non_central_t_distribution<RealType, Policy>, RealType>& c)
+ { // Complemented Cumulative Distribution Function
+ const char* function = "boost::math::non_central_t_distribution<%1%>::cdf(%1%)";
+ typedef typename policies::evaluation<RealType, Policy>::type value_type;
+ typedef typename policies::normalise<
+ Policy,
+ policies::promote_float<false>,
+ policies::promote_double<false>,
+ policies::discrete_quantile<>,
+ policies::assert_undefined<> >::type forwarding_policy;
+
+ non_central_t_distribution<RealType, Policy> const& dist = c.dist;
+ RealType x = c.param;
+ RealType v = dist.degrees_of_freedom();
+ RealType l = dist.non_centrality();
+ RealType r;
+ if(!detail::check_df(
+ function,
+ v, &r, Policy())
+ ||
+ !detail::check_finite(
+ function,
+ l,
+ &r,
+ Policy())
+ ||
+ !detail::check_x(
+ function,
+ x,
+ &r,
+ Policy()))
+ return (RealType)r;
+
+ return policies::checked_narrowing_cast<RealType, forwarding_policy>(
+ detail::non_central_t_cdf(
+ static_cast<value_type>(v),
+ static_cast<value_type>(l),
+ static_cast<value_type>(x),
+ true, Policy()),
+ function);
+ } // ccdf
+
+ template <class RealType, class Policy>
+ inline RealType quantile(const non_central_t_distribution<RealType, Policy>& dist, const RealType& p)
+ { // Quantile (or Percent Point) function.
+ RealType v = dist.degrees_of_freedom();
+ RealType l = dist.non_centrality();
+ return detail::non_central_t_quantile(v, l, p, 1-p, Policy());
+ } // quantile
+
+ template <class RealType, class Policy>
+ inline RealType quantile(const complemented2_type<non_central_t_distribution<RealType, Policy>, RealType>& c)
+ { // Quantile (or Percent Point) function.
+ non_central_t_distribution<RealType, Policy> const& dist = c.dist;
+ RealType q = c.param;
+ RealType v = dist.degrees_of_freedom();
+ RealType l = dist.non_centrality();
+ return detail::non_central_t_quantile(v, l, 1-q, q, Policy());
+ } // quantile complement.
+
+ } // namespace math
+} // namespace boost
+
+// This include must be at the end, *after* the accessors
+// for this distribution have been defined, in order to
+// keep compilers that support two-phase lookup happy.
+#include <boost/math/distributions/detail/derived_accessors.hpp>
+
+#endif // BOOST_MATH_SPECIAL_NON_CENTRAL_T_HPP
+
Modified: sandbox/math_toolkit/boost/math/distributions/students_t.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/distributions/students_t.hpp (original)
+++ sandbox/math_toolkit/boost/math/distributions/students_t.hpp 2008-02-19 11:52:02 EST (Tue, 19 Feb 2008)
@@ -277,7 +277,7 @@
boost::uintmax_t max_iter = policies::get_max_root_iterations<Policy>();
std::pair<RealType, RealType> r = tools::bracket_and_solve_root(f, hint, RealType(2), false, tol, max_iter, Policy());
RealType result = r.first + (r.second - r.first) / 2;
- if(max_iter == policies::get_max_root_iterations<Policy>())
+ if(max_iter >= policies::get_max_root_iterations<Policy>())
{
policies::raise_evaluation_error<RealType>(function, "Unable to locate solution in a reasonable time:"
" either there is no answer to how many degrees of freedom are required"
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_chi_squared.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_chi_squared.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_chi_squared.qbk 2008-02-19 11:52:02 EST (Tue, 19 Feb 2008)
@@ -10,7 +10,7 @@
typedef non_central_chi_squared_distribution<> non_central_chi_squared;
- template <class RealType, class ``__Policy``>bja
+ template <class RealType, class ``__Policy``>
class non_central_chi_squared_distribution
{
public:
@@ -219,7 +219,7 @@
The method starts at the [lambda]th term, which is where the Poisson weighting
function achieves its maximum value, although this is not necessarily
-the largest overall term. Subsequent terms are calculates via the normal
+the largest overall term. Subsequent terms are calculated via the normal
recurrence relations for the incomplete gamma function, and iteration proceeds
both forwards and backwards until sufficient precision has been achieved. It
should be noted that recurrence in the forwards direction of P[sub a](x) is
@@ -242,9 +242,14 @@
[equation nc_chi_squ_ref3]
-Note that this formula fails for large values of the non-centrality
-parameter: unfortunately there appears to be no other alternative at
-this time.
+Where ['f(x; v)] is the PDF of the central __chi_squared_distrib and
+['I[sub v](x)] is a modified Bessel function, see __cyl_bessel_i.
+For small values of the
+non-centrality parameter the relation in terms of __cyl_bessel_i
+is used. However, this method fails for large values of the
+non-centrality parameter, so in that case the infinite sum is
+evaluated using the method of Benton and Krishnamoorthy, and
+the usual recurrence relations for successive terms.
The quantile functions are computed by numeric inversion of the CDF.
Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_f.qbk
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_f.qbk (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/distributions/nc_f.qbk 2008-02-19 11:52:02 EST (Tue, 19 Feb 2008)
@@ -84,9 +84,7 @@
[h4 Accuracy]
This distribution is implemented in terms of the
-__non_central_beta_distrib
- [link math_toolkit.dist.dist_ref.dists.nc_beta_dist noncentral beta distribution]
-:refer to that distribution for accuracy data.
+__non_central_beta_distrib: refer to that distribution for accuracy data.
[h4 Tests]
Added: sandbox/math_toolkit/libs/math/test/nct.ipp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/test/nct.ipp 2008-02-19 11:52:02 EST (Tue, 19 Feb 2008)
@@ -0,0 +1,216 @@
+#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+ static const boost::array<boost::array<T, 5>, 209-7> nct = {{
+ { SC_(5.637862086296081542968750000000000000000e-1), SC_(-5.074075460433959960937500000000000000000e-1), SC_(-3.162277862429618835449218750000000000000e-2), SC_(6.862274577179818450132372470056769938949e-1), SC_(3.137725422820181549867627529943230061051e-1) },
+ { SC_(9.567963480949401855468750000000000000000e-1), SC_(-9.472283720970153808593750000000000000000e-1), SC_(-7.905694097280502319335937500000000000000e-2), SC_(8.115615601997266002916301508229723403909e-1), SC_(1.884384398002733997083698491770276596091e-1) },
+ { SC_(2.380512714385986328125000000000000000000), SC_(-2.378132343292236328125000000000000000000), SC_(-6.344355583190917968750000000000000000000), SC_(1.181983559218041139443788725932712768639e-1), SC_(8.818016440781958860556211274067287231361e-1) },
+ { SC_(2.707923889160156250000000000000000000000), SC_(2.707923889160156250000000000000000000000), SC_(6.967820167541503906250000000000000000000), SC_(8.962869141158998144131448676176096050228e-1), SC_(1.037130858841001855868551323823903949772e-1) },
+ { SC_(3.554877519607543945312500000000000000000), SC_(3.555233001708984375000000000000000000000), SC_(7.444825649261474609375000000000000000000), SC_(8.868528863556108953156241536058758129831e-1), SC_(1.131471136443891046843758463941241870169e-1) },
+ { SC_(6.366665840148925781250000000000000000000), SC_(-6.373032569885253906250000000000000000000), SC_(-1.003813362121582031250000000000000000000e1), SC_(1.297164612941840729663335994423583046378e-1), SC_(8.702835387058159270336664005576416953622e-1) },
+ { SC_(6.889312267303466796875000000000000000000), SC_(6.958205223083496093750000000000000000000), SC_(1.067599391937255859375000000000000000000e1), SC_(8.692923253313482797187029403902244593628e-1), SC_(1.307076746686517202812970596097755406372e-1) },
+ { SC_(7.142432212829589843750000000000000000000), SC_(-7.856675624847412109375000000000000000000), SC_(-1.186992073059082031250000000000000000000e1), SC_(1.313759752665446453920643109581266741211e-1), SC_(8.686240247334553546079356890418733258789e-1) },
+ { SC_(7.288346767425537109375000000000000000000), SC_(-8.746016502380371093750000000000000000000), SC_(-1.308834171295166015625000000000000000000e1), SC_(1.317487167403902234213465542239538177641e-1), SC_(8.682512832596097765786534457760461822359e-1) },
+ { SC_(9.234373092651367187500000000000000000000), SC_(-1.200468444824218750000000000000000000000e1), SC_(-1.678483200073242187500000000000000000000e1), SC_(1.371773284108319849485042712205994589836e-1), SC_(8.628226715891680150514957287794005410164e-1) },
+ { SC_(1.024338054656982421875000000000000000000e1), SC_(-1.536507034301757812500000000000000000000e1), SC_(-2.095777320861816406250000000000000000000e1), SC_(1.376443537392091127705735460070325295078e-1), SC_(8.623556462607908872294264539929674704922e-1) },
+ { SC_(1.079011821746826171875000000000000000000e1), SC_(2.158023643493652343750000000000000000000e1), SC_(2.953773117065429687500000000000000000000e1), SC_(8.756990872254366689422087613232016840613e-1), SC_(1.243009127745633310577912386767983159387e-1) },
+ { SC_(1.351916885375976562500000000000000000000e1), SC_(4.055750656127929687500000000000000000000e1), SC_(5.393296432495117187500000000000000000000e1), SC_(8.875082903101746924904055764230529369583e-1), SC_(1.124917096898253075095944235769470630417e-1) },
+ { SC_(1.517095088958740234375000000000000000000e1), SC_(6.068380355834960937500000000000000000000e1), SC_(8.029798126220703125000000000000000000000e1), SC_(8.999784514511157146615339407607497230611e-1), SC_(1.000215485488842853384660592392502769389e-1) },
+ { SC_(1.942644500732421875000000000000000000000e1), SC_(-9.713222503662109375000000000000000000000e1), SC_(-1.270076446533203125000000000000000000000e2), SC_(7.762632640481949429728015088679192552401e-2), SC_(9.223736735951805057027198491132080744760e-1) },
+ { SC_(1.950817108154296875000000000000000000000e1), SC_(-1.950817108154296875000000000000000000000), SC_(-4.251358509063720703125000000000000000000), SC_(3.051855543632768793517707982155241831073e-2), SC_(9.694814445636723120648229201784475816893e-1) },
+ { SC_(2.197244071960449218750000000000000000000e1), SC_(5.493110179901123046875000000000000000000), SC_(9.847434997558593750000000000000000000000), SC_(9.929860655432502813979005205517475638750e-1), SC_(7.013934456749718602099479448252436125022e-3) },
+ { SC_(2.249299240112304687500000000000000000000e1), SC_(-1.124649620056152343750000000000000000000e1), SC_(-2.007061576843261718750000000000000000000e1), SC_(1.741152139887334291426335869016989927262e-3), SC_(9.982588478601126657085736641309830100727e-1) },
+ { SC_(2.379962348937988281250000000000000000000e1), SC_(1.784971809387207031250000000000000000000e1), SC_(3.341829299926757812500000000000000000000e1), SC_(9.996211766573392792339813291721999010055e-1), SC_(3.788233426607207660186708278000989945169e-4) },
+ { SC_(2.503664016723632812500000000000000000000e1), SC_(-2.253297615051269531250000000000000000000e1), SC_(-2.359688377380371093750000000000000000000e1), SC_(4.134518081460681240313822521036373281691e-1), SC_(5.865481918539318759686177478963626718309e-1) },
+ { SC_(2.517941474914550781250000000000000000000e1), SC_(2.492761993408203125000000000000000000000e1), SC_(2.668598747253417968750000000000000000000e1), SC_(6.429374782181830684645655350039514639861e-1), SC_(3.570625217818169315354344649960485360139e-1) },
+ { SC_(2.539745140075683593750000000000000000000e1), SC_(2.537205505371093750000000000000000000000e1), SC_(2.814428710937500000000000000000000000000e1), SC_(7.259483462797133090367177861426920725105e-1), SC_(2.740516537202866909632822138573079274895e-1) },
+ { SC_(2.598132896423339843750000000000000000000e1), SC_(-2.598132896423339843750000000000000000000e1), SC_(-2.977846527099609375000000000000000000000e1), SC_(2.056285524153440036454579324861282902585e-1), SC_(7.943714475846559963545420675138717097415e-1) },
+ { SC_(2.709548759460449218750000000000000000000e1), SC_(2.709819793701171875000000000000000000000e1), SC_(3.155788612365722656250000000000000000000e1), SC_(8.284319294492629884981570706960038439140e-1), SC_(1.715680705507370115018429293039961560860e-1) },
+ { SC_(2.772497558593750000000000000000000000000e1), SC_(-2.775270271301269531250000000000000000000e1), SC_(-3.262088012695312500000000000000000000000e1), SC_(1.533040128385550877036403158398526326095e-1), SC_(8.466959871614449122963596841601473673905e-1) },
+ { SC_(2.837735366821289062500000000000000000000e1), SC_(-2.866112709045410156250000000000000000000e1), SC_(-3.364639282226562500000000000000000000000e1), SC_(1.517071461091471563002300276017556302873e-1), SC_(8.482928538908528436997699723982443697127e-1) },
+ { SC_(2.982288169860839843750000000000000000000e1), SC_(-3.280517196655273437500000000000000000000e1), SC_(-3.830894470214843750000000000000000000000e1), SC_(1.518216968394176742712403142990093487196e-1), SC_(8.481783031605823257287596857009906512804e-1) },
+ { SC_(2.985888671875000000000000000000000000000e1), SC_(-3.583066558837890625000000000000000000000e1), SC_(-4.181766510009765625000000000000000000000e1), SC_(1.517913318103332394681789642601874730845e-1), SC_(8.482086681896667605318210357398125269155e-1) },
+ { SC_(3.088776969909667968750000000000000000000e1), SC_(-4.015409851074218750000000000000000000000e1), SC_(-4.670454025268554687500000000000000000000e1), SC_(1.518209117173821183306392204923367360040e-1), SC_(8.481790882826178816693607795076632639960e-1) },
+ { SC_(3.152270126342773437500000000000000000000e1), SC_(4.728404998779296875000000000000000000000e1), SC_(5.492649841308593750000000000000000000000e1), SC_(8.498252445594378197691615470039570119257e-1), SC_(1.501747554405621802308384529960429880743e-1) },
+ { SC_(3.161160087585449218750000000000000000000e1), SC_(6.322320175170898437500000000000000000000e1), SC_(7.414052581787109375000000000000000000000e1), SC_(8.664876685568435851658590203027698501092e-1), SC_(1.335123314431564148341409796972301498908e-1) },
+ { SC_(3.252243041992187500000000000000000000000e1), SC_(9.756729125976562500000000000000000000000e1), SC_(1.153452301025390625000000000000000000000e2), SC_(8.831031107955767113232711697542937898518e-1), SC_(1.168968892044232886767288302457062101482e-1) },
+ { SC_(3.423741912841796875000000000000000000000e1), SC_(1.369496765136718750000000000000000000000e2), SC_(1.628426971435546875000000000000000000000e2), SC_(8.979978036187864055320169695913375830185e-1), SC_(1.020021963812135944679830304086624169815e-1) },
+ { SC_(3.477311706542968750000000000000000000000e1), SC_(1.738655853271484375000000000000000000000e2), SC_(2.108200988769531250000000000000000000000e2), SC_(9.231547098404640045345676119885187046564e-1), SC_(7.684529015953599546543238801148129534355e-2) },
+ { SC_(3.737460327148437500000000000000000000000e1), SC_(-3.737460374832153320312500000000000000000), SC_(-6.062849998474121093750000000000000000000), SC_(2.989407974199651137619128615323098044931e-2), SC_(9.701059202580034886238087138467690195507e-1) },
+ { SC_(3.767647552490234375000000000000000000000e1), SC_(9.419118881225585937500000000000000000000), SC_(1.422046089172363281250000000000000000000e1), SC_(9.942432836401959725307634033893315517704e-1), SC_(5.756716359804027469236596610668448229627e-3) },
+ { SC_(3.931912994384765625000000000000000000000e1), SC_(-1.965956497192382812500000000000000000000e1), SC_(-3.022105789184570312500000000000000000000e1), SC_(1.018579099877846617752492244992008361556e-3), SC_(9.989814209001221533822475077550079916384e-1) },
+ { SC_(4.161368942260742187500000000000000000000e1), SC_(-3.121026611328125000000000000000000000000e1), SC_(-5.041753005981445312500000000000000000000e1), SC_(1.504952224329608441786737013794940554069e-4), SC_(9.998495047775670391558213262986205059446e-1) },
+ { SC_(4.204189300537109375000000000000000000000e1), SC_(-3.783770370483398437500000000000000000000e1), SC_(-3.897372055053710937500000000000000000000e1), SC_(4.241964739668615107939485538821951273245e-1), SC_(5.758035260331384892060514461178048726755e-1) },
+ { SC_(4.238494491577148437500000000000000000000e1), SC_(4.196109771728515625000000000000000000000e1), SC_(4.394155883789062500000000000000000000000e1), SC_(6.324772961255670448387378401509919194938e-1), SC_(3.675227038744329551612621598490080805062e-1) },
+ { SC_(4.344764709472656250000000000000000000000e1), SC_(4.340420150756835937500000000000000000000e1), SC_(4.665811920166015625000000000000000000000e1), SC_(7.171851424088798130212692227040859394821e-1), SC_(2.828148575911201869787307772959140605179e-1) },
+ { SC_(4.420688629150390625000000000000000000000e1), SC_(-4.420688629150390625000000000000000000000e1), SC_(-4.873620605468750000000000000000000000000e1), SC_(2.114948742992961572807034016738007587978e-1), SC_(7.885051257007038427192965983261992412022e-1) },
+ { SC_(4.476246643066406250000000000000000000000e1), SC_(4.476694488525390625000000000000000000000e1), SC_(5.007346725463867187500000000000000000000e1), SC_(8.245850473011781305822593524388817446911e-1), SC_(1.754149526988218694177406475611182553089e-1) },
+ { SC_(4.603128814697265625000000000000000000000e1), SC_(-4.607732009887695312500000000000000000000e1), SC_(-5.190364837646484375000000000000000000000e1), SC_(1.561987365681882768738847432273329720561e-1), SC_(8.438012634318117231261152567726670279439e-1) },
+ { SC_(4.870507049560546875000000000000000000000e1), SC_(-4.919211959838867187500000000000000000000e1), SC_(-5.524404907226562500000000000000000000000e1), SC_(1.545907695642567335795228865061980095925e-1), SC_(8.454092304357432664204771134938019904075e-1) },
+ { SC_(5.021684646606445312500000000000000000000e1), SC_(-5.523853302001953125000000000000000000000e1), SC_(-6.189676666259765625000000000000000000000e1), SC_(1.544995294701398525596552628473387177431e-1), SC_(8.455004705298601474403447371526612822569e-1) },
+ { SC_(5.085651016235351562500000000000000000000e1), SC_(-6.102781295776367187500000000000000000000e1), SC_(-6.831215667724609375000000000000000000000e1), SC_(1.545232378558417400408592895047673900682e-1), SC_(8.454767621441582599591407104952326099318e-1) },
+ { SC_(5.101910018920898437500000000000000000000e1), SC_(6.632482910156250000000000000000000000000e1), SC_(7.421913909912109375000000000000000000000e1), SC_(8.456541431034008370031368689430412936904e-1), SC_(1.543458568965991629968631310569587063096e-1) },
+ { SC_(5.150172424316406250000000000000000000000e1), SC_(7.725258636474609375000000000000000000000e1), SC_(8.644519042968750000000000000000000000000e1), SC_(8.474644525606726641165548052803633498981e-1), SC_(1.525355474393273358834451947196366501019e-1) },
+ { SC_(5.520508956909179687500000000000000000000e1), SC_(1.104101791381835937500000000000000000000e2), SC_(1.239558410644531250000000000000000000000e2), SC_(8.647754825744024885372806932758253507646e-1), SC_(1.352245174255975114627193067241746492354e-1) },
+ { SC_(5.538466644287109375000000000000000000000e1), SC_(-1.661539916992187500000000000000000000000e2), SC_(-1.880928497314453125000000000000000000000e2), SC_(1.176367155276893515668241466414954864808e-1), SC_(8.823632844723106484331758533585045135192e-1) },
+ { SC_(5.569971847534179687500000000000000000000e1), SC_(-2.227988739013671875000000000000000000000e2), SC_(-2.542837982177734375000000000000000000000e2), SC_(1.019403002101509742082139198401058375579e-1), SC_(8.980596997898490257917860801598941624421e-1) },
+ { SC_(5.716787719726562500000000000000000000000e1), SC_(2.858393859863281250000000000000000000000e2), SC_(3.311436157226562500000000000000000000000e2), SC_(9.243557983861765858351445901197402396614e-1), SC_(7.564420161382341416485540988025976033856e-2) },
+ { SC_(5.940595626831054687500000000000000000000e1), SC_(-5.940595626831054687500000000000000000000), SC_(-8.342042922973632812500000000000000000000), SC_(2.940324430636967427049432143992117341216e-2), SC_(9.705967556936303257295056785600788265878e-1) },
+ { SC_(5.996641540527343750000000000000000000000e1), SC_(1.499160385131835937500000000000000000000e1), SC_(2.040558052062988281250000000000000000000e1), SC_(9.951502301879146945725572007339419287614e-1), SC_(4.849769812085305427442799266058071238551e-3) },
+ { SC_(6.038269042968750000000000000000000000000e1), SC_(-3.019134521484375000000000000000000000000e1), SC_(-4.262167358398437500000000000000000000000e1), SC_(6.766671899196952261749430708777551897478e-4), SC_(9.993233328100803047738250569291222448103e-1) },
+ { SC_(6.163347625732421875000000000000000000000e1), SC_(4.622510528564453125000000000000000000000e1), SC_(6.886083984375000000000000000000000000000e1), SC_(9.999214808466395918662727831693625040290e-1), SC_(7.851915336040813372721683063749597101964e-5) },
+ { SC_(6.331015396118164062500000000000000000000e1), SC_(5.697913742065429687500000000000000000000e1), SC_(5.819704055786132812500000000000000000000e1), SC_(5.691117562119799871740176343388579182663e-1), SC_(4.308882437880200128259823656611420817337e-1) },
+ { SC_(6.341996383666992187500000000000000000000e1), SC_(-6.278576660156250000000000000000000000000e1), SC_(-6.499910736083984375000000000000000000000e1), SC_(3.738322953142596763505873683039233783243e-1), SC_(6.261677046857403236494126316960766216757e-1) },
+ { SC_(6.648972320556640625000000000000000000000e1), SC_(6.642323303222656250000000000000000000000e1), SC_(7.019112396240234375000000000000000000000e1), SC_(7.119390284265793812685305565956948386364e-1), SC_(2.880609715734206187314694434043051613636e-1) },
+ { SC_(6.742459869384765625000000000000000000000e1), SC_(-6.742459869384765625000000000000000000000e1), SC_(-7.272975158691406250000000000000000000000e1), SC_(2.148706954365362031394123362488999649409e-1), SC_(7.851293045634637968605876637511000350591e-1) },
+ { SC_(6.807720947265625000000000000000000000000e1), SC_(-6.808401489257812500000000000000000000000e1), SC_(-7.432244873046875000000000000000000000000e1), SC_(1.776439566292221945541793890548658391722e-1), SC_(8.223560433707778054458206109451341608278e-1) },
+ { SC_(6.999681854248046875000000000000000000000e1), SC_(-7.006681823730468750000000000000000000000e1), SC_(-7.693597412109375000000000000000000000000e1), SC_(1.577535764502030296887928772651871118171e-1), SC_(8.422464235497969703112071227348128881829e-1) },
+ { SC_(7.033196258544921875000000000000000000000e1), SC_(-7.103527832031250000000000000000000000000e1), SC_(-7.803430175781250000000000000000000000000e1), SC_(1.558634226083869070482127670970449973749e-1), SC_(8.441365773916130929517872329029550026251e-1) },
+ { SC_(7.055254364013671875000000000000000000000e1), SC_(-7.760780334472656250000000000000000000000e1), SC_(-8.523298645019531250000000000000000000000e1), SC_(1.556562126060282523263838362925862437733e-1), SC_(8.443437873939717476736161637074137562267e-1) },
+ { SC_(7.126909637451171875000000000000000000000e1), SC_(8.552291870117187500000000000000000000000e1), SC_(9.386337280273437500000000000000000000000e1), SC_(8.443386617309688556005324345130120474997e-1), SC_(1.556613382690311443994675654869879525003e-1) },
+ { SC_(7.225886535644531250000000000000000000000e1), SC_(9.393652343750000000000000000000000000000e1), SC_(1.030197143554687500000000000000000000000e2), SC_(8.444914069203373276627890456053340546640e-1), SC_(1.555085930796626723372109543946659453360e-1) },
+ { SC_(7.608922576904296875000000000000000000000e1), SC_(1.141338348388671875000000000000000000000e2), SC_(1.249094085693359375000000000000000000000e2), SC_(8.462455172091029135550405319225529771034e-1), SC_(1.537544827908970864449594680774470228966e-1) },
+ { SC_(7.631175231933593750000000000000000000000e1), SC_(1.526235046386718750000000000000000000000e2), SC_(1.681202545166015625000000000000000000000e2), SC_(8.642245358680997765157973865161523708951e-1), SC_(1.357754641319002234842026134838476291049e-1) },
+ { SC_(7.745924377441406250000000000000000000000e1), SC_(2.323777313232421875000000000000000000000e2), SC_(2.576497192382812500000000000000000000000e2), SC_(8.822460282057177670054617261080172681685e-1), SC_(1.177539717942822329945382738919827318315e-1) },
+ { SC_(7.771401977539062500000000000000000000000e1), SC_(-3.108560791015625000000000000000000000000e2), SC_(-3.471381835937500000000000000000000000000e2), SC_(1.016627586995156636256699525275530770775e-1), SC_(8.983372413004843363743300474724469229225e-1) },
+ { SC_(7.844546508789062500000000000000000000000e1), SC_(3.922273254394531250000000000000000000000e2), SC_(4.441721496582031250000000000000000000000e2), SC_(9.251952554103925652189675447975151362173e-1), SC_(7.480474458960743478103245520248486378270e-2) },
+ { SC_(7.846414947509765625000000000000000000000e1), SC_(-7.846415042877197265625000000000000000000), SC_(-1.032068443298339843750000000000000000000e1), SC_(2.908026560846077815486950206875373595512e-2), SC_(9.709197343915392218451304979312462640449e-1) },
+ { SC_(7.898170471191406250000000000000000000000e1), SC_(-1.974542617797851562500000000000000000000e1), SC_(-2.563983726501464843750000000000000000000e1), SC_(4.383834283421805367839227588787302061150e-3), SC_(9.956161657165781946321607724112126979388e-1) },
+ { SC_(7.974776458740234375000000000000000000000e1), SC_(-3.987388229370117187500000000000000000000e1), SC_(-5.380655670166015625000000000000000000000e1), SC_(5.228576912257536245328204786653287401733e-4), SC_(9.994771423087742463754671795213346712598e-1) },
+ { SC_(8.084175872802734375000000000000000000000e1), SC_(6.063131713867187500000000000000000000000e1), SC_(8.612782287597656250000000000000000000000e1), SC_(9.999494656184139932380947921912622194169e-1), SC_(5.053438158600676190520780873778058313339e-5) },
+ { SC_(8.174629211425781250000000000000000000000e1), SC_(7.357166290283203125000000000000000000000e1), SC_(7.485290527343750000000000000000000000000e1), SC_(5.655840801077873664237520358202778390053e-1), SC_(4.344159198922126335762479641797221609947e-1) },
+ { SC_(8.253336334228515625000000000000000000000e1), SC_(-8.170803070068359375000000000000000000000e1), SC_(-8.410645294189453125000000000000000000000e1), SC_(3.772901925024934280799760328614783682602e-1), SC_(6.227098074975065719200239671385216317398e-1) },
+ { SC_(8.435231018066406250000000000000000000000e1), SC_(8.426795959472656250000000000000000000000e1), SC_(8.838256072998046875000000000000000000000e1), SC_(7.095092141414201401595613557076085674612e-1), SC_(2.904907858585798598404386442923914325388e-1) },
+ { SC_(8.441759490966796875000000000000000000000e1), SC_(-8.441759490966796875000000000000000000000e1), SC_(-9.021768951416015625000000000000000000000e1), SC_(2.163237673254140132965728518405243664117e-1), SC_(7.836762326745859867034271481594756335883e-1) },
+ { SC_(8.463307952880859375000000000000000000000e1), SC_(-8.464154052734375000000000000000000000000e1), SC_(-9.145754241943359375000000000000000000000e1), SC_(1.785481960614030672991952102246403868729e-1), SC_(8.214518039385969327008047897753596131271e-1) },
+ { SC_(8.774893188476562500000000000000000000000e1), SC_(-8.783668518066406250000000000000000000000e1), SC_(-9.537812805175781250000000000000000000000e1), SC_(1.583748894523595322365118318645909249134e-1), SC_(8.416251105476404677634881681354090750866e-1) },
+ { SC_(8.911729431152343750000000000000000000000e1), SC_(-9.000846862792968750000000000000000000000e1), SC_(-9.772855377197265625000000000000000000000e1), SC_(1.564796419002191746060667690099037742646e-1), SC_(8.435203580997808253939332309900962257354e-1) },
+ { SC_(9.120661926269531250000000000000000000000e1), SC_(1.003272857666015625000000000000000000000e2), SC_(1.088131332397460937500000000000000000000e2), SC_(8.436881491498766749138579299643346271245e-1), SC_(1.563118508501233250861420700356653728755e-1) },
+ { SC_(9.159788513183593750000000000000000000000e1), SC_(1.099174652099609375000000000000000000000e2), SC_(1.191806564331054687500000000000000000000e2), SC_(8.436998684250685584554679000155809441252e-1), SC_(1.563001315749314415445320999844190558748e-1) },
+ { SC_(9.387818145751953125000000000000000000000e1), SC_(1.220416336059570312500000000000000000000e2), SC_(1.321806793212890625000000000000000000000e2), SC_(8.438388267176051940156151919229634663964e-1), SC_(1.561611732823948059843848080770365336036e-1) },
+ { SC_(9.465782165527343750000000000000000000000e1), SC_(-1.419867248535156250000000000000000000000e2), SC_(-1.538061523437500000000000000000000000000e2), SC_(1.542575078724520656934634164864737570272e-1), SC_(8.457424921275479343065365835135262429728e-1) },
+ { SC_(9.495178985595703125000000000000000000000e1), SC_(-1.899035797119140625000000000000000000000e2), SC_(-2.069241333007812500000000000000000000000e2), SC_(1.360186009574374276611518252559314655877e-1), SC_(8.639813990425625723388481747440685344123e-1) },
+ { SC_(9.707518005371093750000000000000000000000e1), SC_(2.912255249023437500000000000000000000000e2), SC_(3.191035766601562500000000000000000000000e2), SC_(8.822655381642828923075490778187253383656e-1), SC_(1.177344618357171076924509221812746616344e-1) },
+ { SC_(9.751383209228515625000000000000000000000e1), SC_(-3.900553283691406250000000000000000000000e2), SC_(-4.301320190429687500000000000000000000000e2), SC_(1.014157604642255949734297362476750672209e-1), SC_(8.985842395357744050265702637523249327791e-1) },
+ { SC_(9.795292663574218750000000000000000000000e1), SC_(4.897646484375000000000000000000000000000e2), SC_(5.470874023437500000000000000000000000000e2), SC_(9.257845109655273426610446674444422602715e-1), SC_(7.421548903447265733895533255555773972850e-2) },
+ { SC_(9.811785888671875000000000000000000000000e1), SC_(-9.811785697937011718750000000000000000000), SC_(-1.236201286315917968750000000000000000000e1), SC_(2.880258322680070072360530321279147954814e-2), SC_(9.711974167731992992763946967872085204519e-1) },
+ { SC_(9.967285919189453125000000000000000000000e1), SC_(2.491821479797363281250000000000000000000e1), SC_(3.129652786254882812500000000000000000000e1), SC_(9.959694490932389280305926013689480489171e-1), SC_(4.030550906761071969407398631051951082947e-3) },
+ { SC_(1.007325897216796875000000000000000000000e2), SC_(5.036629486083984375000000000000000000000e1), SC_(6.576190185546875000000000000000000000000e1), SC_(9.995760725264885593399305628081933864539e-1), SC_(4.239274735114406600694371918066135461242e-4) },
+ { SC_(1.011914596557617187500000000000000000000e2), SC_(-7.589359283447265625000000000000000000000e1), SC_(-1.041043930053710937500000000000000000000e2), SC_(3.540241908078483631767735128524953995530e-5), SC_(9.999645975809192151636823226487147504600e-1) },
+ { SC_(1.054743423461914062500000000000000000000e2), SC_(9.492690277099609375000000000000000000000e1), SC_(9.628166198730468750000000000000000000000e1), SC_(5.624910084759677073227339129906321568067e-1), SC_(4.375089915240322926772660870093678431933e-1) },
+ { SC_(1.061595535278320312500000000000000000000e2), SC_(-1.050979614257812500000000000000000000000e2), SC_(-1.077006912231445312500000000000000000000e2), SC_(3.801792420690054321577824583932170007409e-1), SC_(6.198207579309945678422175416067829992591e-1) },
+ { SC_(1.093763427734375000000000000000000000000e2), SC_(-1.092669677734375000000000000000000000000e2), SC_(-1.138154830932617187500000000000000000000e2), SC_(2.927995498143171608585155353713416434627e-1), SC_(7.072004501856828391414844646286583565373e-1) },
+ { SC_(1.094431457519531250000000000000000000000e2), SC_(-1.094431457519531250000000000000000000000e2), SC_(-1.158956375122070312500000000000000000000e2), SC_(2.177624693580852564433792136980025275263e-1), SC_(7.822375306419147435566207863019974724737e-1) },
+ { SC_(1.094441604614257812500000000000000000000e2), SC_(-1.094551086425781250000000000000000000000e2), SC_(-1.170474700927734375000000000000000000000e2), SC_(1.794332717267585034746088854338468831837e-1), SC_(8.205667282732414965253911145661531168163e-1) },
+ { SC_(1.099447708129882812500000000000000000000e2), SC_(-1.100547180175781250000000000000000000000e2), SC_(-1.183541717529296875000000000000000000000e2), SC_(1.588744738364745390285859042272772458576e-1), SC_(8.411255261635254609714140957727227541424e-1) },
+ { SC_(1.123115386962890625000000000000000000000e2), SC_(1.134346542358398437500000000000000000000e2), SC_(1.219545135498046875000000000000000000000e2), SC_(8.430439030845827751147867946083673858892e-1), SC_(1.569560969154172248852132053916326141108e-1) },
+ { SC_(1.135643692016601562500000000000000000000e2), SC_(1.249208068847656250000000000000000000000e2), SC_(1.342415008544921875000000000000000000000e2), SC_(8.432361922916767972051117996988035319071e-1), SC_(1.567638077083232027948882003011964680929e-1) },
+ { SC_(1.137647705078125000000000000000000000000e2), SC_(1.365177307128906250000000000000000000000e2), SC_(1.466843261718750000000000000000000000000e2), SC_(8.432636502679420499850627754284501945478e-1), SC_(1.567363497320579500149372245715498054522e-1) },
+ { SC_(1.147509765625000000000000000000000000000e2), SC_(1.491762695312500000000000000000000000000e2), SC_(1.602314910888671875000000000000000000000e2), SC_(8.434395730286564834535058574522090382322e-1), SC_(1.565604269713435165464941425477909617678e-1) },
+ { SC_(1.161913833618164062500000000000000000000e2), SC_(1.742870788574218750000000000000000000000e2), SC_(1.872030944824218750000000000000000000000e2), SC_(8.453612453543327105256773894190790913364e-1), SC_(1.546387546456672894743226105809209086636e-1) },
+ { SC_(1.170528564453125000000000000000000000000e2), SC_(-2.341057128906250000000000000000000000000e2), SC_(-2.527595062255859375000000000000000000000e2), SC_(1.361894404038173982628789126245928912158e-1), SC_(8.638105595961826017371210873754071087842e-1) },
+ { SC_(1.170535888671875000000000000000000000000e2), SC_(3.511607666015625000000000000000000000000e2), SC_(3.814463500976562500000000000000000000000e2), SC_(8.823142099011073148123321849803243946278e-1), SC_(1.176857900988926851876678150196756053722e-1) },
+ { SC_(1.185648117065429687500000000000000000000e2), SC_(-4.742592468261718750000000000000000000000e2), SC_(-5.179875488281250000000000000000000000000e2), SC_(1.011800541212895573156790456985475776735e-1), SC_(8.988199458787104426843209543014524223265e-1) },
+ { SC_(1.189007568359375000000000000000000000000e2), SC_(-5.945037841796875000000000000000000000000e2), SC_(-6.570604248046875000000000000000000000000e2), SC_(7.371169147327842617679797459789743563627e-2), SC_(9.262883085267215738232020254021025643637e-1) },
+ { SC_(1.232089767456054687500000000000000000000e2), SC_(-1.232089805603027343750000000000000000000e1), SC_(-1.496692085266113281250000000000000000000e1), SC_(2.850291698157446967958375316774236074953e-2), SC_(9.714970830184255303204162468322576392505e-1) },
+ { SC_(1.264718933105468750000000000000000000000e2), SC_(3.161797332763671875000000000000000000000e1), SC_(3.857413482666015625000000000000000000000e1), SC_(9.962946030639488349324523906456210771521e-1), SC_(3.705396936051165067547609354378922847850e-3) },
+ { SC_(1.279527053833007812500000000000000000000e2), SC_(6.397635269165039062500000000000000000000e1), SC_(8.108242797851562500000000000000000000000e1), SC_(9.996552702110278615720509818794660321576e-1), SC_(3.447297889721384279490181205339678423975e-4) },
+ { SC_(1.287922210693359375000000000000000000000e2), SC_(-9.659416198730468750000000000000000000000e1), SC_(-1.281116180419921875000000000000000000000e2), SC_(2.443897930623329769288635209840173004311e-5), SC_(9.999755610206937667023071136479015982700e-1) },
+ { SC_(1.292626342773437500000000000000000000000e2), SC_(1.163363647460937500000000000000000000000e2), SC_(1.177579269409179687500000000000000000000e2), SC_(5.602919656795008147639767650043945121865e-1), SC_(4.397080343204991852360232349956054878135e-1) },
+ { SC_(1.310196380615234375000000000000000000000e2), SC_(-1.297094421386718750000000000000000000000e2), SC_(-1.325057220458984375000000000000000000000e2), SC_(3.823227560515488195983633797288191267849e-1), SC_(6.176772439484511804016366202711808732151e-1) },
+ { SC_(1.310956115722656250000000000000000000000e2), SC_(-1.309645233154296875000000000000000000000e2), SC_(-1.358533172607421875000000000000000000000e2), SC_(2.942282537327334016814883447113353928694e-1), SC_(7.057717462672665983185116552886646071306e-1) },
+ { SC_(1.311481628417968750000000000000000000000e2), SC_(-1.311481628417968750000000000000000000000e2), SC_(-1.381118621826171875000000000000000000000e2), SC_(2.186336299667598508641889146758497605093e-1), SC_(7.813663700332401491358110853241502394907e-1) },
+ { SC_(1.327211303710937500000000000000000000000e2), SC_(-1.327344055175781250000000000000000000000e2), SC_(-1.409829559326171875000000000000000000000e2), SC_(1.799965504502371263600372896806522959373e-1), SC_(8.200034495497628736399627103193477040627e-1) },
+ { SC_(1.357470550537109375000000000000000000000e2), SC_(1.358828125000000000000000000000000000000e2), SC_(1.449780426025390625000000000000000000000e2), SC_(8.407435933512650444605322470236845500409e-1), SC_(1.592564066487349555394677529763154499591e-1) },
+ { SC_(1.359405670166015625000000000000000000000e2), SC_(1.372999725341796875000000000000000000000e2), SC_(1.465579833984375000000000000000000000000e2), SC_(8.427170281446764917815478985727530783284e-1), SC_(1.572829718553235082184521014272469216716e-1) },
+ { SC_(1.359639892578125000000000000000000000000e2), SC_(1.495603942871093750000000000000000000000e2), SC_(1.596433410644531250000000000000000000000e2), SC_(8.429404231403844461019276218089783926536e-1), SC_(1.570595768596155538980723781910216073464e-1) },
+ { SC_(1.362719421386718750000000000000000000000e2), SC_(-1.635263366699218750000000000000000000000e2), SC_(-1.745281524658203125000000000000000000000e2), SC_(1.570438925127796583229779061585298280266e-1), SC_(8.429561074872203416770220938414701719734e-1) },
+ { SC_(1.389657592773437500000000000000000000000e2), SC_(-1.806554870605468750000000000000000000000e2), SC_(-1.926795959472656250000000000000000000000e2), SC_(1.568729479539667719055022405323108530903e-1), SC_(8.431270520460332280944977594676891469097e-1) },
+ { SC_(1.390466003417968750000000000000000000000e2), SC_(2.085699005126953125000000000000000000000e2), SC_(2.225485992431640625000000000000000000000e2), SC_(8.450863691548101910729266522378573519120e-1), SC_(1.549136308451898089270733477621426480880e-1) },
+ { SC_(1.398153686523437500000000000000000000000e2), SC_(-2.796307373046875000000000000000000000000e2), SC_(-2.998191528320312500000000000000000000000e2), SC_(1.362894033659300275403466231025798172725e-1), SC_(8.637105966340699724596533768974201827275e-1) },
+ { SC_(1.411548767089843750000000000000000000000e2), SC_(4.234646301269531250000000000000000000000e2), SC_(4.564059448242187500000000000000000000000e2), SC_(8.823911704414834681763667937283519019012e-1), SC_(1.176088295585165318236332062716480980988e-1) },
+ { SC_(1.412092437744140625000000000000000000000e2), SC_(-5.648369750976562500000000000000000000000e2), SC_(-6.121605834960937500000000000000000000000e2), SC_(1.009591131349694784465979694591174275998e-1), SC_(8.990408868650305215534020305408825724002e-1) },
+ { SC_(1.418730010986328125000000000000000000000e2), SC_(7.093649902343750000000000000000000000000e2), SC_(7.771733398437500000000000000000000000000e2), SC_(9.267321517377437964086387319256785323586e-1), SC_(7.326784826225620359136126807432146764138e-2) },
+ { SC_(1.421407928466796875000000000000000000000e2), SC_(1.421407985687255859375000000000000000000e1), SC_(1.693089866638183593750000000000000000000e1), SC_(9.716930124445638242695229486641864482654e-1), SC_(2.830698755543617573047705133581355173461e-2) },
+ { SC_(1.451678161621093750000000000000000000000e2), SC_(-3.629195404052734375000000000000000000000e1), SC_(-4.362435913085937500000000000000000000000e1), SC_(3.533602600581811336158053491455769518330e-3), SC_(9.964663973994181886638419465085442304817e-1) },
+ { SC_(1.453909606933593750000000000000000000000e2), SC_(7.269548034667968750000000000000000000000e1), SC_(9.081201171875000000000000000000000000000e1), SC_(9.996902434511801120819127684695177885632e-1), SC_(3.097565488198879180872315304822114368250e-4) },
+ { SC_(1.465597686767578125000000000000000000000e2), SC_(-1.099198303222656250000000000000000000000e2), SC_(-1.433915863037109375000000000000000000000e2), SC_(2.015420573828870128639231110699342930239e-5), SC_(9.999798457942617112987136076888930065707e-1) },
+ { SC_(1.481294708251953125000000000000000000000e2), SC_(-1.333165130615234375000000000000000000000e2), SC_(-1.347872009277343750000000000000000000000e2), SC_(4.410606059603438079036891188066765050315e-1), SC_(5.589393940396561920963108811933234949685e-1) },
+ { SC_(1.486265258789062500000000000000000000000e2), SC_(-1.471402587890625000000000000000000000000e2), SC_(-1.500634155273437500000000000000000000000e2), SC_(3.834994019665212445998163679193241461748e-1), SC_(6.165005980334787554001836320806758538252e-1) },
+ { SC_(1.502534332275390625000000000000000000000e2), SC_(-1.501031799316406250000000000000000000000e2), SC_(-1.552705535888671875000000000000000000000e2), SC_(2.952168772407109658835173884363384891592e-1), SC_(7.047831227592890341164826115636615108408e-1) },
+ { SC_(1.507458496093750000000000000000000000000e2), SC_(-1.507458496093750000000000000000000000000e2), SC_(-1.581374206542968750000000000000000000000e2), SC_(2.192478107902515304017154908910307097216e-1), SC_(7.807521892097484695982845091089692902784e-1) },
+ { SC_(1.509373626708984375000000000000000000000e2), SC_(1.509524536132812500000000000000000000000e2), SC_(1.596771850585937500000000000000000000000e2), SC_(8.196698196134246232539955088555504290650e-1), SC_(1.803301803865753767460044911444495709350e-1) },
+ { SC_(1.514400787353515625000000000000000000000e2), SC_(1.515915222167968750000000000000000000000e2), SC_(1.611355438232421875000000000000000000000e2), SC_(8.405662241802794202951485500906860959921e-1), SC_(1.594337758197205797048514499093139040079e-1) },
+ { SC_(1.515480499267578125000000000000000000000e2), SC_(1.530635223388671875000000000000000000000e2), SC_(1.627760925292968750000000000000000000000e2), SC_(8.425584011040393402323486388209564080443e-1), SC_(1.574415988959606597676513611790435919557e-1) },
+ { SC_(1.523462677001953125000000000000000000000e2), SC_(1.675809020996093750000000000000000000000e2), SC_(1.781838073730468750000000000000000000000e2), SC_(8.427739889132064854846702655678356113818e-1), SC_(1.572260110867935145153297344321643886182e-1) },
+ { SC_(1.527500305175781250000000000000000000000e2), SC_(1.833000488281250000000000000000000000000e2), SC_(1.948723449707031250000000000000000000000e2), SC_(8.427900695522180606061518344038782676814e-1), SC_(1.572099304477819393938481655961217323186e-1) },
+ { SC_(1.531033935546875000000000000000000000000e2), SC_(-1.990344085693359375000000000000000000000e2), SC_(-2.115865173339843750000000000000000000000e2), SC_(1.570189149304337531280252058554779217245e-1), SC_(8.429810850695662468719747941445220782755e-1) },
+ { SC_(1.547834472656250000000000000000000000000e2), SC_(2.321751708984375000000000000000000000000e2), SC_(2.468373413085937500000000000000000000000e2), SC_(8.449431924035675707633960529552441039710e-1), SC_(1.550568075964324292366039470447558960290e-1) },
+ { SC_(1.557795562744140625000000000000000000000e2), SC_(-3.115591125488281250000000000000000000000e2), SC_(-3.327529602050781250000000000000000000000e2), SC_(1.363342795901147695317231770561292128059e-1), SC_(8.636657204098852304682768229438707871941e-1) },
+ { SC_(1.558334655761718750000000000000000000000e2), SC_(-4.675003967285156250000000000000000000000e2), SC_(-5.019526672363281250000000000000000000000e2), SC_(1.175588979195506251296008572818974407098e-1), SC_(8.824411020804493748703991427181025592902e-1) },
+ { SC_(1.584414825439453125000000000000000000000e2), SC_(-6.337659301757812500000000000000000000000e2), SC_(-6.836418457031250000000000000000000000000e2), SC_(1.008111913635493983543118803699900448204e-1), SC_(8.991888086364506016456881196300099551796e-1) },
+ { SC_(1.587195434570312500000000000000000000000e2), SC_(7.935977172851562500000000000000000000000e2), SC_(8.650010986328125000000000000000000000000e2), SC_(9.270098267220069738822683626929044682978e-1), SC_(7.299017327799302611773163730709553170218e-2) },
+ { SC_(1.587950134277343750000000000000000000000e2), SC_(1.587950134277343750000000000000000000000e1), SC_(1.865743637084960937500000000000000000000e1), SC_(9.718495582868837841860142886278865994715e-1), SC_(2.815044171311621581398571137211340052848e-2) },
+ { SC_(1.590400085449218750000000000000000000000e2), SC_(-3.976000213623046875000000000000000000000e1), SC_(-4.735921859741210937500000000000000000000e1), SC_(3.427104943685960646316800866785870680051e-3), SC_(9.965728950563140393536831991332141293199e-1) },
+ { SC_(1.594559936523437500000000000000000000000e2), SC_(7.972799682617187500000000000000000000000e1), SC_(9.861891174316406250000000000000000000000e1), SC_(9.997126698554915937834976664241599247614e-1), SC_(2.873301445084062165023335758400752386070e-4) },
+ { SC_(1.595857391357421875000000000000000000000e2), SC_(-1.196893005371093750000000000000000000000e2), SC_(-1.545221252441406250000000000000000000000e2), SC_(1.780296360028319980495500895766825275644e-5), SC_(9.999821970363997168001950449910423317472e-1) },
+ { SC_(1.596211853027343750000000000000000000000e2), SC_(-1.436590576171875000000000000000000000000e2), SC_(-1.451582641601562500000000000000000000000e2), SC_(4.417643071241765182473614578442729999156e-1), SC_(5.582356928758234817526385421557270000844e-1) },
+ { SC_(1.600561065673828125000000000000000000000e2), SC_(-1.584555511474609375000000000000000000000e2), SC_(-1.614573516845703125000000000000000000000e2), SC_(3.841539866041050632940487868711941827449e-1), SC_(6.158460133958949367059512131288058172551e-1) },
+ { SC_(1.615062255859375000000000000000000000000e2), SC_(-1.613447265625000000000000000000000000000e2), SC_(-1.666679534912109375000000000000000000000e2), SC_(2.957088865758827952297766445373411369744e-1), SC_(7.042911134241172047702233554626588630256e-1) },
+ { SC_(1.616351165771484375000000000000000000000e2), SC_(1.616351165771484375000000000000000000000e2), SC_(1.692530822753906250000000000000000000000e2), SC_(7.804668164082968299377228824699980687650e-1), SC_(2.195331835917031700622771175300019312350e-1) },
+ { SC_(1.619469299316406250000000000000000000000e2), SC_(1.619631347656250000000000000000000000000e2), SC_(1.709622802734375000000000000000000000000e2), SC_(8.194965436733574620900731290907810363677e-1), SC_(1.805034563266425379099268709092189636323e-1) },
+ { SC_(1.628569793701171875000000000000000000000e2), SC_(1.630198364257812500000000000000000000000e2), SC_(1.728768768310546875000000000000000000000e2), SC_(8.404660764783773469174485040522021093442e-1), SC_(1.595339235216226530825514959477978906558e-1) },
+ { SC_(1.629447479248046875000000000000000000000e2), SC_(-1.645741882324218750000000000000000000000e2), SC_(-1.746045227050781250000000000000000000000e2), SC_(1.575424483959909318404851228183550185556e-1), SC_(8.424575516040090681595148771816449814444e-1) },
+ { SC_(1.641681671142578125000000000000000000000e2), SC_(-1.805849914550781250000000000000000000000e2), SC_(-1.915462799072265625000000000000000000000e2), SC_(1.573335944854494629142736979246659337814e-1), SC_(8.426664055145505370857263020753340662186e-1) },
+ { SC_(1.642492065429687500000000000000000000000e2), SC_(1.970990600585937500000000000000000000000e2), SC_(2.090523681640625000000000000000000000000e2), SC_(8.426987091196232350996963931516288297837e-1), SC_(1.573012908803767649003036068483711702163e-1) },
+ { SC_(1.643806762695312500000000000000000000000e2), SC_(-2.136948699951171875000000000000000000000e2), SC_(-2.266521148681640625000000000000000000000e2), SC_(1.571073429860085281224507682808356620294e-1), SC_(8.428926570139914718775492317191643379706e-1) },
+ { SC_(1.646915893554687500000000000000000000000e2), SC_(2.470373840332031250000000000000000000000e2), SC_(2.621127624511718750000000000000000000000e2), SC_(8.448668099691590627588855606599569135540e-1), SC_(1.551331900308409372411144393400430864460e-1) },
+ { SC_(1.661657409667968750000000000000000000000e2), SC_(-3.323314819335937500000000000000000000000e2), SC_(-3.541530151367187500000000000000000000000e2), SC_(1.363546046209669111927130706242072700954e-1), SC_(8.636453953790330888072869293757927299046e-1) },
+ { SC_(1.670017242431640625000000000000000000000e2), SC_(5.010051879882812500000000000000000000000e2), SC_(5.365607299804687500000000000000000000000e2), SC_(8.824746044843330736469612185701136118524e-1), SC_(1.175253955156669263530387814298863881476e-1) },
+ { SC_(1.681434631347656250000000000000000000000e2), SC_(6.725738525390625000000000000000000000000e2), SC_(7.238276367187500000000000000000000000000e2), SC_(8.992656987013872665209365356081730016699e-1), SC_(1.007343012986127334790634643918269983301e-1) },
+ { SC_(1.696935729980468750000000000000000000000e2), SC_(-8.484678955078125000000000000000000000000e2), SC_(-9.221135864257812500000000000000000000000e2), SC_(7.282932970219271023945143904387565677350e-2), SC_(9.271706702978072897605485609561243432265e-1) },
+ { SC_(1.698258819580078125000000000000000000000e2), SC_(1.698258781433105468750000000000000000000e1), SC_(1.980040931701660156250000000000000000000e1), SC_(9.719470387146119542829851768946449119598e-1), SC_(2.805296128538804571701482310535508804017e-2) },
+ { SC_(1.744857788085937500000000000000000000000e2), SC_(-4.362144470214843750000000000000000000000e1), SC_(-5.150732040405273437500000000000000000000e1), SC_(3.322995169190575236751479836974775618462e-3), SC_(9.966770048308094247632485201630252243815e-1) },
+ { SC_(1.753515014648437500000000000000000000000e2), SC_(-8.767575073242187500000000000000000000000e1), SC_(-1.074056930541992187500000000000000000000e2), SC_(2.662223893738321424320630318453652402469e-4), SC_(9.997337776106261678575679369681546347598e-1) },
+ { SC_(1.756861419677734375000000000000000000000e2), SC_(-1.317646026611328125000000000000000000000e2), SC_(-1.682105255126953125000000000000000000000e2), SC_(1.550232998735350754650765720581070782100e-5), SC_(9.999844976700126464924534923427941892922e-1) },
+ { SC_(1.781806640625000000000000000000000000000e2), SC_(-1.603625946044921875000000000000000000000e2), SC_(-1.619059753417968750000000000000000000000e2), SC_(4.427510840848753942205017300207371637469e-1), SC_(5.572489159151246057794982699792628362531e-1) },
+ { SC_(1.811584014892578125000000000000000000000e2), SC_(-1.793468170166015625000000000000000000000e2), SC_(-1.824870758056640625000000000000000000000e2), SC_(3.851955828443047286965619499537351163898e-1), SC_(6.148044171556952713034380500462648836102e-1) },
+ { SC_(1.814729614257812500000000000000000000000e2), SC_(1.812914886474609375000000000000000000000e2), SC_(1.868789825439453125000000000000000000000e2), SC_(7.035362100484691927399429102560977978734e-1), SC_(2.964637899515308072600570897439022021266e-1) },
+ { SC_(1.826751861572265625000000000000000000000e2), SC_(1.826751861572265625000000000000000000000e2), SC_(1.907105255126953125000000000000000000000e2), SC_(7.799873196049647286222313130314984070929e-1), SC_(2.200126803950352713777686869685015929071e-1) },
+ { SC_(1.831471099853515625000000000000000000000e2), SC_(1.831654205322265625000000000000000000000e2), SC_(1.926689605712890625000000000000000000000e2), SC_(8.192163967452918136616703813674191971081e-1), SC_(1.807836032547081863383296186325808028919e-1) },
+ { SC_(1.834387359619140625000000000000000000000e2), SC_(1.836221771240234375000000000000000000000e2), SC_(1.940174407958984375000000000000000000000e2), SC_(8.403035276172555322739380106234387661243e-1), SC_(1.596964723827444677260619893765612338757e-1) },
+ { SC_(1.841749572753906250000000000000000000000e2), SC_(1.860167083740234375000000000000000000000e2), SC_(1.966119689941406250000000000000000000000e2), SC_(8.423069271382795700398439101444273937711e-1), SC_(1.576930728617204299601560898555726062289e-1) },
+ { SC_(1.858527374267578125000000000000000000000e2), SC_(-2.044380187988281250000000000000000000000e2), SC_(-2.160265808105468750000000000000000000000e2), SC_(1.574804038174927854751974225084637112666e-1), SC_(8.425195961825072145248025774915362887334e-1) },
+ { SC_(1.867986450195312500000000000000000000000e2), SC_(2.241583862304687500000000000000000000000e2), SC_(2.368225402832031250000000000000000000000e2), SC_(8.425392206438456186820694371845737047599e-1), SC_(1.574607793561543813179305628154262952401e-1) },
+ { SC_(1.868021392822265625000000000000000000000e2), SC_(-2.428427734375000000000000000000000000000e2), SC_(-2.565665283203125000000000000000000000000e2), SC_(1.572680326600672177070073925543010532140e-1), SC_(8.427319673399327822929926074456989467860e-1) },
+ { SC_(1.880148162841796875000000000000000000000e2), SC_(-2.820222167968750000000000000000000000000e2), SC_(-2.980253295898437500000000000000000000000e2), SC_(1.552789395983287090937623733357006268049e-1), SC_(8.447210604016712909062376266642993731951e-1) },
+ { SC_(1.900444183349609375000000000000000000000e2), SC_(-3.800888366699218750000000000000000000000e2), SC_(-4.032850341796875000000000000000000000000e2), SC_(1.363857890620788955477380353547122412928e-1), SC_(8.636142109379211044522619646452877587072e-1) },
+ { SC_(1.910035247802734375000000000000000000000e2), SC_(5.730105590820312500000000000000000000000e2), SC_(6.108234252929687500000000000000000000000e2), SC_(8.825546776651612915449270809923133302827e-1), SC_(1.174453223348387084550729190076866697173e-1) },
+ { SC_(1.914333953857421875000000000000000000000e2), SC_(7.657335815429687500000000000000000000000e2), SC_(8.201442260742187500000000000000000000000e2), SC_(8.994307655353378788627687172889911875494e-1), SC_(1.005692344646621211372312827110088124506e-1) },
+ { SC_(1.915013732910156250000000000000000000000e2), SC_(-9.575068359375000000000000000000000000000e2), SC_(-1.035407836914062500000000000000000000000e3), SC_(7.254550295882910100884475499526303225815e-2), SC_(9.274544970411708989911552450047369677418e-1) },
+ { SC_(1.918582763671875000000000000000000000000e2), SC_(1.918582725524902343750000000000000000000e1), SC_(2.208179092407226562500000000000000000000e1), SC_(9.721242618485546393356290361951045322104e-1), SC_(2.787573815144536066437096380489546778959e-2) },
+ { SC_(1.918984985351562500000000000000000000000e2), SC_(-4.797462463378906250000000000000000000000e1), SC_(-5.617157363891601562500000000000000000000e1), SC_(3.221111566392305522573892879121826455479e-3), SC_(9.967788884336076944774261071208781735445e-1) },
+ { SC_(1.919488067626953125000000000000000000000e2), SC_(-9.597440338134765625000000000000000000000e1), SC_(-1.165421524047851562500000000000000000000e2), SC_(2.481260732563524200219933878692461610213e-4), SC_(9.997518739267436475799780066121307538390e-1) },
+ { SC_(1.929777069091796875000000000000000000000e2), SC_(-1.447332763671875000000000000000000000000e2), SC_(-1.828341522216796875000000000000000000000e2), SC_(1.358098637444654191572655104301270829943e-5), SC_(9.999864190136255534580842734489569872917e-1) },
+ { SC_(1.929932708740234375000000000000000000000e2), SC_(-1.736939392089843750000000000000000000000e2), SC_(-1.752710113525390625000000000000000000000e2), SC_(4.434359641618019366789276090072593648763e-1), SC_(5.565640358381980633210723909927406351237e-1) },
+ { SC_(1.935389862060546875000000000000000000000e2), SC_(1.916035919189453125000000000000000000000e2), SC_(1.948214416503906250000000000000000000000e2), SC_(6.142723104748303441684413193877427660393e-1), SC_(3.857276895251696558315586806122572339607e-1) },
+ { SC_(1.937735595703125000000000000000000000000e2), SC_(1.935797882080078125000000000000000000000e2), SC_(1.993231201171875000000000000000000000000e2), SC_(7.031303801855181023960454440247304541731e-1), SC_(2.968696198144818976039545559752695458269e-1) },
+ { SC_(1.941185607910156250000000000000000000000e2), SC_(1.941185607910156250000000000000000000000e2), SC_(2.023715820312500000000000000000000000000e2), SC_(7.797728872340829673174837038355921015185e-1), SC_(2.202271127659170326825162961644078984815e-1) },
+ { SC_(1.962219390869140625000000000000000000000e2), SC_(-1.962415618896484375000000000000000000000e2), SC_(-2.060424804687500000000000000000000000000e2), SC_(1.809237828594511737114522040101156011652e-1), SC_(8.190762171405488262885477959898843988348e-1) },
+ { SC_(1.974919281005859375000000000000000000000e2), SC_(-1.976894226074218750000000000000000000000e2), SC_(-2.084357757568359375000000000000000000000e2), SC_(1.597848828006174813168828984223774741925e-1), SC_(8.402151171993825186831171015776225258075e-1) },
+ { SC_(1.977043151855468750000000000000000000000e2), SC_(1.996813507080078125000000000000000000000e2), SC_(2.106204223632812500000000000000000000000e2), SC_(8.422293832834955684228336504298493504347e-1), SC_(1.577706167165044315771663495701506495653e-1) },
+ { SC_(1.985762634277343750000000000000000000000e2), SC_(-2.184338989257812500000000000000000000000e2), SC_(-2.303740386962890625000000000000000000000e2), SC_(1.575531385245673058508978138666145574355e-1), SC_(8.424468614754326941491021861333854425645e-1) },
+ { SC_(1.988137054443359375000000000000000000000e2), SC_(2.385764617919921875000000000000000000000e2), SC_(2.516024322509765625000000000000000000000e2), SC_(8.424688825000982079679215138264048043475e-1), SC_(1.575311174999017920320784861735951956525e-1) },
+ { SC_(1.992922668457031250000000000000000000000e2), SC_(-2.590799255371093750000000000000000000000e2), SC_(-2.732116088867187500000000000000000000000e2), SC_(1.573382255153084153679636715700757369509e-1), SC_(8.426617744846915846320363284299242630491e-1) },
+ { SC_(2.322846374511718750000000000000000000000e2), SC_(3.484269409179687500000000000000000000000e2), SC_(3.660482482910156250000000000000000000000e2), SC_(8.445224219835303698101085035756072755625e-1), SC_(1.554775780164696301898914964243927244375e-1) },
+ { SC_(2.906821289062500000000000000000000000000e2), SC_(5.813642578125000000000000000000000000000e2), SC_(6.095877075195312500000000000000000000000e2), SC_(8.635682877769042305180745412047783757853e-1), SC_(1.364317122230957694819254587952216242147e-1) },
+ /*
+ { SC_(9.757655029296875000000000000000000000000e2), SC_(-2.927296386718750000000000000000000000000e3), SC_(-3.009226074218750000000000000000000000000e3), SC_(1.164317566424995639445047413284130115370e-1), SC_(8.835682433575004360554952586715869884630e-1) },
+ { SC_(1.879048828125000000000000000000000000000e3), SC_(7.516195312500000000000000000000000000000e3), SC_(7.678772949218750000000000000000000000000e3), SC_(9.017566036730798342611358387622429767684e-1), SC_(9.824339632692016573886416123775702323164e-2) },
+ { SC_(2.308069091796875000000000000000000000000e3), SC_(-1.154034570312500000000000000000000000000e4), SC_(-1.179905078125000000000000000000000000000e4), SC_(6.872608129209766834994044970484572985093e-2), SC_(9.312739187079023316500595502951542701491e-1) },
+ { SC_(8.064482421875000000000000000000000000000e3), SC_(-8.064482421875000000000000000000000000000e2), SC_(-8.193711547851562500000000000000000000000e2), SC_(2.389575887949156628152767472787355181112e-2), SC_(9.761042411205084337184723252721264481889e-1) },
+ { SC_(1.567437500000000000000000000000000000000e4), SC_(-3.918593750000000000000000000000000000000e3), SC_(-3.985162353515625000000000000000000000000e3), SC_(1.542392032294953892149510464673239432939e-3), SC_(9.984576079677050461078504895353267605671e-1) },
+ { SC_(2.000542187500000000000000000000000000000e4), SC_(-1.000271093750000000000000000000000000000e4), SC_(-1.020245312500000000000000000000000000000e4), SC_(4.337531004895530778641649516506912837255e-5), SC_(9.999566246899510446922135835048349308716e-1) },
+ { SC_(5.348914843750000000000000000000000000000e4), SC_(-4.011685937500000000000000000000000000000e4), SC_(-4.073089843750000000000000000000000000000e4), SC_(3.883382003866549840825255916580316551597e-7), SC_(9.999996116617996133450159174744083419683e-1) }
+ */
+ }};
+#undef SC_
+
Added: sandbox/math_toolkit/libs/math/test/test_nc_t.cpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/test/test_nc_t.cpp 2008-02-19 11:52:02 EST (Tue, 19 Feb 2008)
@@ -0,0 +1,515 @@
+// test_nc_t.cpp
+
+// Copyright John Maddock 2008.
+
+// Use, modification and distribution are subject to the
+// Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt
+// or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+#ifdef _MSC_VER
+#pragma warning (disable:4127 4512)
+#endif
+
+#if !defined(TEST_FLOAT) && !defined(TEST_DOUBLE) && !defined(TEST_LDOUBLE) && !defined(TEST_REAL_CONCEPT)
+# define TEST_FLOAT
+# define TEST_DOUBLE
+# define TEST_LDOUBLE
+# define TEST_REAL_CONCEPT
+#endif
+
+#include <boost/math/concepts/real_concept.hpp> // for real_concept
+#include <boost/math/distributions/non_central_t.hpp> // for chi_squared_distribution
+#include <boost/test/included/test_exec_monitor.hpp> // for test_main
+#include <boost/test/floating_point_comparison.hpp> // for BOOST_CHECK_CLOSE
+
+#include "functor.hpp"
+#include "handle_test_result.hpp"
+
+#include <iostream>
+using std::cout;
+using std::endl;
+#include <limits>
+using std::numeric_limits;
+
+#define BOOST_CHECK_CLOSE_EX(a, b, prec, i) \
+ {\
+ unsigned int failures = boost::unit_test::results_collector.results( boost::unit_test::framework::current_test_case().p_id ).p_assertions_failed;\
+ BOOST_CHECK_CLOSE(a, b, prec); \
+ if(failures != boost::unit_test::results_collector.results( boost::unit_test::framework::current_test_case().p_id ).p_assertions_failed)\
+ {\
+ std::cerr << "Failure was at row " << i << std::endl;\
+ std::cerr << std::setprecision(35); \
+ std::cerr << "{ " << data[i][0] << " , " << data[i][1] << " , " << data[i][2];\
+ std::cerr << " , " << data[i][3] << " , " << data[i][4] << " } " << std::endl;\
+ }\
+ }
+
+#define BOOST_CHECK_EX(a, i) \
+ {\
+ unsigned int failures = boost::unit_test::results_collector.results( boost::unit_test::framework::current_test_case().p_id ).p_assertions_failed;\
+ BOOST_CHECK(a); \
+ if(failures != boost::unit_test::results_collector.results( boost::unit_test::framework::current_test_case().p_id ).p_assertions_failed)\
+ {\
+ std::cerr << "Failure was at row " << i << std::endl;\
+ std::cerr << std::setprecision(35); \
+ std::cerr << "{ " << data[i][0] << " , " << data[i][1] << " , " << data[i][2];\
+ std::cerr << " , " << data[i][3] << " , " << data[i][4] << " } " << std::endl;\
+ }\
+ }
+
+void expected_results()
+{
+ //
+ // Define the max and mean errors expected for
+ // various compilers and platforms.
+ //
+ const char* largest_type;
+#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+ if(boost::math::policies::digits<double, boost::math::policies::policy<> >() == boost::math::policies::digits<long double, boost::math::policies::policy<> >())
+ {
+ largest_type = "(long\\s+)?double|real_concept";
+ }
+ else
+ {
+ largest_type = "long double|real_concept";
+ }
+#else
+ largest_type = "(long\\s+)?double|real_concept";
+#endif
+
+ //
+ // Catch all cases come last:
+ //
+ add_expected_result(
+ "[^|]*", // compiler
+ "[^|]*", // stdlib
+ "[^|]*", // platform
+ largest_type, // test type(s)
+ "[^|]*", // test data group
+ "[^|]*", 3, 2); // test function
+
+ //
+ // Finish off by printing out the compiler/stdlib/platform names,
+ // we do this to make it easier to mark up expected error rates.
+ //
+ std::cout << "Tests run with " << BOOST_COMPILER << ", "
+ << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
+}
+
+template <class RealType>
+RealType naive_pdf(RealType v, RealType delta, RealType x)
+{
+}
+
+template <class RealType>
+RealType naive_mean(RealType v, RealType delta)
+{
+ using boost::math::tgamma;
+ return delta * sqrt(v / 2) * tgamma((v-1)/2) / tgamma(v/2);
+}
+
+float naive_mean(float v, float delta)
+{
+ return (float)naive_mean((double)v, (double)delta);
+}
+
+template <class RealType>
+RealType naive_variance(RealType v, RealType delta)
+{
+ using boost::math::tgamma;
+ RealType r = tgamma((v-1)/2) / tgamma(v/2);
+ r *= r;
+ r *= -delta * delta * v / 2;
+ r += (1 + delta * delta) * v / (v - 2);
+ return r;
+}
+
+float naive_variance(float v, float delta)
+{
+ return (float)naive_variance((double)v, (double)delta);
+}
+
+template <class RealType>
+RealType naive_skewness(RealType v, RealType delta)
+{
+ using boost::math::tgamma;
+ RealType tgr = tgamma((v-1)/2) / tgamma(v / 2);
+ RealType r = delta * sqrt(v) * tgamma((v-1)/2)
+ * (v * (-3 + delta * delta + 2 * v) / ((-3 + v) * (-2 + v))
+ - 2 * ((1 + delta * delta) * v / (-2 + v) - delta * delta * v * tgr * tgr / 2));
+ r /= boost::math::constants::root_two<RealType>()
+ * pow(((1+delta*delta) * v / (-2+v) - delta*delta*v*tgr*tgr/2), RealType(1.5f))
+ * tgamma(v/2);
+ return r;
+}
+
+float naive_skewness(float v, float delta)
+{
+ return (float)naive_skewness((double)v, (double)delta);
+}
+
+template <class RealType>
+RealType naive_kurtosis_excess(RealType v, RealType delta)
+{
+ using boost::math::tgamma;
+ RealType tgr = tgamma((v-1)/2) / tgamma(v / 2);
+ RealType r = -delta * delta * v * tgr * tgr / 2;
+ r *= v * (delta * delta * (1 + v) + 3 * (-5 + 3 * v)) / ((-3 + v)*(-2+v))
+ - 3 * ((1 + delta * delta) * v / (-2 + v) - delta * delta * v * tgr * tgr / 2);
+ r += (3 + 6 * delta * delta + delta * delta * delta * delta)* v * v
+ / ((-4+v) * (-2+v));
+ r /= (1+delta*delta)*v / (-2+v) - delta*delta*v *tgr*tgr/2;
+ r /= (1+delta*delta)*v / (-2+v) - delta*delta*v *tgr*tgr/2;
+ return r;
+}
+
+float naive_kurtosis_excess(float v, float delta)
+{
+ return (float)naive_kurtosis_excess((double)v, (double)delta);
+}
+
+template <class RealType>
+void test_spot(
+ RealType df, // Degrees of freedom
+ RealType ncp, // non-centrality param
+ RealType t, // T statistic
+ RealType P, // CDF
+ RealType Q, // Complement of CDF
+ RealType tol) // Test tolerance
+{
+ boost::math::non_central_t_distribution<RealType> dist(df, ncp);
+ BOOST_CHECK_CLOSE(
+ cdf(dist, t), P, tol);
+ try{
+ BOOST_CHECK_CLOSE(
+ mean(dist), naive_mean(df, ncp), tol);
+ BOOST_CHECK_CLOSE(
+ variance(dist), naive_variance(df, ncp), tol);
+ BOOST_CHECK_CLOSE(
+ skewness(dist), naive_skewness(df, ncp), tol * 10);
+ BOOST_CHECK_CLOSE(
+ kurtosis_excess(dist), naive_kurtosis_excess(df, ncp), tol * 10);
+ BOOST_CHECK_CLOSE(
+ kurtosis(dist), 3 + naive_kurtosis_excess(df, ncp), tol * 10);
+ }
+ catch(const std::domain_error&)
+ {
+ }
+ /*
+ BOOST_CHECK_CLOSE(
+ pdf(dist, t), naive_pdf(dist.degrees_of_freedom(), ncp, t), tol * 50);
+ */
+ if((P < 0.99) && (Q < 0.99))
+ {
+ //
+ // We can only check this if P is not too close to 1,
+ // so that we can guarentee Q is reasonably free of error:
+ //
+ BOOST_CHECK_CLOSE(
+ cdf(complement(dist, t)), Q, tol);
+ BOOST_CHECK_CLOSE(
+ quantile(dist, P), t, tol * 10);
+ BOOST_CHECK_CLOSE(
+ quantile(complement(dist, Q)), t, tol * 10);
+ /*
+ BOOST_CHECK_CLOSE(
+ dist.find_degrees_of_freedom(ncp, t, P), df, tol * 10);
+ BOOST_CHECK_CLOSE(
+ dist.find_degrees_of_freedom(boost::math::complement(ncp, t, Q)), df, tol * 10);
+ BOOST_CHECK_CLOSE(
+ dist.find_non_centrality(df, t, P), ncp, tol * 10);
+ BOOST_CHECK_CLOSE(
+ dist.find_non_centrality(boost::math::complement(df, t, Q)), ncp, tol * 10);
+ */
+ }
+}
+
+template <class RealType> // Any floating-point type RealType.
+void test_spots(RealType)
+{
+ //
+ // Approx limit of test data is 12 digits expressed here as a persentage:
+ //
+ RealType tolerance = (std::max)(
+ boost::math::tools::epsilon<RealType>(),
+ (RealType)5e-12f) * 100;
+ //
+ // At float precision we need to up the tolerance, since
+ // the input values are rounded off to inexact quantities
+ // the results get thrown off by a noticeable amount.
+ //
+ if(boost::math::tools::digits<RealType>() < 50)
+ tolerance *= 50;
+ if(boost::is_floating_point<RealType>::value != 1)
+ tolerance *= 20; // real_concept special functions are less accurate
+
+ cout << "Tolerance = " << tolerance << "%." << endl;
+
+ //
+ // Test data is taken from:
+ //
+ // Computing discrete mixtures of continuous
+ // distributions: noncentral chisquare, noncentral t
+ // and the distribution of the square of the sample
+ // multiple correlation coeficient.
+ // Denise Benton, K. Krishnamoorthy.
+ // Computational Statistics & Data Analysis 43 (2003) 249 267
+ //
+ test_spot(
+ static_cast<RealType>(3), // degrees of freedom
+ static_cast<RealType>(1), // non centrality
+ static_cast<RealType>(2.34), // T
+ static_cast<RealType>(0.801888999613917), // Probability of result (CDF), P
+ static_cast<RealType>(1-0.801888999613917), // Q = 1 - P
+ tolerance);
+ test_spot(
+ static_cast<RealType>(126), // degrees of freedom
+ static_cast<RealType>(-2), // non centrality
+ static_cast<RealType>(-4.33), // T
+ static_cast<RealType>(1.252846196792878e-2), // Probability of result (CDF), P
+ static_cast<RealType>(1-1.252846196792878e-2), // Q = 1 - P
+ tolerance);
+ test_spot(
+ static_cast<RealType>(20), // degrees of freedom
+ static_cast<RealType>(23), // non centrality
+ static_cast<RealType>(23), // T
+ static_cast<RealType>(0.460134400391924), // Probability of result (CDF), P
+ static_cast<RealType>(1-0.460134400391924), // Q = 1 - P
+ tolerance);
+ test_spot(
+ static_cast<RealType>(20), // degrees of freedom
+ static_cast<RealType>(33), // non centrality
+ static_cast<RealType>(34), // T
+ static_cast<RealType>(0.532008386378725), // Probability of result (CDF), P
+ static_cast<RealType>(1-0.532008386378725), // Q = 1 - P
+ tolerance);
+ test_spot(
+ static_cast<RealType>(12), // degrees of freedom
+ static_cast<RealType>(38), // non centrality
+ static_cast<RealType>(39), // T
+ static_cast<RealType>(0.495868184917805), // Probability of result (CDF), P
+ static_cast<RealType>(1-0.495868184917805), // Q = 1 - P
+ tolerance);
+ test_spot(
+ static_cast<RealType>(12), // degrees of freedom
+ static_cast<RealType>(39), // non centrality
+ static_cast<RealType>(39), // T
+ static_cast<RealType>(0.446304024668836), // Probability of result (CDF), P
+ static_cast<RealType>(1-0.446304024668836), // Q = 1 - P
+ tolerance);
+ test_spot(
+ static_cast<RealType>(200), // degrees of freedom
+ static_cast<RealType>(38), // non centrality
+ static_cast<RealType>(39), // T
+ static_cast<RealType>(0.666194209961795), // Probability of result (CDF), P
+ static_cast<RealType>(1-0.666194209961795), // Q = 1 - P
+ tolerance);
+ test_spot(
+ static_cast<RealType>(200), // degrees of freedom
+ static_cast<RealType>(42), // non centrality
+ static_cast<RealType>(40), // T
+ static_cast<RealType>(0.179292265426085), // Probability of result (CDF), P
+ static_cast<RealType>(1-0.179292265426085), // Q = 1 - P
+ tolerance);
+
+ boost::math::non_central_t_distribution<RealType> dist(static_cast<RealType>(8), static_cast<RealType>(12));
+ BOOST_CHECK_CLOSE(pdf(dist, 12), static_cast<RealType>(1.235329715425894935157684607751972713457e-1L), tolerance);
+ BOOST_CHECK_CLOSE(pdf(boost::math::non_central_t_distribution<RealType>(126, -2), -4), static_cast<RealType>(5.797932289365814702402873546466798025787e-2L), tolerance);
+ BOOST_CHECK_CLOSE(pdf(boost::math::non_central_t_distribution<RealType>(126, 2), 4), static_cast<RealType>(5.797932289365814702402873546466798025787e-2L), tolerance);
+} // template <class RealType>void test_spots(RealType)
+
+template <class T>
+T nct_cdf(T df, T nc, T x)
+{
+ return cdf(boost::math::non_central_t_distribution<T>(df, nc), x);
+}
+
+template <class T>
+T nct_ccdf(T df, T nc, T x)
+{
+ return cdf(complement(boost::math::non_central_t_distribution<T>(df, nc), x));
+}
+
+template <typename T>
+void do_test_nc_t(T& data, const char* type_name, const char* test)
+{
+ typedef typename T::value_type row_type;
+ typedef typename row_type::value_type value_type;
+
+ std::cout << "Testing: " << test << std::endl;
+
+ value_type (*fp1)(value_type, value_type, value_type) = nct_cdf;
+ boost::math::tools::test_result<value_type> result;
+
+ result = boost::math::tools::test(
+ data,
+ bind_func(fp1, 0, 1, 2),
+ extract_result(3));
+ handle_test_result(result, data[result.worst()], result.worst(),
+ type_name, "CDF", test);
+
+ fp1 = nct_ccdf;
+ result = boost::math::tools::test(
+ data,
+ bind_func(fp1, 0, 1, 2),
+ extract_result(4));
+ handle_test_result(result, data[result.worst()], result.worst(),
+ type_name, "CCDF", test);
+
+ std::cout << std::endl;
+
+}
+
+template <typename T>
+void quantile_sanity_check(T& data, const char* type_name, const char* test)
+{
+ typedef typename T::value_type row_type;
+ typedef typename row_type::value_type value_type;
+
+ //
+ // Tests with type real_concept take rather too long to run, so
+ // for now we'll disable them:
+ //
+ if(!boost::is_floating_point<value_type>::value)
+ return;
+
+ std::cout << "Testing: " << type_name << " quantile sanity check, with tests " << test << std::endl;
+
+ //
+ // These sanity checks test for a round trip accuracy of one half
+ // of the bits in T, unless T is type float, in which case we check
+ // for just one decimal digit. The problem here is the sensitivity
+ // of the functions, not their accuracy. This test data was generated
+ // for the forward functions, which means that when it is used as
+ // the input to the inverses then it is necessarily inexact. This rounding
+ // of the input is what makes the data unsuitable for use as an accuracy check,
+ // and also demonstrates that you can't in general round-trip these functions.
+ // It is however a useful sanity check.
+ //
+ value_type precision = static_cast<value_type>(ldexp(1.0, 1-boost::math::policies::digits<value_type, boost::math::policies::policy<> >()/2)) * 100;
+ if(boost::math::policies::digits<value_type, boost::math::policies::policy<> >() < 50)
+ precision = 1; // 1% or two decimal digits, all we can hope for when the input is truncated to float
+
+ for(unsigned i = 0; i < data.size(); ++i)
+ {
+ if(data[i][3] == 0)
+ {
+ BOOST_CHECK(0 == quantile(boost::math::non_central_t_distribution<value_type>(data[i][0], data[i][1]), data[i][3]));
+ }
+ else if(data[i][3] < 0.9999f)
+ {
+ value_type p = quantile(boost::math::non_central_t_distribution<value_type>(data[i][0], data[i][1]), data[i][3]);
+ value_type pt = data[i][2];
+ BOOST_CHECK_CLOSE_EX(pt, p, precision, i);
+ }
+ if(data[i][4] == 0)
+ {
+ BOOST_CHECK(0 == quantile(complement(boost::math::non_central_t_distribution<value_type>(data[i][0], data[i][1]), data[i][3])));
+ }
+ else if(data[i][4] < 0.9999f)
+ {
+ value_type p = quantile(complement(boost::math::non_central_t_distribution<value_type>(data[i][0], data[i][1]), data[i][4]));
+ value_type pt = data[i][2];
+ BOOST_CHECK_CLOSE_EX(pt, p, precision, i);
+ }
+ if(boost::math::tools::digits<value_type>() > 50)
+ {
+ //
+ // Sanity check mode, the accuracy of
+ // the mode is at *best* the square root of the accuracy of the PDF:
+ //
+ try{
+ value_type m = mode(boost::math::non_central_t_distribution<value_type>(data[i][0], data[i][1]));
+ value_type p = pdf(boost::math::non_central_t_distribution<value_type>(data[i][0], data[i][1]), m);
+ BOOST_CHECK_EX(pdf(boost::math::non_central_t_distribution<value_type>(data[i][0], data[i][1]), m * (1 + sqrt(precision) * 50)) <= p, i);
+ BOOST_CHECK_EX(pdf(boost::math::non_central_t_distribution<value_type>(data[i][0], data[i][1]), m * (1 - sqrt(precision)) * 50) <= p, i);
+ }
+ catch(const boost::math::evaluation_error& ) {}
+#if 0
+ //
+ // Sanity check degrees-of-freedom finder, don't bother at float
+ // precision though as there's not enough data in the probability
+ // values to get back to the correct degrees of freedom or
+ // non-cenrality parameter:
+ //
+ try{
+ if((data[i][3] < 0.99) && (data[i][3] != 0))
+ {
+ BOOST_CHECK_CLOSE_EX(
+ boost::math::non_central_t_distribution<value_type>::find_degrees_of_freedom(data[i][1], data[i][2], data[i][3]),
+ data[i][0], precision, i);
+ BOOST_CHECK_CLOSE_EX(
+ boost::math::non_central_t_distribution<value_type>::find_non_centrality(data[i][0], data[i][2], data[i][3]),
+ data[i][1], precision, i);
+ }
+ if((data[i][4] < 0.99) && (data[i][4] != 0))
+ {
+ BOOST_CHECK_CLOSE_EX(
+ boost::math::non_central_t_distribution<value_type>::find_degrees_of_freedom(boost::math::complement(data[i][1], data[i][2], data[i][4])),
+ data[i][0], precision, i);
+ BOOST_CHECK_CLOSE_EX(
+ boost::math::non_central_t_distribution<value_type>::find_non_centrality(boost::math::complement(data[i][0], data[i][2], data[i][4])),
+ data[i][1], precision, i);
+ }
+ }
+ catch(const std::exception& e)
+ {
+ BOOST_ERROR(e.what());
+ }
+#endif
+ }
+ }
+}
+
+template <typename T>
+void test_accuracy(T, const char* type_name)
+{
+#include "nct.ipp"
+ do_test_nc_t(nct, type_name, "Non Central T");
+ // quantile_sanity_check(nct, type_name, "Non Central T");
+}
+
+int test_main(int, char* [])
+{
+ BOOST_MATH_CONTROL_FP;
+ // Basic sanity-check spot values.
+ expected_results();
+
+ // (Parameter value, arbitrarily zero, only communicates the floating point type).
+#ifdef TEST_FLOAT
+ test_spots(0.0F); // Test float.
+#endif
+#ifdef TEST_DOUBLE
+ test_spots(0.0); // Test double.
+#endif
+#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+#ifdef TEST_LDOUBLE
+ test_spots(0.0L); // Test long double.
+#endif
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+#ifdef TEST_REAL_CONCEPT
+ test_spots(boost::math::concepts::real_concept(0.)); // Test real concept.
+#endif
+#endif
+#endif
+
+#ifdef TEST_FLOAT
+ test_accuracy(0.0F, "float"); // Test float.
+#endif
+#ifdef TEST_DOUBLE
+ test_accuracy(0.0, "double"); // Test double.
+#endif
+#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+#ifdef TEST_LDOUBLE
+ test_accuracy(0.0L, "long double"); // Test long double.
+#endif
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+#ifdef TEST_REAL_CONCEPT
+ test_accuracy(boost::math::concepts::real_concept(0.), "real_concept"); // Test real concept.
+#endif
+#endif
+#endif
+ return 0;
+} // int test_main(int, char* [])
+
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