Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50313 - in sandbox/math_toolkit: boost/math/distributions boost/math/distributions/detail libs/math/doc/sf_and_dist libs/math/test
From: john_at_[hidden]
Date: 2008-12-18 07:27:42


Author: johnmaddock
Date: 2008-12-18 07:27:41 EST (Thu, 18 Dec 2008)
New Revision: 50313
URL: http://svn.boost.org/trac/boost/changeset/50313

Log:
Added initial version of hypergeometric distribution.
Added:
   sandbox/math_toolkit/boost/math/distributions/detail/hypergeometric_cdf.hpp (contents, props changed)
   sandbox/math_toolkit/boost/math/distributions/detail/hypergeometric_pdf.hpp (contents, props changed)
   sandbox/math_toolkit/boost/math/distributions/detail/hypergeometric_quantile.hpp (contents, props changed)
   sandbox/math_toolkit/boost/math/distributions/hypergeometric.hpp (contents, props changed)
   sandbox/math_toolkit/libs/math/test/hypergeometric_test_data.ipp (contents, props changed)
   sandbox/math_toolkit/libs/math/test/test_hypergeometric_dist.cpp (contents, props changed)
Text files modified:
   sandbox/math_toolkit/libs/math/doc/sf_and_dist/Jamfile.v2 | 5 +++++
   1 files changed, 5 insertions(+), 0 deletions(-)

Added: sandbox/math_toolkit/boost/math/distributions/detail/hypergeometric_cdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/distributions/detail/hypergeometric_cdf.hpp 2008-12-18 07:27:41 EST (Thu, 18 Dec 2008)
@@ -0,0 +1,83 @@
+// Copyright 2008 John Maddock
+//
+// 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_DISTRIBUTIONS_DETAIL_HG_CDF_HPP
+#define BOOST_MATH_DISTRIBUTIONS_DETAIL_HG_CDF_HPP
+
+#include <boost/math/policies/error_handling.hpp>
+#include <boost/math/distributions/detail/hypergeometric_pdf.hpp>
+
+namespace boost{ namespace math{ namespace detail{
+
+template <class T, class Policy>
+T hypergeometric_cdf_imp(unsigned x, unsigned r, unsigned n, unsigned N, bool invert, const Policy& pol)
+{
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable:4267)
+#endif
+ BOOST_MATH_STD_USING
+ T result;
+ T mean = T(r * n) / N;
+ if(x < mean)
+ {
+ result = hypergeometric_pdf<T>(x, r, n, N, pol);
+ T diff = result;
+ unsigned lower_limit = static_cast<unsigned>((std::max)(0, (int)(n + r) - (int)(N)));
+ while(result / diff > tools::epsilon<T>())
+ {
+ diff = x * (N + x - n - r) * diff / ((1 + n - x) * (1 + r - x));
+ if(x == lower_limit)
+ break;
+ --x;
+ result += diff;
+ }
+ }
+ else
+ {
+ invert = !invert;
+ ++x;
+ result = hypergeometric_pdf<T>(x, r, n, N, pol);
+ T diff = result;
+ unsigned upper_limit = (std::min)(r, n);
+ while((x <= upper_limit) && (result / diff > tools::epsilon<T>()))
+ {
+ diff = (n - x) * (r - x) * diff / ((x + 1) * (N + x + 1 - n - r));
+ ++x;
+ result += diff;
+ }
+ }
+ if(invert)
+ result = 1 - result;
+ return result;
+#ifdef BOOST_MSVC
+# pragma warning(pop)
+#endif
+}
+
+template <class T, class Policy>
+inline T hypergeometric_cdf(unsigned x, unsigned r, unsigned n, unsigned N, bool invert, const Policy&)
+{
+ BOOST_FPU_EXCEPTION_GUARD
+ typedef typename tools::promote_args<T>::type result_type;
+ typedef typename policies::evaluation<result_type, 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;
+
+ value_type result;
+ result = detail::hypergeometric_cdf_imp<value_type>(x, r, n, N, invert, forwarding_policy());
+ return policies::checked_narrowing_cast<result_type, forwarding_policy>(result, "boost::math::hypergeometric_cdf<%1%>(%1%,%1%,%1%,%1%)");
+}
+
+}}} // namespaces
+
+#endif
+

Added: sandbox/math_toolkit/boost/math/distributions/detail/hypergeometric_pdf.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/distributions/detail/hypergeometric_pdf.hpp 2008-12-18 07:27:41 EST (Thu, 18 Dec 2008)
@@ -0,0 +1,389 @@
+// Copyright 2008 Gautam Sewani
+// Copyright 2008 John Maddock
+//
+// 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_DISTRIBUTIONS_DETAIL_HG_PDF_HPP
+#define BOOST_MATH_DISTRIBUTIONS_DETAIL_HG_PDF_HPP
+
+#include <boost/math/constants/constants.hpp>
+#include <boost/math/special_functions/lanczos.hpp>
+#include <boost/math/special_functions/gamma.hpp>
+#include <boost/math/special_functions/pow.hpp>
+#include <boost/math/special_functions/prime.hpp>
+#include <boost/math/policies/error_handling.hpp>
+
+namespace boost{ namespace math{ namespace detail{
+
+template <class T, class Func>
+void bubble_down_one(T* first, T* last, Func f)
+{
+ using std::swap;
+ T* next = first;
+ ++next;
+ while((next != last) && (!f(*first, *next)))
+ {
+ swap(*first, *next);
+ ++first;
+ ++next;
+ }
+}
+
+template <class T>
+struct sort_functor
+{
+ sort_functor(const T* exponents) : m_exponents(exponents){}
+ bool operator()(int i, int j)
+ {
+ return m_exponents[i] > m_exponents[j];
+ }
+private:
+ const T* m_exponents;
+};
+
+template <class T, class Lanczos, class Policy>
+T hypergeometric_pdf_lanczos_imp(unsigned x, unsigned r, unsigned n, unsigned N, const Lanczos&, const Policy&)
+{
+ BOOST_MATH_STD_USING
+
+ T bases[9] = {
+ T(n) + Lanczos::g() + 0.5f,
+ T(r) + Lanczos::g() + 0.5f,
+ T(N - n) + Lanczos::g() + 0.5f,
+ T(N - r) + Lanczos::g() + 0.5f,
+ 1 / (T(N) + Lanczos::g() + 0.5f),
+ 1 / (T(x) + Lanczos::g() + 0.5f),
+ 1 / (T(n - x) + Lanczos::g() + 0.5f),
+ 1 / (T(r - x) + Lanczos::g() + 0.5f),
+ 1 / (T(N - n - r + x) + Lanczos::g() + 0.5f)
+ };
+ T exponents[9] = {
+ n + 0.5f,
+ r + 0.5f,
+ N - n + 0.5f,
+ N - r + 0.5f,
+ N + 0.5f,
+ x + 0.5f,
+ n - x + 0.5f,
+ r - x + 0.5f,
+ N - n - r + x + 0.5f
+ };
+ int base_e_factors[9] = {
+ -1, -1, -1, -1, 1, 1, 1, 1, 1
+ };
+ int sorted_indexes[9] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8
+ };
+ std::sort(sorted_indexes, sorted_indexes + 9, sort_functor<T>(exponents));
+
+ do{
+ exponents[sorted_indexes[0]] -= exponents[sorted_indexes[1]];
+ bases[sorted_indexes[1]] *= bases[sorted_indexes[0]];
+ base_e_factors[sorted_indexes[1]] += base_e_factors[sorted_indexes[0]];
+ bubble_down_one(sorted_indexes, sorted_indexes + 9, sort_functor<T>(exponents));
+ }while(exponents[sorted_indexes[1]] > 1);
+
+ //
+ // Combine equal powers:
+ //
+ int j = 8;
+ while(exponents[sorted_indexes[j]] == 0) --j;
+ while(j)
+ {
+ while(j && (exponents[sorted_indexes[j-1]] == exponents[sorted_indexes[j]]))
+ {
+ bases[sorted_indexes[j-1]] *= bases[sorted_indexes[j]];
+ exponents[sorted_indexes[j]] = 0;
+ base_e_factors[sorted_indexes[j-1]] += base_e_factors[sorted_indexes[j]];
+ bubble_down_one(sorted_indexes + j, sorted_indexes + 9, sort_functor<T>(exponents));
+ --j;
+ }
+ --j;
+ }
+
+ T result = pow(bases[sorted_indexes[0]] * exp(static_cast<T>(base_e_factors[sorted_indexes[0]])), exponents[sorted_indexes[0]]);
+ for(unsigned i = 1; (i < 9) && (exponents[sorted_indexes[i]] > 0); ++i)
+ {
+ if(exponents[sorted_indexes[i]] == 1)
+ result *= bases[sorted_indexes[i]] * exp(static_cast<T>(base_e_factors[sorted_indexes[i]]));
+ else if(exponents[sorted_indexes[i]] == 0.5f)
+ result *= sqrt(bases[sorted_indexes[i]] * exp(static_cast<T>(base_e_factors[sorted_indexes[i]])));
+ else
+ result *= pow(bases[sorted_indexes[i]] * exp(static_cast<T>(base_e_factors[sorted_indexes[i]])), exponents[sorted_indexes[i]]);
+ }
+
+ result *= Lanczos::lanczos_sum_expG_scaled(static_cast<T>(n + 1))
+ * Lanczos::lanczos_sum_expG_scaled(static_cast<T>(r + 1))
+ * Lanczos::lanczos_sum_expG_scaled(static_cast<T>(N - n + 1))
+ * Lanczos::lanczos_sum_expG_scaled(static_cast<T>(N - r + 1))
+ /
+ ( Lanczos::lanczos_sum_expG_scaled(static_cast<T>(N + 1))
+ * Lanczos::lanczos_sum_expG_scaled(static_cast<T>(x + 1))
+ * Lanczos::lanczos_sum_expG_scaled(static_cast<T>(n - x + 1))
+ * Lanczos::lanczos_sum_expG_scaled(static_cast<T>(r - x + 1))
+ * Lanczos::lanczos_sum_expG_scaled(static_cast<T>(N - n - r + x + 1)));
+
+ return result;
+}
+
+template <class T, class Policy>
+T hypergeometric_pdf_lanczos_imp(unsigned x, unsigned r, unsigned n, unsigned N, const boost::math::lanczos::undefined_lanczos&, const Policy& pol)
+{
+ return exp(
+ boost::math::lgamma(T(n + 1), pol)
+ + boost::math::lgamma(T(r + 1), pol)
+ + boost::math::lgamma(T(N - n + 1), pol)
+ + boost::math::lgamma(T(N - r + 1), pol)
+ - boost::math::lgamma(T(N + 1), pol)
+ - boost::math::lgamma(T(x + 1), pol)
+ - boost::math::lgamma(T(n - x + 1), pol)
+ - boost::math::lgamma(T(r - x + 1), pol)
+ - boost::math::lgamma(T(N - n - r + x + 1), pol));
+}
+
+template <class T>
+inline T integer_power(const T& x, int ex)
+{
+ if(ex < 0)
+ return 1 / integer_power(x, -ex);
+ switch(ex)
+ {
+ case 0:
+ return 1;
+ case 1:
+ return x;
+ case 2:
+ return x * x;
+ case 3:
+ return x * x * x;
+ case 4:
+ return boost::math::pow<4>(x);
+ case 5:
+ return boost::math::pow<5>(x);
+ case 6:
+ return boost::math::pow<6>(x);
+ case 7:
+ return boost::math::pow<7>(x);
+ case 8:
+ return boost::math::pow<8>(x);
+ }
+ BOOST_MATH_STD_USING
+ return pow(x, ex);
+}
+template <class T>
+struct hypergeometric_pdf_prime_loop_result_entry
+{
+ T value;
+ const hypergeometric_pdf_prime_loop_result_entry* next;
+};
+
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4510 4512 4610)
+#endif
+
+struct hypergeometric_pdf_prime_loop_data
+{
+ const unsigned x;
+ const unsigned r;
+ const unsigned n;
+ const unsigned N;
+ unsigned prime_index;
+ unsigned current_prime;
+};
+
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
+template <class T>
+T hypergeometric_pdf_prime_loop_imp(hypergeometric_pdf_prime_loop_data& data, hypergeometric_pdf_prime_loop_result_entry<T>& result)
+{
+ while(data.current_prime <= data.N)
+ {
+ unsigned base = data.current_prime;
+ int prime_powers = 0;
+ while(base <= data.N)
+ {
+ prime_powers += data.n / base;
+ prime_powers += data.r / base;
+ prime_powers += (data.N - data.n) / base;
+ prime_powers += (data.N - data.r) / base;
+ prime_powers -= data.N / base;
+ prime_powers -= data.x / base;
+ prime_powers -= (data.n - data.x) / base;
+ prime_powers -= (data.r - data.x) / base;
+ prime_powers -= (data.N - data.n - data.r + data.x) / base;
+ base *= data.current_prime;
+ }
+ if(prime_powers)
+ {
+ T p = integer_power<T>(data.current_prime, prime_powers);
+ if((p > 1) && (tools::max_value<T>() / p < result.value))
+ {
+ //
+ // The next calculation would overflow, use recursion
+ // to sidestep the issue:
+ //
+ hypergeometric_pdf_prime_loop_result_entry<T> t = { p, &result };
+ data.current_prime = prime(++data.prime_index);
+ return hypergeometric_pdf_prime_loop_imp<T>(data, t);
+ }
+ if((p < 1) && (tools::min_value<T>() / p > result.value))
+ {
+ //
+ // The next calculation would underflow, use recursion
+ // to sidestep the issue:
+ //
+ hypergeometric_pdf_prime_loop_result_entry<T> t = { p, &result };
+ data.current_prime = prime(++data.prime_index);
+ return hypergeometric_pdf_prime_loop_imp<T>(data, t);
+ }
+ result.value *= p;
+ }
+ data.current_prime = prime(++data.prime_index);
+ }
+ //
+ // When we get to here we have run out of prime factors,
+ // the overall result is the product of all the partial
+ // results we have accumulated on the stack so far, these
+ // are in a linked list starting with "data.head" and ending
+ // with "result".
+ //
+ // All that remains is to multiply them together, taking
+ // care not to overflow or underflow.
+ //
+ // Enumerate partial results >= 1 in variable i
+ // and partial results < 1 in variable j:
+ //
+ hypergeometric_pdf_prime_loop_result_entry<T> const *i, *j;
+ i = &result;
+ while(i && i->value < 1)
+ i = i->next;
+ j = &result;
+ while(j && j->value >= 1)
+ j = j->next;
+
+ T prod = 1;
+
+ while(i || j)
+ {
+ while(i && ((prod <= 1) || (j == 0)))
+ {
+ prod *= i->value;
+ i = i->next;
+ while(i && i->value < 1)
+ i = i->next;
+ }
+ while(j && ((prod >= 1) || (i == 0)))
+ {
+ prod *= j->value;
+ j = j->next;
+ while(j && j->value >= 1)
+ j = j->next;
+ }
+ }
+
+ return prod;
+}
+
+template <class T, class Policy>
+inline T hypergeometric_pdf_prime_imp(unsigned x, unsigned r, unsigned n, unsigned N, const Policy&)
+{
+ hypergeometric_pdf_prime_loop_result_entry<T> result = { 1 };
+ hypergeometric_pdf_prime_loop_data data = { x, r, n, N, 0, prime(0) };
+ return hypergeometric_pdf_prime_loop_imp<T>(data, result);
+}
+
+template <class T, class Policy>
+T hypergeometric_pdf_factorial_imp(unsigned x, unsigned r, unsigned n, unsigned N, const Policy&)
+{
+ BOOST_MATH_STD_USING
+ BOOST_ASSERT(N < boost::math::max_factorial<T>::value);
+ T result = boost::math::unchecked_factorial<T>(n);
+ T num[3] = {
+ boost::math::unchecked_factorial<T>(r),
+ boost::math::unchecked_factorial<T>(N - n),
+ boost::math::unchecked_factorial<T>(N - r)
+ };
+ T denom[5] = {
+ boost::math::unchecked_factorial<T>(N),
+ boost::math::unchecked_factorial<T>(x),
+ boost::math::unchecked_factorial<T>(n - x),
+ boost::math::unchecked_factorial<T>(r - x),
+ boost::math::unchecked_factorial<T>(N - n - r + x)
+ };
+ int i = 0;
+ int j = 0;
+ while((i < 3) || (j < 5))
+ {
+ while((j < 5) && ((result >= 1) || (i >= 3)))
+ {
+ result /= denom[j];
+ ++j;
+ }
+ while((i < 3) && ((result <= 1) || (j >= 5)))
+ {
+ result *= num[i];
+ ++i;
+ }
+ }
+ return result;
+}
+
+
+template <class T, class Policy>
+inline typename tools::promote_args<T>::type
+ hypergeometric_pdf(unsigned x, unsigned r, unsigned n, unsigned N, const Policy&)
+{
+ BOOST_FPU_EXCEPTION_GUARD
+ typedef typename tools::promote_args<T>::type result_type;
+ typedef typename policies::evaluation<result_type, Policy>::type value_type;
+ typedef typename lanczos::lanczos<value_type, Policy>::type evaluation_type;
+ typedef typename policies::normalise<
+ Policy,
+ policies::promote_float<false>,
+ policies::promote_double<false>,
+ policies::discrete_quantile<>,
+ policies::assert_undefined<> >::type forwarding_policy;
+
+ value_type result;
+ if(N <= boost::math::max_factorial<value_type>::value)
+ {
+ //
+ // If N is small enough then we can evaluate the PDF via the factorials
+ // directly: table lookup of the factorials gives the best performance
+ // of the methods available:
+ //
+ result = detail::hypergeometric_pdf_factorial_imp<value_type>(x, r, n, N, forwarding_policy());
+ }
+ else if(N <= boost::math::prime(boost::math::max_prime - 1))
+ {
+ //
+ // If N is no larger than the largest prime number in our lookup table
+ // (104729) then we can use prime factorisation to evaluate the PDF,
+ // this is slow but accurate:
+ //
+ result = detail::hypergeometric_pdf_prime_imp<value_type>(x, r, n, N, forwarding_policy());
+ }
+ else
+ {
+ //
+ // Catch all case - use the lanczos approximation - where available -
+ // to evaluate the ratio of factorials. This is reasonably fast
+ // (almost as quick as using logarithmic evaluation in terms of lgamma)
+ // but only a few digits better in accuracy than using lgamma:
+ //
+ result = detail::hypergeometric_pdf_lanczos_imp<value_type>(x, r, n, N, evaluation_type(), forwarding_policy());
+ }
+
+ return policies::checked_narrowing_cast<result_type, forwarding_policy>(result, "boost::math::hypergeometric_pdf<%1%>(%1%,%1%,%1%,%1%)");
+}
+
+}}} // namespaces
+
+#endif
+

Added: sandbox/math_toolkit/boost/math/distributions/detail/hypergeometric_quantile.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/distributions/detail/hypergeometric_quantile.hpp 2008-12-18 07:27:41 EST (Thu, 18 Dec 2008)
@@ -0,0 +1,140 @@
+// Copyright 2008 John Maddock
+//
+// 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_DISTRIBUTIONS_DETAIL_HG_QUANTILE_HPP
+#define BOOST_MATH_DISTRIBUTIONS_DETAIL_HG_QUANTILE_HPP
+
+#include <boost/math/policies/error_handling.hpp>
+#include <boost/math/distributions/detail/hypergeometric_pdf.hpp>
+
+namespace boost{ namespace math{ namespace detail{
+
+template <class T>
+inline unsigned round_x_from_p(unsigned x, T p, T cum, T fudge_factor, const policies::discrete_quantile<policies::integer_round_down>&)
+{
+ if(p * fudge_factor <= cum)
+ return x;
+ return --x;
+}
+
+template <class T>
+inline unsigned round_x_from_p(unsigned x, T p, T cum, T /*fudge_factor*/, const policies::discrete_quantile<policies::integer_round_up>&)
+{
+ if(cum < p)
+ return ++x;
+ return x;
+}
+
+template <class T>
+inline unsigned round_x_from_p(unsigned x, T p, T cum, T fudge_factor, const policies::discrete_quantile<policies::integer_round_inwards>&)
+{
+ if((p > 0.5) && (p * fudge_factor <= cum))
+ return --x;
+ return x;
+}
+
+template <class T>
+inline unsigned round_x_from_p(unsigned x, T p, T cum, T fudge_factor, const policies::discrete_quantile<policies::integer_round_outwards>&)
+{
+ if((p < 0.5) && (p * fudge_factor <= cum))
+ return --x;
+ return x;
+}
+
+template <class T>
+inline unsigned round_x_from_q(unsigned x, T /*q*/, T /*cum*/, T /*fudge_factor*/, const policies::discrete_quantile<policies::integer_round_down>&)
+{
+ return x;
+}
+
+template <class T>
+inline unsigned round_x_from_q(unsigned x, T q, T cum, T fudge_factor, const policies::discrete_quantile<policies::integer_round_up>&)
+{
+ if((q * fudge_factor <= cum) && (q < 0.5))
+ return ++x;
+ return x;
+}
+
+template <class T>
+inline unsigned round_x_from_q(unsigned x, T q, T cum, T fudge_factor, const policies::discrete_quantile<policies::integer_round_inwards>&)
+{
+ if((q > 0.5) && (q * fudge_factor <= cum))
+ return ++x;
+ return x;
+}
+
+template <class T>
+inline unsigned round_x_from_q(unsigned x, T q, T cum, T fudge_factor, const policies::discrete_quantile<policies::integer_round_outwards>&)
+{
+ if((q < 0.5) && (q * fudge_factor <= cum))
+ return ++x;
+ return x;
+}
+
+template <class T, class Policy>
+unsigned hypergeometric_quantile_imp(T p, T q, unsigned r, unsigned n, unsigned N, const Policy& pol)
+{
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable:4267)
+#endif
+ typedef typename Policy::discrete_quantile_type discrete_quantile_type;
+ BOOST_MATH_STD_USING
+ T result;
+ T fudge_factor = 1 + tools::epsilon<T>() * 50;
+ if(p <= 0.5)
+ {
+ unsigned base = static_cast<unsigned>((std::max)(0, (int)(n + r) - (int)(N)));
+ unsigned x = base;
+ result = hypergeometric_pdf<T>(x, r, n, N, pol);
+ T diff = result;
+ while(result * fudge_factor < p)
+ {
+ diff = (n - x) * (r - x) * diff / ((x + 1) * (N + x + 1 - n - r));
+ ++x;
+ result += diff;
+ }
+ return x == base ? x : round_x_from_p(x, p, fudge_factor, result, discrete_quantile_type());
+ }
+ else
+ {
+ unsigned lim = (std::min)(r, n);
+ unsigned x = lim;
+ result = 0;
+ T diff = hypergeometric_pdf<T>(x, r, n, N, pol);
+ while(result * fudge_factor <= q)
+ {
+ result += diff;
+ diff = x * (N + x - n - r) * diff / ((1 + n - x) * (1 + r - x));
+ --x;
+ }
+ return x == lim ? x : round_x_from_q(x, q, result, fudge_factor, discrete_quantile_type());
+ }
+#ifdef BOOST_MSVC
+# pragma warning(pop)
+#endif
+}
+
+template <class T, class Policy>
+inline unsigned hypergeometric_quantile(T p, T q, unsigned r, unsigned n, unsigned N, const Policy&)
+{
+ BOOST_FPU_EXCEPTION_GUARD
+ typedef typename tools::promote_args<T>::type result_type;
+ typedef typename policies::evaluation<result_type, Policy>::type value_type;
+ typedef typename policies::normalise<
+ Policy,
+ policies::promote_float<false>,
+ policies::promote_double<false>,
+ policies::assert_undefined<> >::type forwarding_policy;
+
+ return detail::hypergeometric_quantile_imp<value_type>(p, q, r, n, N, forwarding_policy());
+}
+
+}}} // namespaces
+
+#endif
+

Added: sandbox/math_toolkit/boost/math/distributions/hypergeometric.hpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/boost/math/distributions/hypergeometric.hpp 2008-12-18 07:27:41 EST (Thu, 18 Dec 2008)
@@ -0,0 +1,286 @@
+// Copyright 2008 Gautam Sewani
+// Copyright 2008 John Maddock
+//
+// 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)
+
+#include <boost/math/distributions/detail/common_error_handling.hpp>
+#include <boost/math/distributions/complement.hpp>
+#include <boost/math/distributions/detail/hypergeometric_pdf.hpp>
+#include <boost/math/distributions/detail/hypergeometric_cdf.hpp>
+#include <boost/math/distributions/detail/hypergeometric_quantile.hpp>
+#include <boost/math/special_functions/fpclassify.hpp>
+
+
+namespace boost { namespace math {
+
+ template <class RealType = double, class Policy = policies::policy<> >
+ class hypergeometric_distribution
+ {
+ public:
+ typedef RealType value_type;
+ typedef Policy policy_type;
+
+ hypergeometric_distribution(unsigned r, unsigned n, unsigned N) // Constructor.
+ : m_r(r), m_n(n), m_N(N)
+ {
+ static const char* function = "boost::math::hypergeometric_distribution<%1%>::hypergeometric_distribution";
+ RealType ret;
+ check_params(function, &ret);
+ }
+ // Accessor functions.
+ unsigned total()const
+ {
+ return m_N;
+ }
+
+ unsigned defective()const
+ {
+ return m_n;
+ }
+
+ unsigned sample_count()const
+ {
+ return m_r;
+ }
+
+ bool check_params(const char* function, RealType* result)const
+ {
+ if(m_r > m_N)
+ {
+ *result = boost::math::policies::raise_domain_error<RealType>(
+ function, "Parameter r out of range: must be <= N but got %1%", static_cast<RealType>(m_r), Policy());
+ return false;
+ }
+ if(m_n > m_N)
+ {
+ *result = boost::math::policies::raise_domain_error<RealType>(
+ function, "Parameter n out of range: must be <= N but got %1%", static_cast<RealType>(m_n), Policy());
+ return false;
+ }
+ return true;
+ }
+ bool check_x(unsigned x, const char* function, RealType* result)const
+ {
+ if(x < static_cast<unsigned>((std::max)(0, (int)(m_n + m_r) - (int)(m_N))))
+ {
+ *result = boost::math::policies::raise_domain_error<RealType>(
+ function, "Random variable out of range: must be > 0 and > m + r - N but got %1%", static_cast<RealType>(x), Policy());
+ return false;
+ }
+ if(x > (std::min)(m_r, m_n))
+ {
+ *result = boost::math::policies::raise_domain_error<RealType>(
+ function, "Random variable out of range: must be less than both n and r but got %1%", static_cast<RealType>(x), Policy());
+ return false;
+ }
+ return true;
+ }
+
+ private:
+ // Data members:
+ unsigned m_n; // number of "defective" items
+ unsigned m_N; // number of "total" items
+ unsigned m_r; // number of items picked
+
+ }; // class hypergeometric_distribution
+
+ typedef hypergeometric_distribution<double> hypergeometric;
+
+ template <class RealType, class Policy>
+ inline const std::pair<unsigned, unsigned> range(const hypergeometric_distribution<RealType, Policy>& dist)
+ { // Range of permissible values for random variable x.
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable:4267)
+#endif
+ unsigned r = dist.sample_count();
+ unsigned n = dist.defective();
+ unsigned N = dist.total();
+ unsigned l = static_cast<unsigned>((std::max)(0, (int)(n + r) - (int)(N)));
+ unsigned u = (std::min)(r, n);
+ return std::pair<unsigned, unsigned>(l, u);
+#ifdef BOOST_MSVC
+# pragma warning(pop)
+#endif
+ }
+
+ template <class RealType, class Policy>
+ inline const std::pair<RealType, RealType> support(const hypergeometric_distribution<RealType, Policy>& d)
+ {
+ return range(d);
+ }
+
+ template <class RealType, class Policy>
+ inline RealType pdf(const hypergeometric_distribution<RealType, Policy>& dist, const unsigned& x)
+ {
+ static const char* function = "boost::math::pdf(const hypergeometric_distribution<%1%>&, const %1%&)";
+ RealType result;
+ if(!dist.check_params(function, &result))
+ return result;
+ if(!dist.check_x(x, function, &result))
+ return result;
+
+ return boost::math::detail::hypergeometric_pdf<RealType>(
+ x, dist.sample_count(), dist.defective(), dist.total(), Policy());
+ }
+
+ template <class RealType, class Policy, class U>
+ inline RealType pdf(const hypergeometric_distribution<RealType, Policy>& dist, const U& x)
+ {
+ static const char* function = "boost::math::pdf(const hypergeometric_distribution<%1%>&, const %1%&)";
+ RealType r = x;
+ unsigned u = boost::math::itrunc(r);
+ if(u != r)
+ {
+ return boost::math::policies::raise_domain_error<RealType>(
+ function, "Random variable out of range: must be an integer but got %1%", r, Policy());
+ }
+ return pdf(dist, u);
+ }
+
+ template <class RealType, class Policy>
+ inline RealType cdf(const hypergeometric_distribution<RealType, Policy>& dist, const unsigned& x)
+ {
+ static const char* function = "boost::math::cdf(const hypergeometric_distribution<%1%>&, const %1%&)";
+ RealType result;
+ if(!dist.check_params(function, &result))
+ return result;
+ if(!dist.check_x(x, function, &result))
+ return result;
+
+ return boost::math::detail::hypergeometric_cdf<RealType>(
+ x, dist.sample_count(), dist.defective(), dist.total(), false, Policy());
+ }
+
+ template <class RealType, class Policy, class U>
+ inline RealType cdf(const hypergeometric_distribution<RealType, Policy>& dist, const U& x)
+ {
+ static const char* function = "boost::math::cdf(const hypergeometric_distribution<%1%>&, const %1%&)";
+ RealType r = x;
+ unsigned u = boost::math::itrunc(r);
+ if(u != r)
+ {
+ return boost::math::policies::raise_domain_error<RealType>(
+ function, "Random variable out of range: must be an integer but got %1%", r, Policy());
+ }
+ return cdf(dist, u);
+ }
+
+ template <class RealType, class Policy>
+ inline RealType cdf(const complemented2_type<hypergeometric_distribution<RealType, Policy>, unsigned>& c)
+ {
+ static const char* function = "boost::math::cdf(const hypergeometric_distribution<%1%>&, const %1%&)";
+ RealType result;
+ if(!c.dist.check_params(function, &result))
+ return result;
+ if(!c.dist.check_x(c.param, function, &result))
+ return result;
+
+ return boost::math::detail::hypergeometric_cdf<RealType>(
+ c.param, c.dist.sample_count(), c.dist.defective(), c.dist.total(), true, Policy());
+ }
+
+ template <class RealType, class Policy, class U>
+ inline RealType cdf(const complemented2_type<hypergeometric_distribution<RealType, Policy>, U>& c)
+ {
+ static const char* function = "boost::math::cdf(const hypergeometric_distribution<%1%>&, const %1%&)";
+ RealType r = c.param;
+ unsigned u = boost::math::itrunc(r);
+ if(u != r)
+ {
+ return boost::math::policies::raise_domain_error<RealType>(
+ function, "Random variable out of range: must be an integer but got %1%", r, Policy());
+ }
+ return cdf(complement(c.dist, u));
+ }
+
+ template <class RealType, class Policy>
+ inline RealType quantile(const hypergeometric_distribution<RealType, Policy>& dist, const RealType& p)
+ {
+ BOOST_MATH_STD_USING // for ADL of std functions
+
+ // Checking function argument
+ RealType result;
+ const char* function = "boost::math::quantile(const hypergeometric_distribution<%1%>&, %1%)";
+ if (false == dist.check_params(function, &result)) return result;
+ if(false == detail::check_probability(function, p, &result, Policy())) return result;
+
+ return static_cast<RealType>(detail::hypergeometric_quantile(p, 1 - p, dist.sample_count(), dist.defective(), dist.total(), Policy()));
+ } // quantile
+
+ template <class RealType, class Policy>
+ inline RealType quantile(const complemented2_type<hypergeometric_distribution<RealType, Policy>, RealType>& c)
+ {
+ BOOST_MATH_STD_USING // for ADL of std functions
+
+ // Checking function argument
+ RealType result;
+ const char* function = "quantile(const complemented2_type<hypergeometric_distribution<%1%>, %1%>&)";
+ if (false == c.dist.check_params(function, &result)) return result;
+ if(false == detail::check_probability(function, c.param, &result, Policy())) return result;
+
+ return static_cast<RealType>(detail::hypergeometric_quantile(1 - c.param, c.param, c.dist.sample_count(), c.dist.defective(), c.dist.total(), Policy()));
+ } // quantile
+
+ template <class RealType, class Policy>
+ inline RealType mean(const hypergeometric_distribution<RealType, Policy>& dist)
+ {
+ return static_cast<RealType>(dist.sample_count() * dist.defective()) / dist.total();
+ } // RealType mean(const hypergeometric_distribution<RealType, Policy>& dist)
+
+ template <class RealType, class Policy>
+ inline RealType variance(const hypergeometric_distribution<RealType, Policy>& dist)
+ {
+ RealType r = static_cast<RealType>(dist.sample_count());
+ RealType n = static_cast<RealType>(dist.defective());
+ RealType N = static_cast<RealType>(dist.total());
+ return r * (n / N) * (1 - n / N) * (N - r) / (N - 1);
+ } // RealType variance(const hypergeometric_distribution<RealType, Policy>& dist)
+
+ template <class RealType, class Policy>
+ inline RealType mode(const hypergeometric_distribution<RealType, Policy>& dist)
+ {
+ BOOST_MATH_STD_USING
+ RealType r = static_cast<RealType>(dist.sample_count());
+ RealType n = static_cast<RealType>(dist.defective());
+ RealType N = static_cast<RealType>(dist.total());
+ return floor((r + 1) * (n + 1) / (N + 2));
+ }
+
+ template <class RealType, class Policy>
+ inline RealType median(const hypergeometric_distribution<RealType, Policy>& dist)
+ {
+ // TODO:
+ return 0;
+ }
+ template <class RealType, class Policy>
+ inline RealType skewness(const hypergeometric_distribution<RealType, Policy>& dist)
+ {
+ RealType r = static_cast<RealType>(dist.sample_count());
+ RealType n = static_cast<RealType>(dist.defective());
+ RealType N = static_cast<RealType>(dist.total());
+ return (N - 2 * n) * sqrt(N - 1) * (N - 2 * r) / (sqrt(n * r * (N - n) * (N - r)) * (N - 2));
+ } // RealType skewness(const hypergeometric_distribution<RealType, Policy>& dist)
+
+ template <class RealType, class Policy>
+ inline RealType kurtosis_excess(const hypergeometric_distribution<RealType, Policy>& dist)
+ {
+ RealType r = static_cast<RealType>(dist.sample_count());
+ RealType n = static_cast<RealType>(dist.defective());
+ RealType N = static_cast<RealType>(dist.total());
+ RealType t1 = N * N * (N - 1) / (r * (N - 2) * (N - 3) * (N - r));
+ RealType t2 = (N * (N + 1) - 6 * N * (N - r)) / (n * (N - n))
+ + 3 * r * (N - r) * (N + 6) / (N * N) - 6;
+ return t1 * t2;
+ } // RealType kurtosis_excess(const hypergeometric_distribution<RealType, Policy>& dist)
+
+ template <class RealType, class Policy>
+ inline RealType kurtosis(const hypergeometric_distribution<RealType, Policy>& dist)
+ {
+ return kurtosis_excess(dist) + 3;
+ } // RealType kurtosis_excess(const hypergeometric_distribution<RealType, Policy>& dist)
+}} // namespaces
+

Modified: sandbox/math_toolkit/libs/math/doc/sf_and_dist/Jamfile.v2
==============================================================================
--- sandbox/math_toolkit/libs/math/doc/sf_and_dist/Jamfile.v2 (original)
+++ sandbox/math_toolkit/libs/math/doc/sf_and_dist/Jamfile.v2 2008-12-18 07:27:41 EST (Thu, 18 Dec 2008)
@@ -36,7 +36,12 @@
         <xsl:param>toc.max.depth=4
         # How far down we go with TOC's
         <xsl:param>generate.section.toc.level=10
+ # Index on type:
+ <xsl:param>index.on.type=1
+
         #<xsl:param>root.filename="sf_dist_and_tools"
+ #<xsl:param>graphicsize.extension=1
+ #<xsl:param>use.extensions=1
         
         # PDF Options:
         # TOC Generation: this is needed for FOP-0.9 and later:

Added: sandbox/math_toolkit/libs/math/test/hypergeometric_test_data.ipp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/test/hypergeometric_test_data.ipp 2008-12-18 07:27:41 EST (Thu, 18 Dec 2008)
@@ -0,0 +1,394 @@
+// Copyright John Maddock
+// Copyright Paul A. Bristow
+// Copyright Gautam Sewani
+
+// 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)
+#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+ static const boost::array<boost::array<T, 6>, 382> hypergeometric_test_data = {{
+ {SC_(1),SC_(1),SC_(3),SC_(0),SC_(0.6666666666666666666666666666666666666667),SC_(0.3333333333333333333333333333333333333333)},
+ {SC_(4),SC_(1),SC_(6),SC_(1),SC_(0.6666666666666666666666666666666666666667),SC_(0.3333333333333333333333333333333333333333)},
+ {SC_(1),SC_(1),SC_(9),SC_(1),SC_(0.1111111111111111111111111111111111111111),SC_(0.8888888888888888888888888888888888888889)},
+ {SC_(5),SC_(20),SC_(22),SC_(3),SC_(0.04329004329004329004329004329004329004329),SC_(0.9567099567099567099567099567099567099567)},
+ {SC_(5),SC_(20),SC_(22),SC_(5),SC_(0.5887445887445887445887445887445887445887),SC_(0.4112554112554112554112554112554112554113)},
+ {SC_(7),SC_(20),SC_(22),SC_(7),SC_(0.4545454545454545454545454545454545454545),SC_(0.5454545454545454545454545454545454545455)},
+ {SC_(7),SC_(20),SC_(22),SC_(5),SC_(0.09090909090909090909090909090909090909091),SC_(0.9090909090909090909090909090909090909091)},
+ {SC_(11),SC_(18),SC_(22),SC_(8),SC_(0.2481203007518796992481203007518796992481),SC_(0.7518796992481203007518796992481203007519)},
+ {SC_(11),SC_(18),SC_(22),SC_(10),SC_(0.2481203007518796992481203007518796992481),SC_(0.7518796992481203007518796992481203007519)},
+ {SC_(11),SC_(18),SC_(22),SC_(11),SC_(0.04511278195488721804511278195488721804511),SC_(0.9548872180451127819548872180451127819549)},
+ {SC_(11),SC_(18),SC_(22),SC_(11),SC_(0.04511278195488721804511278195488721804511),SC_(0.9548872180451127819548872180451127819549)},
+ {SC_(11),SC_(18),SC_(22),SC_(7),SC_(0.04511278195488721804511278195488721804511),SC_(0.9548872180451127819548872180451127819549)},
+ {SC_(11),SC_(18),SC_(22),SC_(10),SC_(0.2481203007518796992481203007518796992481),SC_(0.7518796992481203007518796992481203007519)},
+ {SC_(11),SC_(18),SC_(22),SC_(9),SC_(0.4135338345864661654135338345864661654135),SC_(0.5864661654135338345864661654135338345865)},
+ {SC_(11),SC_(18),SC_(22),SC_(7),SC_(0.04511278195488721804511278195488721804511),SC_(0.9548872180451127819548872180451127819549)},
+ {SC_(18),SC_(38),SC_(39),SC_(18),SC_(0.5384615384615384615384615384615384615385),SC_(0.4615384615384615384615384615384615384615)},
+ {SC_(27),SC_(38),SC_(39),SC_(26),SC_(0.6923076923076923076923076923076923076923),SC_(0.3076923076923076923076923076923076923077)},
+ {SC_(34),SC_(23),SC_(39),SC_(21),SC_(0.2460760355497197602460760355497197602461),SC_(0.7539239644502802397539239644502802397539)},
+ {SC_(34),SC_(23),SC_(39),SC_(18),SC_(0.05844305844305844305844305844305844305844),SC_(0.9415569415569415569415569415569415569416)},
+ {SC_(34),SC_(23),SC_(39),SC_(22),SC_(0.0727042832305990200727042832305990200727),SC_(0.9272957167694009799272957167694009799273)},
+ {SC_(34),SC_(23),SC_(39),SC_(19),SC_(0.2460760355497197602460760355497197602461),SC_(0.7539239644502802397539239644502802397539)},
+ {SC_(34),SC_(23),SC_(39),SC_(18),SC_(0.05844305844305844305844305844305844305844),SC_(0.9415569415569415569415569415569415569416)},
+ {SC_(3),SC_(23),SC_(39),SC_(1),SC_(0.302002407265565160302002407265565160302),SC_(0.697997592734434839697997592734434839698)},
+ {SC_(3),SC_(23),SC_(39),SC_(3),SC_(0.1937848779954043111937848779954043111938),SC_(0.8062151220045956888062151220045956888062)},
+ {SC_(3),SC_(23),SC_(39),SC_(2),SC_(0.4429368639894955684429368639894955684429),SC_(0.5570631360105044315570631360105044315571)},
+ {SC_(67),SC_(11),SC_(83),SC_(0),SC_(2.706010904925464182482716257932309854258e-10),SC_(0.999999999729398909507453581751728374207)},
+ {SC_(67),SC_(11),SC_(83),SC_(8),SC_(0.2262766859900854134484883831426249086592),SC_(0.7737233140099145865515116168573750913408)},
+ {SC_(67),SC_(11),SC_(83),SC_(4),SC_(0.0005432175148209516107734018078852267959049),SC_(0.9994567824851790483892265981921147732041)},
+ {SC_(67),SC_(11),SC_(83),SC_(2),SC_(1.566973600445052723384812907361231142033e-6),SC_(0.9999984330263995549472766151870926387689)},
+ {SC_(67),SC_(11),SC_(83),SC_(1),SC_(3.323883394883445170816269803493520604313e-8),SC_(0.9999999667611660511655482918373019650648)},
+ {SC_(67),SC_(11),SC_(83),SC_(2),SC_(1.566973600445052723384812907361231142033e-6),SC_(0.9999984330263995549472766151870926387689)},
+ {SC_(67),SC_(11),SC_(83),SC_(4),SC_(0.0005432175148209516107734018078852267959049),SC_(0.9994567824851790483892265981921147732041)},
+ {SC_(67),SC_(11),SC_(83),SC_(0),SC_(2.706010904925464182482716257932309854258e-10),SC_(0.999999999729398909507453581751728374207)},
+ {SC_(67),SC_(11),SC_(83),SC_(9),SC_(0.3178648684146437950824003477479730859737),SC_(0.6821351315853562049175996522520269140263)},
+ {SC_(67),SC_(11),SC_(83),SC_(0),SC_(2.706010904925464182482716257932309854258e-10),SC_(0.999999999729398909507453581751728374207)},
+ {SC_(9),SC_(11),SC_(83),SC_(3),SC_(0.07842995151148810292298334259976836196471),SC_(0.9215700484885118970770166574002316380353)},
+ {SC_(9),SC_(11),SC_(83),SC_(8),SC_(3.614308741089731253405074149125083530063e-8),SC_(0.9999999638569125891026874659492585087492)},
+ {SC_(9),SC_(11),SC_(83),SC_(9),SC_(1.673291083837838543243089883854205337992e-10),SC_(0.999999999832670891616216145675691011615)},
+ {SC_(9),SC_(11),SC_(83),SC_(9),SC_(1.673291083837838543243089883854205337992e-10),SC_(0.999999999832670891616216145675691011615)},
+ {SC_(9),SC_(11),SC_(83),SC_(0),SC_(0.2589433319744369112377862739801876077565),SC_(0.7410566680255630887622137260198123922435)},
+ {SC_(9),SC_(11),SC_(83),SC_(2),SC_(0.2464941333218197520436619338849862804605),SC_(0.7535058666781802479563380661150137195395)},
+ {SC_(9),SC_(11),SC_(83),SC_(8),SC_(3.614308741089731253405074149125083530063e-8),SC_(0.9999999638569125891026874659492585087492)},
+ {SC_(9),SC_(11),SC_(83),SC_(5),SC_(0.001446030712678885128518569090952709044125),SC_(0.9985539692873211148714814309090472909559)},
+ {SC_(9),SC_(11),SC_(83),SC_(0),SC_(0.2589433319744369112377862739801876077565),SC_(0.7410566680255630887622137260198123922435)},
+ {SC_(31),SC_(60),SC_(83),SC_(26),SC_(0.03953018579388072863610698273330011012019),SC_(0.9604698142061192713638930172666998898798)},
+ {SC_(31),SC_(60),SC_(83),SC_(18),SC_(0.01778984515171767731465571488588837342154),SC_(0.9822101548482823226853442851141116265785)},
+ {SC_(31),SC_(60),SC_(83),SC_(28),SC_(0.003087779759171134609420219620353851542388),SC_(0.9969122202408288653905797803796461484576)},
+ {SC_(31),SC_(60),SC_(83),SC_(23),SC_(0.1927450868273059245136159555225443869071),SC_(0.8072549131726940754863840444774556130929)},
+ {SC_(31),SC_(60),SC_(83),SC_(12),SC_(2.082970587495624828979599753112191426983e-7),SC_(0.9999997917029412504375171020400246887809)},
+ {SC_(31),SC_(60),SC_(83),SC_(27),SC_(0.01309967170557451046420699232877391563437),SC_(0.9869003282944254895357930076712260843656)},
+ {SC_(31),SC_(60),SC_(83),SC_(20),SC_(0.09527355826946218286265139555873137019485),SC_(0.9047264417305378171373486044412686298051)},
+ {SC_(31),SC_(60),SC_(83),SC_(9),SC_(5.715576985067740912994957305744308494552e-12),SC_(0.999999999994284423014932259087005042694)},
+ {SC_(31),SC_(60),SC_(83),SC_(26),SC_(0.03953018579388072863610698273330011012019),SC_(0.9604698142061192713638930172666998898798)},
+ {SC_(31),SC_(60),SC_(83),SC_(13),SC_(2.922567962763092067737530730520490125244e-6),SC_(0.9999970774320372369079322624692694795099)},
+ {SC_(8),SC_(60),SC_(83),SC_(0),SC_(0.00001243087946183130253775291474715289145594),SC_(0.9999875691205381686974622470852528471085)},
+ {SC_(8),SC_(60),SC_(83),SC_(6),SC_(0.3211237404819389442041829919986572530679),SC_(0.6788762595180610557958170080013427469321)},
+ {SC_(8),SC_(60),SC_(83),SC_(1),SC_(0.0003729263838549390761325874424145867436783),SC_(0.9996270736161450609238674125575854132563)},
+ {SC_(8),SC_(60),SC_(83),SC_(5),SC_(0.2452217654589351937559215575262473568882),SC_(0.7547782345410648062440784424737526431118)},
+ {SC_(8),SC_(60),SC_(83),SC_(8),SC_(0.06486844616454751964373035877330301088936),SC_(0.9351315538354524803562696412266969891106)},
+ {SC_(8),SC_(60),SC_(83),SC_(5),SC_(0.2452217654589351937559215575262473568882),SC_(0.7547782345410648062440784424737526431118)},
+ {SC_(8),SC_(60),SC_(83),SC_(4),SC_(0.1094740024370246400696078381813604271822),SC_(0.8905259975629753599303921618186395728178)},
+ {SC_(8),SC_(60),SC_(83),SC_(7),SC_(0.2252036621561649738574789814016557359178),SC_(0.7747963378438350261425210185983442640822)},
+ {SC_(137),SC_(126),SC_(212),SC_(63),SC_(2.424294297356805085521595588269108472974e-8),SC_(0.9999999757570570264319491447840441173089)},
+ {SC_(137),SC_(126),SC_(212),SC_(118),SC_(1.801842534535389221328461479099768861683e-28),SC_(0.999999999999999999999999999819815746546)},
+ {SC_(137),SC_(126),SC_(212),SC_(68),SC_(0.00004255411944378917126433137200427618533005),SC_(0.9999574458805562108287356686279957238147)},
+ {SC_(137),SC_(126),SC_(212),SC_(97),SC_(3.954127289222816770097663921505424620179e-6),SC_(0.9999960458727107771832299023360784945754)},
+ {SC_(137),SC_(126),SC_(212),SC_(106),SC_(5.185953113988735166746655512911326221269e-13),SC_(0.999999999999481404688601126483325334449)},
+ {SC_(137),SC_(126),SC_(212),SC_(100),SC_(4.791618009152889769562496123589788004525e-8),SC_(0.9999999520838199084711023043750387641021)},
+ {SC_(137),SC_(126),SC_(212),SC_(88),SC_(0.01859007433325541916666781654513243696436),SC_(0.9814099256667445808333321834548675630356)},
+ {SC_(137),SC_(126),SC_(212),SC_(55),SC_(1.225644950652779701238694195311577771074e-16),SC_(0.999999999999999877435504934722029876131)},
+ {SC_(137),SC_(126),SC_(212),SC_(108),SC_(4.968493378011756112135511574081834818627e-15),SC_(0.999999999999995031506621988243887864488)},
+ {SC_(137),SC_(126),SC_(212),SC_(68),SC_(0.00004255411944378917126433137200427618533005),SC_(0.9999574458805562108287356686279957238147)},
+ {SC_(89),SC_(126),SC_(212),SC_(48),SC_(0.04327370128395538466155833807089474131239),SC_(0.9567262987160446153384416619291052586876)},
+ {SC_(89),SC_(126),SC_(212),SC_(5),SC_(3.781027444649464467087206575627517990033e-50),SC_(1)},
+ {SC_(89),SC_(126),SC_(212),SC_(49),SC_(0.0613972035075817746884044210961496817733),SC_(0.9386027964924182253115955789038503182267)},
+ {SC_(89),SC_(126),SC_(212),SC_(87),SC_(8.542099280141883745074697606653112541157e-26),SC_(0.999999999999999999999999914579007198581)},
+ {SC_(89),SC_(126),SC_(212),SC_(15),SC_(6.664331650608352991851864382191546742859e-29),SC_(0.999999999999999999999999999933356683494)},
+ {SC_(89),SC_(126),SC_(212),SC_(32),SC_(2.374402212260428351752647795477113904945e-9),SC_(0.9999999976255977877395716482473522045229)},
+ {SC_(89),SC_(126),SC_(212),SC_(11),SC_(4.566228012225576465718282521048468817322e-36),SC_(0.999999999999999999999999999999999995434)},
+ {SC_(89),SC_(126),SC_(212),SC_(86),SC_(5.202138461606407200750490842451745537565e-24),SC_(0.999999999999999999999994797861538393593)},
+ {SC_(89),SC_(126),SC_(212),SC_(21),SC_(2.774957659542503960479793529881961134195e-20),SC_(0.999999999999999999972250423404574960395)},
+ {SC_(89),SC_(126),SC_(212),SC_(89),SC_(4.422346406258609915685168935141358677926e-30),SC_(0.999999999999999999999999999995577653594)},
+ {SC_(162),SC_(202),SC_(212),SC_(153),SC_(0.2072988507278707741958545748099934620077),SC_(0.7927011492721292258041454251900065379923)},
+ {SC_(162),SC_(202),SC_(212),SC_(153),SC_(0.2072988507278707741958545748099934620077),SC_(0.7927011492721292258041454251900065379923)},
+ {SC_(162),SC_(202),SC_(212),SC_(160),SC_(0.0001718641115390184751337664937406444081319),SC_(0.9998281358884609815248662335062593555919)},
+ {SC_(162),SC_(202),SC_(212),SC_(162),SC_(2.521534647736538729820871799379645995136e-7),SC_(0.9999997478465352263461270179128200620354)},
+ {SC_(162),SC_(202),SC_(212),SC_(161),SC_(9.96313690081266522514588369510982076127e-6),SC_(0.9999900368630991873347748541163048901792)},
+ {SC_(162),SC_(202),SC_(212),SC_(159),SC_(0.001705318316046074792024969860372285600069),SC_(0.9982946816839539252079750301396277143999)},
+ {SC_(162),SC_(202),SC_(212),SC_(154),SC_(0.2968142635421786085077008684779451842383),SC_(0.7031857364578213914922991315220548157617)},
+ {SC_(162),SC_(202),SC_(212),SC_(152),SC_(0.06343344832272845690393149989185799937435),SC_(0.9365665516772715430960685001081420006256)},
+ {SC_(162),SC_(202),SC_(212),SC_(152),SC_(0.06343344832272845690393149989185799937435),SC_(0.9365665516772715430960685001081420006256)},
+ {SC_(162),SC_(202),SC_(212),SC_(155),SC_(0.245111133763863625090230394614045055371),SC_(0.754888866236136374909769605385954944629)},
+ {SC_(73),SC_(202),SC_(212),SC_(66),SC_(0.01751763152934741438011602592088402755587),SC_(0.9824823684706525856198839740791159724441)},
+ {SC_(73),SC_(202),SC_(212),SC_(69),SC_(0.2399153883367145882494151376121073339173),SC_(0.7600846116632854117505848623878926660827)},
+ {SC_(73),SC_(202),SC_(212),SC_(70),SC_(0.2604795644798615529565078636931451053959),SC_(0.7395204355201384470434921363068548946041)},
+ {SC_(73),SC_(202),SC_(212),SC_(63),SC_(0.00001525165431823892232518224099501077844718),SC_(0.9999847483456817610776748177590049892216)},
+ {SC_(73),SC_(202),SC_(212),SC_(66),SC_(0.01751763152934741438011602592088402755587),SC_(0.9824823684706525856198839740791159724441)},
+ {SC_(73),SC_(202),SC_(212),SC_(67),SC_(0.06222681050723409884280021148015520236263),SC_(0.9377731894927659011571997885198447976374)},
+ {SC_(73),SC_(202),SC_(212),SC_(64),SC_(0.0003312468672242515942500517966103903443998),SC_(0.9996687531327757484057499482033896096556)},
+ {SC_(73),SC_(202),SC_(212),SC_(73),SC_(0.01307577036412107550199975831930158225444),SC_(0.9869242296358789244980002416806984177456)},
+ {SC_(73),SC_(202),SC_(212),SC_(70),SC_(0.2604795644798615529565078636931451053959),SC_(0.7395204355201384470434921363068548946041)},
+ {SC_(73),SC_(202),SC_(212),SC_(68),SC_(0.1482462250319400590078475626438991585698),SC_(0.8517537749680599409921524373561008414302)},
+ {SC_(257),SC_(319),SC_(363),SC_(218),SC_(0.002149613269544955332459509740535149716926),SC_(0.9978503867304550446675404902594648502831)},
+ {SC_(257),SC_(319),SC_(363),SC_(231),SC_(0.02739028050016375688026158493444202916779),SC_(0.9726097194998362431197384150655579708322)},
+ {SC_(257),SC_(319),SC_(363),SC_(227),SC_(0.1265133947588916960475347186685718786681),SC_(0.8734866052411083039524652813314281213319)},
+ {SC_(257),SC_(319),SC_(363),SC_(249),SC_(1.011922697206401503583711731068038681514e-14),SC_(0.999999999999989880773027935984964162883)},
+ {SC_(257),SC_(319),SC_(363),SC_(244),SC_(1.315659205599288997195837925949597670971e-9),SC_(0.9999999986843407944007110028041620740504)},
+ {SC_(257),SC_(319),SC_(363),SC_(251),SC_(3.102297508576079507736591035791775742843e-17),SC_(0.999999999999999968977024914239204922634)},
+ {SC_(257),SC_(319),SC_(363),SC_(243),SC_(9.353050969128780051493719992371012014308e-9),SC_(0.999999990646949030871219948506280007629)},
+ {SC_(257),SC_(319),SC_(363),SC_(226),SC_(0.1394587473270058307454267554383355637902),SC_(0.8605412526729941692545732445616644362098)},
+ {SC_(257),SC_(319),SC_(363),SC_(215),SC_(0.00001751127180612194709842195526957376220328),SC_(0.9999824887281938780529015780447304262378)},
+ {SC_(257),SC_(319),SC_(363),SC_(237),SC_(0.0001099549905199962662912913370178224118736),SC_(0.9998900450094800037337087086629821775881)},
+ {SC_(145),SC_(319),SC_(363),SC_(122),SC_(0.02718969256311827009876592968650589165689),SC_(0.9728103074368817299012340703134941083431)},
+ {SC_(145),SC_(319),SC_(363),SC_(109),SC_(1.548669751314724909432538791752671865836e-9),SC_(0.9999999984513302486852750905674612082473)},
+ {SC_(145),SC_(319),SC_(363),SC_(122),SC_(0.02718969256311827009876592968650589165689),SC_(0.9728103074368817299012340703134941083431)},
+ {SC_(145),SC_(319),SC_(363),SC_(130),SC_(0.09316531195966905236683289248687813054119),SC_(0.9068346880403309476331671075131218694588)},
+ {SC_(145),SC_(319),SC_(363),SC_(143),SC_(1.655799506432278734624685279268236659311e-8),SC_(0.9999999834420049356772126537531472073176)},
+ {SC_(145),SC_(319),SC_(363),SC_(124),SC_(0.06883349129603479183409061611954927148282),SC_(0.9311665087039652081659093838804507285172)},
+ {SC_(145),SC_(319),SC_(363),SC_(104),SC_(3.700951174227533198811534815250158364518e-15),SC_(0.999999999999996299048825772466801188465)},
+ {SC_(145),SC_(319),SC_(363),SC_(119),SC_(0.003126516857892492949908733234135865596104),SC_(0.9968734831421075070500912667658641344039)},
+ {SC_(145),SC_(319),SC_(363),SC_(108),SC_(1.729780995448238915108458852835058110681e-10),SC_(0.999999999827021900455176108489154114716)},
+ {SC_(145),SC_(319),SC_(363),SC_(124),SC_(0.06883349129603479183409061611954927148282),SC_(0.9311665087039652081659093838804507285172)},
+ {SC_(226),SC_(175),SC_(363),SC_(105),SC_(0.05985381863583421424161427742932144625563),SC_(0.9401461813641657857583857225706785537444)},
+ {SC_(226),SC_(175),SC_(363),SC_(121),SC_(0.002870933833910333825225982197976751809577),SC_(0.9971290661660896661747740178020232481904)},
+ {SC_(226),SC_(175),SC_(363),SC_(122),SC_(0.001588426506466783059038965560355989730709),SC_(0.9984115734935332169409610344396440102693)},
+ {SC_(226),SC_(175),SC_(363),SC_(148),SC_(4.571757737652849565250329994360639522214e-18),SC_(0.99999999999999999542824226234715043475)},
+ {SC_(226),SC_(175),SC_(363),SC_(73),SC_(2.568787655740084677494210481416671292259e-15),SC_(0.99999999999999743121234425991532250579)},
+ {SC_(226),SC_(175),SC_(363),SC_(141),SC_(1.464033936628855920137647695057475890643e-12),SC_(0.999999999998535966063371144079862352305)},
+ {SC_(226),SC_(175),SC_(363),SC_(129),SC_(6.429409812706519581048301968873646019407e-6),SC_(0.999993570590187293480418951698031126354)},
+ {SC_(226),SC_(175),SC_(363),SC_(61),SC_(1.264318783668246201640629988848834379761e-26),SC_(0.999999999999999999999999987356812163318)},
+ {SC_(226),SC_(175),SC_(363),SC_(122),SC_(0.001588426506466783059038965560355989730709),SC_(0.9984115734935332169409610344396440102693)},
+ {SC_(226),SC_(175),SC_(363),SC_(151),SC_(7.724765951567215182445548705815128561387e-21),SC_(0.999999999999999999992275234048432784818)},
+ {SC_(100),SC_(175),SC_(363),SC_(54),SC_(0.03721356559028679082513176429882105033744),SC_(0.9627864344097132091748682357011789496626)},
+ {SC_(100),SC_(175),SC_(363),SC_(59),SC_(0.003792985641298510165442871200106925663625),SC_(0.9962070143587014898345571287998930743364)},
+ {SC_(100),SC_(175),SC_(363),SC_(23),SC_(1.188558662188454478355157536623800489965e-9),SC_(0.9999999988114413378115455216448424633762)},
+ {SC_(100),SC_(175),SC_(363),SC_(22),SC_(2.542643090805366417999595434054434934541e-10),SC_(0.999999999745735690919463358200040456595)},
+ {SC_(100),SC_(175),SC_(363),SC_(32),SC_(0.00006129268956212007234640859170650023547855),SC_(0.9999387073104378799276535914082934997645)},
+ {SC_(100),SC_(175),SC_(363),SC_(69),SC_(5.45109714250542547314639993224957306881e-7),SC_(0.9999994548902857494574526853600067750427)},
+ {SC_(100),SC_(175),SC_(363),SC_(1),SC_(1.041805923678068617855063729129991426763e-34),SC_(0.999999999999999999999999999999999895819)},
+ {SC_(100),SC_(175),SC_(363),SC_(4),SC_(2.807117906458360972303892034721152418155e-29),SC_(0.999999999999999999999999999971928820935)},
+ {SC_(100),SC_(175),SC_(363),SC_(35),SC_(0.0007400628615667298483901605065066711390239),SC_(0.999259937138433270151609839493493328861)},
+ {SC_(100),SC_(175),SC_(363),SC_(26),SC_(7.979433887850032948096157398381237164486e-8),SC_(0.9999999202056611214996705190384260161876)},
+ {SC_(746),SC_(834),SC_(1000),SC_(685),SC_(1.58629626814482087108543876900595357715e-30),SC_(0.999999999999999999999999999998413703732)},
+ {SC_(746),SC_(834),SC_(1000),SC_(716),SC_(4.434253211195765511747370061926336279224e-66),SC_(1)},
+ {SC_(746),SC_(834),SC_(1000),SC_(646),SC_(3.141953978343536685727311235373339235477e-6),SC_(0.9999968580460216564633142726887646266608)},
+ {SC_(746),SC_(834),SC_(1000),SC_(718),SC_(5.472230185748172932387769489131552621987e-69),SC_(1)},
+ {SC_(746),SC_(834),SC_(1000),SC_(595),SC_(6.218291437391988031396494611179252072276e-9),SC_(0.9999999937817085626080119686035053888207)},
+ {SC_(746),SC_(834),SC_(1000),SC_(591),SC_(1.338620324993985190328849190725615506527e-11),SC_(0.999999999986613796750060148096711508093)},
+ {SC_(746),SC_(834),SC_(1000),SC_(592),SC_(7.097288082896741581325465198293962282282e-11),SC_(0.999999999929027119171032584186745348017)},
+ {SC_(746),SC_(834),SC_(1000),SC_(714),SC_(2.942201080134798641237836645380633259371e-63),SC_(1)},
+ {SC_(746),SC_(834),SC_(1000),SC_(667),SC_(1.029606549304123010429029876474638287542e-16),SC_(0.999999999999999897039345069587698957097)},
+ {SC_(746),SC_(834),SC_(1000),SC_(585),SC_(5.202791209134339332942459897579831542038e-17),SC_(0.999999999999999947972087908656606670575)},
+ {SC_(388),SC_(834),SC_(1000),SC_(295),SC_(3.764609036298121167629213237644608301677e-7),SC_(0.9999996235390963701878832370786762355392)},
+ {SC_(388),SC_(834),SC_(1000),SC_(222),SC_(8.139454349325018266959212579357665593482e-81),SC_(1)},
+ {SC_(388),SC_(834),SC_(1000),SC_(376),SC_(1.198222115884208653171140443316188075439e-23),SC_(0.999999999999999999999988017778841157913)},
+ {SC_(388),SC_(834),SC_(1000),SC_(360),SC_(1.931352012832037796938005132937838815037e-11),SC_(0.999999999980686479871679622030619948671)},
+ {SC_(388),SC_(834),SC_(1000),SC_(301),SC_(0.00003480246732972522728657459013079949827995),SC_(0.9999651975326702747727134254098692005017)},
+ {SC_(388),SC_(834),SC_(1000),SC_(224),SC_(8.34443775367972021051711868399318455989e-76),SC_(1)},
+ {SC_(388),SC_(834),SC_(1000),SC_(249),SC_(5.920417034131146273100118069104571942819e-39),SC_(0.999999999999999999999999999999999999994)},
+ {SC_(388),SC_(834),SC_(1000),SC_(268),SC_(6.655151674287241197173321718423589946865e-22),SC_(0.99999999999999999999933448483257127588)},
+ {SC_(388),SC_(834),SC_(1000),SC_(288),SC_(4.982406958096400179738620357484003747873e-10),SC_(0.999999999501759304190359982026137964252)},
+ {SC_(388),SC_(834),SC_(1000),SC_(368),SC_(1.098328289944609280499497025236334211753e-16),SC_(0.99999999999999989016717100553907195005)},
+ {SC_(833),SC_(558),SC_(1000),SC_(466),SC_(0.06654145436579167473587049863909558777697),SC_(0.933458545634208325264129501360904412223)},
+ {SC_(833),SC_(558),SC_(1000),SC_(424),SC_(3.746268862737593653494633652300276452032e-13),SC_(0.999999999999625373113726240634650536635)},
+ {SC_(833),SC_(558),SC_(1000),SC_(492),SC_(1.551106434526078397071734248855199873773e-6),SC_(0.9999984488935654739216029282657511448001)},
+ {SC_(833),SC_(558),SC_(1000),SC_(557),SC_(8.896205965087588602138039956182514677049e-67),SC_(1)},
+ {SC_(833),SC_(558),SC_(1000),SC_(550),SC_(8.003658369198901305295818263517763561765e-54),SC_(1)},
+ {SC_(833),SC_(558),SC_(1000),SC_(436),SC_(2.522609144809131184908006827323334668856e-7),SC_(0.9999997477390855190868815091993172676665)},
+ {SC_(833),SC_(558),SC_(1000),SC_(503),SC_(4.185963763621378568736749629769170416193e-11),SC_(0.999999999958140362363786214312632503702)},
+ {SC_(833),SC_(558),SC_(1000),SC_(479),SC_(0.003688078680506630013071396739116141131943),SC_(0.9963119213194933699869286032608838588681)},
+ {SC_(833),SC_(558),SC_(1000),SC_(444),SC_(0.0001111254070393469624783207823669071882085),SC_(0.9998888745929606530375216792176330928118)},
+ {SC_(833),SC_(558),SC_(1000),SC_(544),SC_(2.64802571676335485606583077288457426977e-45),SC_(1)},
+ {SC_(387),SC_(558),SC_(1000),SC_(54),SC_(2.597322404008421232121925140794726946468e-107),SC_(1)},
+ {SC_(387),SC_(558),SC_(1000),SC_(73),SC_(3.954207062904287680991838188528794501692e-82),SC_(1)},
+ {SC_(387),SC_(558),SC_(1000),SC_(96),SC_(3.265928463039088440281270142986803791633e-57),SC_(1)},
+ {SC_(387),SC_(558),SC_(1000),SC_(308),SC_(5.631541284980357224580014632275104096827e-35),SC_(0.999999999999999999999999999999999943685)},
+ {SC_(387),SC_(558),SC_(1000),SC_(303),SC_(2.412212942709969622633889412929160264777e-31),SC_(0.999999999999999999999999999999758778706)},
+ {SC_(387),SC_(558),SC_(1000),SC_(223),SC_(0.0341309219282129899782185382368588132769),SC_(0.9658690780717870100217814617631411867231)},
+ {SC_(387),SC_(558),SC_(1000),SC_(225),SC_(0.02592853472775158987334704362247113951989),SC_(0.9740714652722484101266529563775288604801)},
+ {SC_(387),SC_(558),SC_(1000),SC_(8),SC_(2.740562366743403582185089343380733559432e-194),SC_(1)},
+ {SC_(387),SC_(558),SC_(1000),SC_(347),SC_(1.272943468084488365989051722801638425556e-72),SC_(1)},
+ {SC_(387),SC_(558),SC_(1000),SC_(152),SC_(3.110021461328964483795429371767681680058e-17),SC_(0.999999999999999968899785386710355162046)},
+ {SC_(1099),SC_(99),SC_(1852),SC_(31),SC_(4.73038576484168937301451323313138564508e-9),SC_(0.9999999952696142351583106269854867668686)},
+ {SC_(1099),SC_(99),SC_(1852),SC_(55),SC_(0.06084049299241462262328126200195623310146),SC_(0.9391595070075853773767187379980437668985)},
+ {SC_(1099),SC_(99),SC_(1852),SC_(4),SC_(1.010220086173187986205158215222561935959e-33),SC_(0.99999999999999999999999999999999898978)},
+ {SC_(1099),SC_(99),SC_(1852),SC_(58),SC_(0.08243598920344447449598544422514540260991),SC_(0.9175640107965555255040145557748545973901)},
+ {SC_(1099),SC_(99),SC_(1852),SC_(15),SC_(1.348092684653992627348728764668289037106e-20),SC_(0.999999999999999999986519073153460073727)},
+ {SC_(1099),SC_(99),SC_(1852),SC_(17),SC_(9.023367435496400769952157769922386477305e-19),SC_(0.999999999999999999097663256450359923005)},
+ {SC_(1099),SC_(99),SC_(1852),SC_(32),SC_(1.564957797858340237909101717578962058529e-8),SC_(0.9999999843504220214165976209089828242104)},
+ {SC_(1099),SC_(99),SC_(1852),SC_(55),SC_(0.06084049299241462262328126200195623310146),SC_(0.9391595070075853773767187379980437668985)},
+ {SC_(1099),SC_(99),SC_(1852),SC_(24),SC_(2.643493107021405355071061369570194009925e-13),SC_(0.999999999999735650689297859464492893863)},
+ {SC_(1099),SC_(99),SC_(1852),SC_(28),SC_(9.718258552814517382713475047447433382145e-11),SC_(0.999999999902817414471854826172865249526)},
+ {SC_(973),SC_(99),SC_(1852),SC_(37),SC_(0.0006679424745442891301233530448121946619002),SC_(0.9993320575254557108698766469551878053381)},
+ {SC_(973),SC_(99),SC_(1852),SC_(99),SC_(1.748916711106892156289600239948612159678e-29),SC_(0.999999999999999999999999999982510832889)},
+ {SC_(973),SC_(99),SC_(1852),SC_(16),SC_(1.217789968537791597990410696247438852647e-14),SC_(0.999999999999987822100314622084020095893)},
+ {SC_(973),SC_(99),SC_(1852),SC_(95),SC_(6.613676459430471265520133656595570775643e-23),SC_(0.999999999999999999999933863235405695287)},
+ {SC_(973),SC_(99),SC_(1852),SC_(92),SC_(2.562384696382374454631723828215445465652e-19),SC_(0.999999999999999999743761530361762554537)},
+ {SC_(973),SC_(99),SC_(1852),SC_(37),SC_(0.0006679424745442891301233530448121946619002),SC_(0.9993320575254557108698766469551878053381)},
+ {SC_(973),SC_(99),SC_(1852),SC_(17),SC_(7.139292567047407514944004134152359251945e-14),SC_(0.999999999999928607074329525924850559959)},
+ {SC_(973),SC_(99),SC_(1852),SC_(36),SC_(0.0003420445708695315362182385389308639940808),SC_(0.9996579554291304684637817614610691360059)},
+ {SC_(973),SC_(99),SC_(1852),SC_(83),SC_(1.61766627770781522967083899269317523996e-11),SC_(0.999999999983823337222921847703291610073)},
+ {SC_(973),SC_(99),SC_(1852),SC_(25),SC_(9.359441946761710395162499183458127666904e-9),SC_(0.9999999906405580532382896048375008165419)},
+ {SC_(190),SC_(829),SC_(1852),SC_(36),SC_(2.613948600446189698133893634586672170875e-15),SC_(0.999999999999997386051399553810301866106)},
+ {SC_(190),SC_(829),SC_(1852),SC_(162),SC_(3.295457585925711660280133742449030607389e-34),SC_(0.999999999999999999999999999999999670454)},
+ {SC_(190),SC_(829),SC_(1852),SC_(38),SC_(3.63065377446220159075730009568280765944e-14),SC_(0.999999999999963693462255377984092426999)},
+ {SC_(190),SC_(829),SC_(1852),SC_(115),SC_(1.577228751468016380050471487006717739783e-6),SC_(0.9999984227712485319836199495285129932823)},
+ {SC_(190),SC_(829),SC_(1852),SC_(159),SC_(1.672541813445126471230314841358083918836e-31),SC_(0.999999999999999999999999999999832745819)},
+ {SC_(190),SC_(829),SC_(1852),SC_(113),SC_(6.196298221534782854075380215261820422628e-6),SC_(0.9999938037017784652171459246197847381796)},
+ {SC_(190),SC_(829),SC_(1852),SC_(167),SC_(4.175177604908017223377071749882081106498e-39),SC_(0.999999999999999999999999999999999999996)},
+ {SC_(190),SC_(829),SC_(1852),SC_(34),SC_(1.627658020869133940493312687746415791996e-16),SC_(0.999999999999999837234197913086605950669)},
+ {SC_(190),SC_(829),SC_(1852),SC_(124),SC_(9.871512253170851411310560017104699652067e-10),SC_(0.99999999901284877468291485886894399829)},
+ {SC_(190),SC_(829),SC_(1852),SC_(168),SC_(3.780223003920452775982309028097174666258e-40),SC_(1)},
+ {SC_(214),SC_(829),SC_(1852),SC_(53),SC_(7.366019976026750133862989234688694381426e-11),SC_(0.999999999926339800239732498661370107653)},
+ {SC_(214),SC_(829),SC_(1852),SC_(65),SC_(1.808546043090494254850058486571402508429e-6),SC_(0.9999981914539569095057451499415134285975)},
+ {SC_(214),SC_(829),SC_(1852),SC_(210),SC_(3.470129818333693878181621598737803869545e-74),SC_(1)},
+ {SC_(214),SC_(829),SC_(1852),SC_(23),SC_(3.888524513908169005149569274766476469429e-30),SC_(0.999999999999999999999999999996111475486)},
+ {SC_(214),SC_(829),SC_(1852),SC_(20),SC_(6.2526397961142147985779994331452663868e-33),SC_(0.99999999999999999999999999999999374736)},
+ {SC_(214),SC_(829),SC_(1852),SC_(108),SC_(0.01189962291757073065202434260907588397989),SC_(0.9881003770824292693479756573909241160201)},
+ {SC_(214),SC_(829),SC_(1852),SC_(48),SC_(3.506836167026569806112076823243361541731e-13),SC_(0.999999999999649316383297343019388792318)},
+ {SC_(214),SC_(829),SC_(1852),SC_(70),SC_(0.00004231720136415052453174355786461722075198),SC_(0.9999576827986358494754682564421353827792)},
+ {SC_(214),SC_(829),SC_(1852),SC_(61),SC_(9.366243447042548643186337988777644204228e-8),SC_(0.9999999063375655295745135681366201122236)},
+ {SC_(214),SC_(829),SC_(1852),SC_(143),SC_(2.674636799226462079348238462385399088928e-12),SC_(0.999999999997325363200773537920651761538)},
+ {SC_(3938),SC_(3526),SC_(3984),SC_(3515),SC_(1.543249563286691423243446422384758755393e-24),SC_(0.999999999999999999999998456750436713309)},
+ {SC_(3938),SC_(3526),SC_(3984),SC_(3523),SC_(7.152921893242692495337599307493964596169e-38),SC_(0.999999999999999999999999999999999999928)},
+ {SC_(3938),SC_(3526),SC_(3984),SC_(3480),SC_(0.003511737005110308905262411501491048407082),SC_(0.9964882629948896910947375884985089515929)},
+ {SC_(3938),SC_(3526),SC_(3984),SC_(3510),SC_(4.374207729189454539996599763344530490097e-18),SC_(0.999999999999999995625792270810545460003)},
+ {SC_(3938),SC_(3526),SC_(3984),SC_(3505),SC_(1.094239953223219592370835963655605425346e-12),SC_(0.999999999998905760046776780407629164036)},
+ {SC_(3938),SC_(3526),SC_(3984),SC_(3492),SC_(0.003120239781893314215054654618245814479477),SC_(0.9968797602181066857849453453817541855205)},
+ {SC_(3938),SC_(3526),SC_(3984),SC_(3521),SC_(4.620019858265580566793973985564344953581e-34),SC_(0.999999999999999999999999999999999537998)},
+ {SC_(3938),SC_(3526),SC_(3984),SC_(3498),SC_(9.429628697450139824050594535005307236998e-7),SC_(0.9999990570371302549860175949405464994693)},
+ {SC_(3938),SC_(3526),SC_(3984),SC_(3482),SC_(0.06276408788162777443804846249886545556149),SC_(0.9372359121183722255619515375011345444385)},
+ {SC_(3938),SC_(3526),SC_(3984),SC_(3494),SC_(0.0003128115800833490871262251853923839882187),SC_(0.9996871884199166509128737748146076160118)},
+ {SC_(984),SC_(3526),SC_(3984),SC_(893),SC_(0.001666544942199771253815925119779657614063),SC_(0.9983334550578002287461840748802203423859)},
+ {SC_(984),SC_(3526),SC_(3984),SC_(928),SC_(1.122100545200857350043660617916150176781e-12),SC_(0.999999999998877899454799142649956339382)},
+ {SC_(984),SC_(3526),SC_(3984),SC_(923),SC_(9.205198815385235644923653223393736165669e-11),SC_(0.999999999907948011846147643550763467766)},
+ {SC_(984),SC_(3526),SC_(3984),SC_(687),SC_(4.109850960400433756115153028922372429384e-85),SC_(1)},
+ {SC_(984),SC_(3526),SC_(3984),SC_(787),SC_(2.291509173121597918954753549499770314967e-20),SC_(0.99999999999999999997708490826878402081)},
+ {SC_(984),SC_(3526),SC_(3984),SC_(834),SC_(8.362711741994954667483605120712118282788e-6),SC_(0.9999916372882580050453325163948792878817)},
+ {SC_(984),SC_(3526),SC_(3984),SC_(914),SC_(7.305319632175461881943921557082908281649e-8),SC_(0.9999999269468036782453811805607844291709)},
+ {SC_(984),SC_(3526),SC_(3984),SC_(807),SC_(6.758573282151572433616536773172059582909e-13),SC_(0.999999999999324142671784842756638346323)},
+ {SC_(984),SC_(3526),SC_(3984),SC_(929),SC_(4.360519038326179438472812784081307762276e-13),SC_(0.999999999999563948096167382056152718722)},
+ {SC_(984),SC_(3526),SC_(3984),SC_(883),SC_(0.01755481153260895265134848971368509191166),SC_(0.9824451884673910473486515102863149080883)},
+ {SC_(1333),SC_(714),SC_(3984),SC_(121),SC_(1.641786619106680364108725997417443125596e-27),SC_(0.999999999999999999999999998358213380893)},
+ {SC_(1333),SC_(714),SC_(3984),SC_(83),SC_(8.827023652836775707426140473775948127267e-49),SC_(1)},
+ {SC_(1333),SC_(714),SC_(3984),SC_(650),SC_(2.087294037822302477446708322280231407732e-283),SC_(1)},
+ {SC_(1333),SC_(714),SC_(3984),SC_(460),SC_(3.943077411029385711342291910302810650126e-79),SC_(1)},
+ {SC_(1333),SC_(714),SC_(3984),SC_(156),SC_(2.931701121847710717934259468113507061405e-14),SC_(0.999999999999970682988781522892820657405)},
+ {SC_(1333),SC_(714),SC_(3984),SC_(665),SC_(4.005563974621053830934399395776628807844e-308),SC_(1)},
+ {SC_(1333),SC_(714),SC_(3984),SC_(279),SC_(0.00008069202039846403568334943175971999940851),SC_(0.9999193079796015359643166505682402800006)},
+ {SC_(1333),SC_(714),SC_(3984),SC_(235),SC_(0.03304135676842962390038252376021632016397),SC_(0.966958643231570376099617476239783679836)},
+ {SC_(1333),SC_(714),SC_(3984),SC_(284),SC_(0.00001649418727048217369609752564432954289953),SC_(0.9999835058127295178263039024743556704571)},
+ {SC_(1333),SC_(714),SC_(3984),SC_(515),SC_(1.290270775449338378402113166061089382704e-122),SC_(1)},
+ {SC_(2929),SC_(714),SC_(3984),SC_(505),SC_(0.006587614550784045063212392583386104914138),SC_(0.9934123854492159549367876074166138950859)},
+ {SC_(2929),SC_(714),SC_(3984),SC_(183),SC_(9.855374954903989343412849734469393134053e-201),SC_(1)},
+ {SC_(2929),SC_(714),SC_(3984),SC_(553),SC_(0.001122680861653780267462660250309885379657),SC_(0.9988773191383462197325373397496901146203)},
+ {SC_(2929),SC_(714),SC_(3984),SC_(265),SC_(5.746858574276651337145185520820304145008e-117),SC_(1)},
+ {SC_(2929),SC_(714),SC_(3984),SC_(252),SC_(1.362971479046432897118100482365919936391e-128),SC_(1)},
+ {SC_(2929),SC_(714),SC_(3984),SC_(700),SC_(2.102589620170802224717588552022527663409e-83),SC_(1)},
+ {SC_(2929),SC_(714),SC_(3984),SC_(219),SC_(7.842963495737140544471008259092166872503e-161),SC_(1)},
+ {SC_(2929),SC_(714),SC_(3984),SC_(258),SC_(3.747121071782069468296555492909892501819e-123),SC_(1)},
+ {SC_(2929),SC_(714),SC_(3984),SC_(651),SC_(4.909095311245166118770353235178412388995e-38),SC_(0.999999999999999999999999999999999999951)},
+ {SC_(2929),SC_(714),SC_(3984),SC_(10),SC_(1.502079512797878890634568264881544748463e-494),SC_(1)},
+ {SC_(6502),SC_(7057),SC_(7776),SC_(5865),SC_(0.0000199385450881842814616766544039123517368),SC_(0.9999800614549118157185383233455960876483)},
+ {SC_(6502),SC_(7057),SC_(7776),SC_(6048),SC_(3.575383641927364616441280187922328770067e-45),SC_(1)},
+ {SC_(6502),SC_(7057),SC_(7776),SC_(5839),SC_(6.63606700117381946381672085672918899373e-13),SC_(0.999999999999336393299882618053618327914)},
+ {SC_(6502),SC_(7057),SC_(7776),SC_(6203),SC_(1.542557168960023034818951659706515963371e-165),SC_(1)},
+ {SC_(6502),SC_(7057),SC_(7776),SC_(6099),SC_(7.056246415649681487845593113686788210749e-77),SC_(1)},
+ {SC_(6502),SC_(7057),SC_(7776),SC_(5837),SC_(1.060988761512792446491330495157519425324e-13),SC_(0.99999999999989390112384872075535086695)},
+ {SC_(6502),SC_(7057),SC_(7776),SC_(6319),SC_(2.820554847390103169511581695491940584393e-304),SC_(1)},
+ {SC_(6502),SC_(7057),SC_(7776),SC_(6154),SC_(9.280178833271458577805781737765851359894e-120),SC_(1)},
+ {SC_(6502),SC_(7057),SC_(7776),SC_(6445),SC_(1.1237761265636870386358815721616860647e-517),SC_(1)},
+ {SC_(6502),SC_(7057),SC_(7776),SC_(6035),SC_(2.309258957896082776083182941338016668981e-38),SC_(0.999999999999999999999999999999999999977)},
+ {SC_(5376),SC_(7057),SC_(7776),SC_(4752),SC_(5.499056231101425069907962339769176549664e-31),SC_(0.999999999999999999999999999999450094377)},
+ {SC_(5376),SC_(7057),SC_(7776),SC_(4682),SC_(3.483918577459092417445429604302908858418e-84),SC_(1)},
+ {SC_(5376),SC_(7057),SC_(7776),SC_(5304),SC_(2.241565104631311336401958803592277515717e-269),SC_(1)},
+ {SC_(5376),SC_(7057),SC_(7776),SC_(5052),SC_(2.716745208445346309604644858644673960364e-45),SC_(1)},
+ {SC_(5376),SC_(7057),SC_(7776),SC_(5367),SC_(1.7136859921004385300380315804428404358e-380),SC_(1)},
+ {SC_(5376),SC_(7057),SC_(7776),SC_(4740),SC_(2.050687092344363711901873531512052909147e-37),SC_(0.999999999999999999999999999999999999795)},
+ {SC_(5376),SC_(7057),SC_(7776),SC_(4663),SC_(2.098007582056121610090779567469351976459e-110),SC_(1)},
+ {SC_(5376),SC_(7057),SC_(7776),SC_(5352),SC_(1.561784045316867190347403267847607197716e-348),SC_(1)},
+ {SC_(5376),SC_(7057),SC_(7776),SC_(5304),SC_(2.241565104631311336401958803592277515717e-269),SC_(1)},
+ {SC_(5376),SC_(7057),SC_(7776),SC_(4784),SC_(1.49132572622344669456584346836355106932e-17),SC_(0.999999999999999985086742737765533054342)},
+ {SC_(5232),SC_(6918),SC_(7776),SC_(4399),SC_(2.343113626707823385933113236986720938882e-117),SC_(1)},
+ {SC_(5232),SC_(6918),SC_(7776),SC_(4881),SC_(5.180276588226608810525276707320915883648e-64),SC_(1)},
+ {SC_(5232),SC_(6918),SC_(7776),SC_(4547),SC_(2.426214376202356859906463750830092131146e-18),SC_(0.999999999999999997573785623797643140094)},
+ {SC_(5232),SC_(6918),SC_(7776),SC_(4488),SC_(2.234638015858454689167677437439880492551e-43),SC_(1)},
+ {SC_(5232),SC_(6918),SC_(7776),SC_(4425),SC_(5.614213846823278295494582092352970122337e-89),SC_(1)},
+ {SC_(5232),SC_(6918),SC_(7776),SC_(4941),SC_(9.634173930986049550428494040130097135394e-101),SC_(1)},
+ {SC_(5232),SC_(6918),SC_(7776),SC_(5103),SC_(4.433475935587015417714327069368359207999e-250),SC_(1)},
+ {SC_(5232),SC_(6918),SC_(7776),SC_(4977),SC_(3.595497449433888949541545049500499348639e-127),SC_(1)},
+ {SC_(5232),SC_(6918),SC_(7776),SC_(5091),SC_(5.514587488006982422397857793698388770548e-236),SC_(1)},
+ {SC_(5232),SC_(6918),SC_(7776),SC_(4430),SC_(2.332768540435406669791560369903062122162e-84),SC_(1)},
+ {SC_(5645),SC_(6918),SC_(7776),SC_(5370),SC_(2.200543047981455424220121648010268362041e-154),SC_(1)},
+ {SC_(5645),SC_(6918),SC_(7776),SC_(5414),SC_(3.698259472434217622664664284235239608109e-195),SC_(1)},
+ {SC_(5645),SC_(6918),SC_(7776),SC_(5192),SC_(6.97789046833551306740122425601508300544e-40),SC_(0.999999999999999999999999999999999999999)},
+ {SC_(5645),SC_(6918),SC_(7776),SC_(5542),SC_(1.366984360368383739608290405404061611721e-349),SC_(1)},
+ {SC_(5645),SC_(6918),SC_(7776),SC_(5144),SC_(5.370972831427819866559357285460024363602e-22),SC_(0.999999999999999999999462902716857218013)},
+ {SC_(5645),SC_(6918),SC_(7776),SC_(5080),SC_(7.667902798741622031967145245262765144651e-7),SC_(0.9999992332097201258377968032854754737235)},
+ {SC_(5645),SC_(6918),SC_(7776),SC_(4911),SC_(6.362614847086157905759321598572455966149e-22),SC_(0.999999999999999999999363738515291384209)},
+ {SC_(5645),SC_(6918),SC_(7776),SC_(5465),SC_(1.304052649501653598631085751311278898376e-249),SC_(1)},
+ {SC_(5645),SC_(6918),SC_(7776),SC_(5450),SC_(9.797773634274213577396819664503555714912e-233),SC_(1)},
+ {SC_(5645),SC_(6918),SC_(7776),SC_(5320),SC_(2.378026131973153674445617336213805008549e-114),SC_(1)},
+ {SC_(6669),SC_(3183),SC_(15101),SC_(1362),SC_(0.003432580010140186174603454179412088610313),SC_(0.9965674199898598138253965458205879113897)},
+ {SC_(6669),SC_(3183),SC_(15101),SC_(2732),SC_(1.150363157673488590403425946451609747128e-655),SC_(1)},
+ {SC_(6669),SC_(3183),SC_(15101),SC_(190),SC_(9.756359070916522203384162804726944632025e-623),SC_(1)},
+ {SC_(6669),SC_(3183),SC_(15101),SC_(1416),SC_(0.0147039488396557078726551412596523314875),SC_(0.9852960511603442921273448587403476685125)},
+ {SC_(6669),SC_(3183),SC_(15101),SC_(2316),SC_(1.245823054358362073354829091080361533244e-296),SC_(1)},
+ {SC_(6669),SC_(3183),SC_(15101),SC_(2439),SC_(3.475581912009749797735424219312901732426e-385),SC_(1)},
+ {SC_(6669),SC_(3183),SC_(15101),SC_(889),SC_(1.917460588612326199471240983672408229536e-99),SC_(1)},
+ {SC_(6669),SC_(3183),SC_(15101),SC_(493),SC_(2.798437958796681291779177253703181903241e-323),SC_(1)},
+ {SC_(6669),SC_(3183),SC_(15101),SC_(2516),SC_(1.222402743641579429852094136190878254222e-447),SC_(1)},
+ {SC_(6669),SC_(3183),SC_(15101),SC_(1398),SC_(0.01528558210088525686595338622074431863466),SC_(0.9847144178991147431340466137792556813653)},
+ {SC_(7501),SC_(3183),SC_(15101),SC_(1537),SC_(0.003392774859500490860071777302510963220477),SC_(0.9966072251404995091399282226974890367795)},
+ {SC_(7501),SC_(3183),SC_(15101),SC_(304),SC_(2.922840434477501415001842954927414318709e-637),SC_(1)},
+ {SC_(7501),SC_(3183),SC_(15101),SC_(1618),SC_(0.005374015022472183234572722335025013239405),SC_(0.9946259849775278167654272776649749867606)},
+ {SC_(7501),SC_(3183),SC_(15101),SC_(147),SC_(1.166140591626696944317279521641537820299e-844),SC_(1)},
+ {SC_(7501),SC_(3183),SC_(15101),SC_(994),SC_(4.082339797092165474084031080999678071138e-124),SC_(1)},
+ {SC_(7501),SC_(3183),SC_(15101),SC_(1435),SC_(6.549227779469151096964159774687501788647e-10),SC_(0.999999999345077222053084890303584022531)},
+ {SC_(7501),SC_(3183),SC_(15101),SC_(1177),SC_(1.637225473461215456443219391937428290614e-59),SC_(1)},
+ {SC_(7501),SC_(3183),SC_(15101),SC_(557),SC_(1.876292866781179175774369051175441052695e-390),SC_(1)},
+ {SC_(7501),SC_(3183),SC_(15101),SC_(2537),SC_(1.349738493709665520706245824145504252837e-335),SC_(1)},
+ {SC_(7501),SC_(3183),SC_(15101),SC_(2208),SC_(3.219213438312908791435341543462297273839e-141),SC_(1)},
+ {SC_(11777),SC_(4180),SC_(15101),SC_(3610),SC_(1.484099988688860324347110865494150425591e-57),SC_(1)},
+ {SC_(11777),SC_(4180),SC_(15101),SC_(3044),SC_(1.995689560016418540040642569853698309135e-21),SC_(0.99999999999999999999800431043998358146)},
+ {SC_(11777),SC_(4180),SC_(15101),SC_(1620),SC_(1.849015649864215552545803362852000903264e-1044),SC_(1)},
+ {SC_(11777),SC_(4180),SC_(15101),SC_(2595),SC_(5.208768449067478990782182771081425868904e-175),SC_(1)},
+ {SC_(11777),SC_(4180),SC_(15101),SC_(2535),SC_(7.546528069748636143178314406947992570196e-207),SC_(1)},
+ {SC_(11777),SC_(4180),SC_(15101),SC_(2760),SC_(3.770613903956560255235614346005457556285e-101),SC_(1)},
+ {SC_(11777),SC_(4180),SC_(15101),SC_(2649),SC_(1.25626420882160707497519705726113064134e-148),SC_(1)},
+ {SC_(11777),SC_(4180),SC_(15101),SC_(876),SC_(1.108046167104653252216718665282221499239e-2462),SC_(1)},
+ {SC_(11777),SC_(4180),SC_(15101),SC_(2483),SC_(1.339313699164546044660688747310956476095e-236),SC_(1)},
+ {SC_(11777),SC_(4180),SC_(15101),SC_(2390),SC_(7.787214194767040239756445935466698827643e-295),SC_(1)},
+ {SC_(4240),SC_(4180),SC_(15101),SC_(171),SC_(8.332028361418658536444080754686162054419e-454),SC_(1)},
+ {SC_(4240),SC_(4180),SC_(15101),SC_(3613),SC_(1.425616764328894993104213898464695349173e-2132),SC_(1)},
+ {SC_(4240),SC_(4180),SC_(15101),SC_(160),SC_(1.512285651977504731078922849218810350619e-466),SC_(1)},
+ {SC_(4240),SC_(4180),SC_(15101),SC_(629),SC_(4.372449642211059530015191537976655830715e-117),SC_(1)},
+ {SC_(4240),SC_(4180),SC_(15101),SC_(1355),SC_(5.022431956222962772603321495219683924569e-14),SC_(0.999999999999949775680437770372273966785)},
+ {SC_(4240),SC_(4180),SC_(15101),SC_(202),SC_(1.135912133968950827962709304975328663493e-419),SC_(1)},
+ {SC_(4240),SC_(4180),SC_(15101),SC_(1401),SC_(1.570131491327047266407185069305435311167e-20),SC_(0.999999999999999999984298685086729527336)},
+ {SC_(4240),SC_(4180),SC_(15101),SC_(1705),SC_(6.623846214643720087055001577389756029752e-99),SC_(1)},
+ {SC_(4240),SC_(4180),SC_(15101),SC_(2579),SC_(7.669309688657428097790112921774177164257e-666),SC_(1)},
+ {SC_(4240),SC_(4180),SC_(15101),SC_(668),SC_(1.809042752187027963539721406668874696593e-100),SC_(1)},
+ {SC_(11499),SC_(12934),SC_(24657),SC_(2512),SC_(2.598292076822219967179491085454243653849e-1869),SC_(1)},
+ {SC_(11499),SC_(12934),SC_(24657),SC_(3937),SC_(2.514948995863659130299872409921862164027e-637),SC_(1)},
+ {SC_(11499),SC_(12934),SC_(24657),SC_(6198),SC_(1.236938277579975399540504737729374988483e-6),SC_(0.999998763061722420024600459495262270625)},
+ {SC_(11499),SC_(12934),SC_(24657),SC_(3006),SC_(2.913319733060924056282277158911969263952e-1358),SC_(1)},
+ {SC_(11499),SC_(12934),SC_(24657),SC_(2143),SC_(1.225964079424653575588709697137289470527e-2317),SC_(1)},
+ {SC_(11499),SC_(12934),SC_(24657),SC_(3982),SC_(7.962168082309776222321536217568968116598e-610),SC_(1)},
+ {SC_(11499),SC_(12934),SC_(24657),SC_(7342),SC_(2.0332524868416741849991473068146099976e-248),SC_(1)},
+ {SC_(11499),SC_(12934),SC_(24657),SC_(2806),SC_(1.41730974838248657865578519761872225563e-1553),SC_(1)},
+ {SC_(11499),SC_(12934),SC_(24657),SC_(9959),SC_(4.691748551708249174612474072544044064791e-2391),SC_(1)},
+ {SC_(11499),SC_(12934),SC_(24657),SC_(2221),SC_(9.292899039910742714594775474886352211364e-2218),SC_(1)},
+ {SC_(3726),SC_(12934),SC_(24657),SC_(3400),SC_(5.522963046899528154226901175475577295199e-667),SC_(1)},
+ {SC_(3726),SC_(12934),SC_(24657),SC_(2361),SC_(1.218226249726881097121490663821885226072e-48),SC_(1)},
+ {SC_(3726),SC_(12934),SC_(24657),SC_(3252),SC_(5.390845446111834412654354015587937116027e-520),SC_(1)},
+ {SC_(3726),SC_(12934),SC_(24657),SC_(1047),SC_(2.508605363205525039885287901237636584153e-234),SC_(1)},
+ {SC_(3726),SC_(12934),SC_(24657),SC_(3001),SC_(1.564917041595683869684752506952078902376e-325),SC_(1)},
+ {SC_(3726),SC_(12934),SC_(24657),SC_(446),SC_(3.905867526809265795951997940309987248544e-689),SC_(1)},
+ {SC_(3726),SC_(12934),SC_(24657),SC_(2945),SC_(8.561936437191530114441731269328784940435e-290),SC_(1)},
+ {SC_(3726),SC_(12934),SC_(24657),SC_(2112),SC_(2.01433597453552096261460076357092434246e-9),SC_(0.9999999979856640254644790373853992364291)},
+ {SC_(3726),SC_(12934),SC_(24657),SC_(2206),SC_(4.33248370298740736694721596763121257435e-20),SC_(0.999999999999999999956675162970125926331)},
+ {SC_(3726),SC_(12934),SC_(24657),SC_(2586),SC_(2.621275241290113469688641859152460833984e-115),SC_(1)},
+ {SC_(9214),SC_(22320),SC_(24657),SC_(8235),SC_(2.572092392197672328633928766428875851368e-7),SC_(0.9999997427907607802327671366071233571124)},
+ {SC_(9214),SC_(22320),SC_(24657),SC_(6912),SC_(2.995220242304922530946556501112035078386e-1001),SC_(1)},
+ {SC_(9214),SC_(22320),SC_(24657),SC_(8065),SC_(6.823500307899326592600239536232296999914e-35),SC_(0.999999999999999999999999999999999931765)},
+ {SC_(9214),SC_(22320),SC_(24657),SC_(7400),SC_(6.143694779188174664532181043531732390736e-382),SC_(1)},
+ {SC_(9214),SC_(22320),SC_(24657),SC_(8197),SC_(2.196969620238744261631579608996504657964e-11),SC_(0.99999999997803030379761255738368420391)},
+ {SC_(9214),SC_(22320),SC_(24657),SC_(9066),SC_(2.392808605571506258100931040620965664663e-292),SC_(1)},
+ {SC_(9214),SC_(22320),SC_(24657),SC_(7659),SC_(9.864908397518906691400357324055299644024e-199),SC_(1)},
+ {SC_(9214),SC_(22320),SC_(24657),SC_(8367),SC_(0.008940500850727833031683102955269025524831),SC_(0.9910594991492721669683168970447309744752)},
+ {SC_(9214),SC_(22320),SC_(24657),SC_(7722),SC_(5.639251875364654279561827347396897861953e-164),SC_(1)},
+ {SC_(9214),SC_(22320),SC_(24657),SC_(9205),SC_(1.542676519665671321015042144728609471195e-483),SC_(1)},
+ {SC_(5114),SC_(22320),SC_(24657),SC_(4820),SC_(1.477063508628490542021440118682826058188e-27),SC_(0.999999999999999999999999998522936491372)},
+ {SC_(5114),SC_(22320),SC_(24657),SC_(3410),SC_(3.045373335617048845328113579500020782746e-732),SC_(1)},
+ {SC_(5114),SC_(22320),SC_(24657),SC_(2871),SC_(2.241317040202664236604200007822733526021e-1577),SC_(1)},
+ {SC_(5114),SC_(22320),SC_(24657),SC_(3636),SC_(2.683599854064377251178684551679527365742e-493),SC_(1)},
+ {SC_(5114),SC_(22320),SC_(24657),SC_(3319),SC_(1.059220384879855641700051419405729847713e-843),SC_(1)},
+ {SC_(5114),SC_(22320),SC_(24657),SC_(4648),SC_(0.01304651023656202084023981765832181182544),SC_(0.9869534897634379791597601823416781881746)},
+ {SC_(5114),SC_(22320),SC_(24657),SC_(5016),SC_(4.119075881733889814385613977586581391744e-127),SC_(1)},
+ {SC_(5114),SC_(22320),SC_(24657),SC_(3714),SC_(2.582371744065788637208257378851197609461e-422),SC_(1)},
+ {SC_(5114),SC_(22320),SC_(24657),SC_(4256),SC_(4.163937028620596203170694042834733586806e-79),SC_(1)},
+ {SC_(5114),SC_(22320),SC_(24657),SC_(3234),SC_(9.15934913376235224214900202826706132587e-957),SC_(1)}
+ }};
+#undef SC_

Added: sandbox/math_toolkit/libs/math/test/test_hypergeometric_dist.cpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/test/test_hypergeometric_dist.cpp 2008-12-18 07:27:41 EST (Thu, 18 Dec 2008)
@@ -0,0 +1,202 @@
+// Copyright John Maddock
+// Copyright Paul A. Bristow
+// Copyright Gautam Sewani
+
+// 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)
+
+#define BOOST_MATH_OVERFLOW_ERROR_POLICY throw_on_error
+#include <boost/math/concepts/real_concept.hpp> // for real_concept
+#include <boost/math/distributions/hypergeometric.hpp>
+
+#include <boost/test/included/test_exec_monitor.hpp> // Boost.Test
+#include <boost/test/floating_point_comparison.hpp>
+
+#include <iostream>
+ using std::cout;
+ using std::endl;
+ using std::setprecision;
+
+#include <boost/array.hpp>
+#include "functor.hpp"
+#include "handle_test_result.hpp"
+
+#define BOOST_CHECK_EX(a) \
+ {\
+ 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 with data ";\
+ std::cerr << std::setprecision(35); \
+ std::cerr << "x = " << x << ", r = " << r << ", n = " << n\
+ << ", N = " << N << ", p = " << cp << ", q = " << ccp << 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";
+#endif
+
+ add_expected_result(
+ ".*", // compiler
+ ".*", // stdlib
+ ".*", // platform
+ largest_type, // test type(s)
+ ".*", // test data group
+ ".*", 50, 20); // test function
+}
+
+template <class T>
+inline unsigned make_unsigned(T x)
+{
+ return static_cast<unsigned>(x);
+}
+template<>
+inline unsigned make_unsigned(boost::math::concepts::real_concept x)
+{
+ return static_cast<unsigned>(x.value());
+}
+
+template <class T>
+T pdf_tester(T r, T n, T N, T x)
+{
+ boost::math::hypergeometric_distribution<T> d(make_unsigned(r), make_unsigned(n), make_unsigned(N));
+ return pdf(d, x);
+}
+
+template <class T>
+void do_test_hypergeometric(const T& data, const char* type_name, const char* test_name)
+{
+ typedef typename T::value_type row_type;
+ typedef typename row_type::value_type value_type;
+
+ typedef value_type (*pg)(value_type, value_type, value_type, value_type);
+#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
+ pg funcp = pdf_tester<value_type>;
+#else
+ pg funcp = pdf_tester;
+#endif
+
+ boost::math::tools::test_result<value_type> result;
+
+ std::cout << "Testing " << test_name << " with type " << type_name
+ << "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";
+
+ //
+ // test hypergeometric against data:
+ //
+ result = boost::math::tools::test(
+ data,
+ bind_func(funcp, 0, 1, 2, 3),
+ extract_result(4));
+ handle_test_result(result, data[result.worst()], result.worst(), type_name, "hypergeometric PDF", test_name);
+ std::cout << std::endl;
+}
+
+template <class RealType>
+void test_spot(unsigned x, unsigned n, unsigned r, unsigned N,
+ RealType p, RealType cp, RealType ccp, RealType tol)
+{
+ boost::math::hypergeometric_distribution<RealType> d(r, n, N);
+
+ std::pair<unsigned, unsigned> extent = range(d);
+
+ BOOST_CHECK_CLOSE(pdf(d, x), p, tol);
+ BOOST_CHECK_CLOSE(cdf(d, x), cp, tol);
+ BOOST_CHECK_CLOSE(cdf(complement(d, x)), ccp, tol);
+ // Again with real-value arguments:
+ BOOST_CHECK_CLOSE(pdf(d, static_cast<RealType>(x)), p, tol);
+ BOOST_CHECK_CLOSE(cdf(d, static_cast<RealType>(x)), cp, tol);
+ BOOST_CHECK_CLOSE(cdf(complement(d, static_cast<RealType>(x))), ccp, tol);
+ // quantiles:
+ if(boost::math::tools::digits<RealType>() > 50)
+ {
+ using namespace boost::math::policies;
+ boost::math::hypergeometric_distribution<RealType,
+ policy<discrete_quantile<integer_round_up> > > du(r, n, N);
+ BOOST_CHECK_EX(quantile(du, cp) >= x);
+ BOOST_CHECK_EX(quantile(complement(du, ccp)) >= x);
+
+ boost::math::hypergeometric_distribution<RealType,
+ policy<discrete_quantile<integer_round_down> > > dl(r, n, N);
+ BOOST_CHECK_EX(quantile(dl, cp) <= x);
+ BOOST_CHECK_EX(quantile(complement(dl, ccp)) <= x);
+ }
+}
+
+template <class RealType>
+void test_spots(RealType /*T*/, const char* type_name)
+{
+ // Basic sanity checks.
+ // 50 eps as a percentage, up to a maximum of double precision
+ // Test data taken from Mathematica 6
+#define T RealType
+#include "hypergeometric_test_data.ipp"
+ do_test_hypergeometric(hypergeometric_test_data, type_name, "Mathematica data");
+
+ RealType tolerance = (std::max)(
+ static_cast<RealType>(2e-16L), // limit of test data
+ boost::math::tools::epsilon<RealType>());
+ cout<<"Absolute tolerance:"<<tolerance<<endl;
+
+ tolerance *= 50 * 100; // 50eps as a persentage
+ cout << "Tolerance for type " << typeid(RealType).name() << " is " << tolerance << " %" << endl;
+
+ test_spot(20, 200, 50, 500, static_cast<T>(0.120748236361163), static_cast<T>(0.563532430195156), static_cast<T>(1 - 0.563532430195156), tolerance);
+ test_spot(53, 452, 64, 500, static_cast<T>(0.0184749573044286), static_cast<T>(0.0299118078796907), static_cast<T>(1 - 0.0299118078796907), tolerance);
+ test_spot(32, 1287, 128, 5000, static_cast<T>(0.0807012167418264), static_cast<T>(0.469768774237742), static_cast<T>(1 - 0.469768774237742), tolerance);
+ test_spot(1, 13, 4, 26, static_cast<T>(0.248695652173913), static_cast<T>(0.296521739130435), static_cast<T>(1 - 0.296521739130435), tolerance);
+ test_spot(2, 13, 4, 26, static_cast<T>(0.40695652173913), static_cast<T>(0.703478260869565), static_cast<T>(1 - 0.703478260869565), tolerance);
+ test_spot(3, 13, 4, 26, static_cast<T>(0.248695652173913), static_cast<T>(0.952173913043478), static_cast<T>(1 - 0.952173913043478), tolerance);
+
+ boost::math::hypergeometric_distribution<RealType> d(50, 200, 500);
+ BOOST_CHECK_EQUAL(range(d).first, 0u);
+ BOOST_CHECK_EQUAL(range(d).second, 50u);
+ BOOST_CHECK_CLOSE(mean(d), static_cast<RealType>(20), tolerance);
+ BOOST_CHECK_CLOSE(mode(d), static_cast<RealType>(20), tolerance);
+ BOOST_CHECK_CLOSE(variance(d), static_cast<RealType>(10.821643286573146292585170340681L), tolerance);
+ BOOST_CHECK_CLOSE(skewness(d), static_cast<RealType>(0.048833071022952084732902910189366L), tolerance);
+ BOOST_CHECK_CLOSE(kurtosis_excess(d), static_cast<RealType>(2.5155486690782804816404001878293L), tolerance);
+ BOOST_CHECK_CLOSE(kurtosis(d), kurtosis_excess(d) + 3, tolerance);
+}
+
+
+int test_main(int, char* [])
+{
+ expected_results();
+ // Basic sanity-check spot values.
+ // (Parameter value, arbitrarily zero, only communicates the floating point type).
+ test_spots(0.0F, "float"); // Test float. OK at decdigits = 0 tolerance = 0.0001 %
+ test_spots(0.0, "double"); // Test double. OK at decdigits 7, tolerance = 1e07 %
+#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+ test_spots(0.0L, "long double"); // Test long double.
+ test_spots(boost::math::concepts::real_concept(0), "real_concept"); // Test real_concept.
+#else
+ std::cout << "<note>The long double tests have been disabled on this platform "
+ "either because the long double overloads of the usual math functions are "
+ "not available at all, or because they are too inaccurate for these tests "
+ "to pass.</note>" << std::cout;
+#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