Boost logo

Boost-Commit :

From: john_at_[hidden]
Date: 2008-08-20 07:02:07


Author: johnmaddock
Date: 2008-08-20 07:02:05 EDT (Wed, 20 Aug 2008)
New Revision: 48250
URL: http://svn.boost.org/trac/boost/changeset/48250

Log:
Updated inverse hypergeometric functions with better tests and more accurate implementation.
Added:
   sandbox/math_toolkit/libs/math/test/acosh_data.ipp (contents, props changed)
   sandbox/math_toolkit/libs/math/test/asinh_data.ipp (contents, props changed)
   sandbox/math_toolkit/libs/math/test/atanh_data.ipp (contents, props changed)
   sandbox/math_toolkit/libs/math/test/test_inv_hyp.cpp (contents, props changed)
   sandbox/math_toolkit/libs/math/tools/inv_hyp_data.cpp (contents, props changed)
Text files modified:
   sandbox/math_toolkit/boost/math/special_functions/acosh.hpp | 69 ++++++++++++++++-----------------
   sandbox/math_toolkit/boost/math/special_functions/asinh.hpp | 67 ++++++++++++++++----------------
   sandbox/math_toolkit/boost/math/special_functions/atanh.hpp | 53 +++++++++++++------------
   sandbox/math_toolkit/boost/math/tools/precision.hpp | 82 ++++++++++++++++++++++++++++++++++++++++
   sandbox/math_toolkit/boost/math/tools/test.hpp | 10 ++++
   sandbox/math_toolkit/boost/math/tools/test_data.hpp | 10 +++
   sandbox/math_toolkit/libs/math/test/Jamfile.v2 | 2
   sandbox/math_toolkit/libs/math/test/handle_test_result.hpp | 8 +++
   8 files changed, 203 insertions(+), 98 deletions(-)

Modified: sandbox/math_toolkit/boost/math/special_functions/acosh.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/acosh.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/acosh.hpp 2008-08-20 07:02:05 EDT (Wed, 20 Aug 2008)
@@ -1,6 +1,7 @@
 // boost asinh.hpp header file
 
 // (C) Copyright Eric Ford 2001 & Hubert Holin.
+// (C) Copyright John Maddock 2008.
 // Distributed under 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)
@@ -42,68 +43,66 @@
         template<typename T, typename Policy>
         inline T acosh_imp(const T x, const Policy& pol)
         {
- using ::std::abs;
- using ::std::sqrt;
- using ::std::log;
+ BOOST_MATH_STD_USING
             
- T const one = static_cast<T>(1);
- T const two = static_cast<T>(2);
-
- static T const taylor_2_bound = sqrt(tools::epsilon<T>());
- static T const taylor_n_bound = sqrt(taylor_2_bound);
- static T const upper_taylor_2_bound = one/taylor_2_bound;
-
- if(x < one)
+ if(x < 1)
             {
                return policies::raise_domain_error<T>(
                   "boost::math::acosh<%1%>(%1%)",
                   "acosh requires x >= 1, but got x = %1%.", x, pol);
             }
- else if (x >= taylor_n_bound)
+ else if ((x - 1) >= tools::root_epsilon<T>())
             {
- if (x > upper_taylor_2_bound)
+ if (x > 1 / tools::root_epsilon<T>())
                 {
+ // http://functions.wolfram.com/ElementaryFunctions/ArcCosh/06/01/06/01/0001/
                     // approximation by laurent series in 1/x at 0+ order from -1 to 0
- return( log( x*two) );
+ return( log( x * 2) );
+ }
+ else if(x < 1.5f)
+ {
+ // This is just a rearrangement of the standard form below
+ // devised to minimse loss of precision when x ~ 1:
+ T y = x - 1;
+ return boost::math::log1p(y + sqrt(y * y + 2 * y), pol);
                 }
                 else
                 {
- return( log( x + sqrt(x*x-one) ) );
+ // http://functions.wolfram.com/ElementaryFunctions/ArcCosh/02/
+ return( log( x + sqrt(x * x - 1) ) );
                 }
             }
             else
             {
- T y = sqrt(x-one);
+ // see http://functions.wolfram.com/ElementaryFunctions/ArcCosh/06/01/04/01/0001/
+ T y = x - 1;
                 
                 // approximation by taylor series in y at 0 up to order 2
- T result = y;
-
- if (y >= taylor_2_bound)
- {
- T y3 = y*y*y;
-
- // approximation by taylor series in y at 0 up to order 4
- result -= y3/static_cast<T>(12);
- }
-
- return(sqrt(static_cast<T>(2))*result);
+ T result = sqrt(2 * y) * (1 + y /12 + 3 * y * y / 160);
+ return result;
             }
         }
        }
 
         template<typename T, typename Policy>
- inline typename tools::promote_args<T>::type acosh(const T x, const Policy& pol)
+ inline typename tools::promote_args<T>::type acosh(const T x, const Policy&)
         {
- typedef typename tools::promote_args<T>::type result_type;
- return detail::acosh_imp(
- static_cast<result_type>(x), pol);
+ 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;
+ return policies::checked_narrowing_cast<result_type, forwarding_policy>(
+ detail::acosh_imp(static_cast<value_type>(x), forwarding_policy()),
+ "boost::math::acosh<%1%>(%1%)");
         }
         template<typename T>
         inline typename tools::promote_args<T>::type acosh(const T x)
         {
- typedef typename tools::promote_args<T>::type result_type;
- return detail::acosh_imp(
- static_cast<result_type>(x), policies::policy<>());
+ return boost::math::acosh(x, policies::policy<>());
         }
 
     }
@@ -112,5 +111,3 @@
 #endif /* BOOST_ACOSH_HPP */
 
 
-
-

Modified: sandbox/math_toolkit/boost/math/special_functions/asinh.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/asinh.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/asinh.hpp 2008-08-20 07:02:05 EDT (Wed, 20 Aug 2008)
@@ -1,6 +1,7 @@
 // boost asinh.hpp header file
 
 // (C) Copyright Eric Ford & Hubert Holin 2001.
+// (C) Copyright John Maddock 2008.
 // Distributed under 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)
@@ -19,6 +20,8 @@
 #include <boost/config.hpp>
 #include <boost/math/tools/precision.hpp>
 #include <boost/math/special_functions/math_fwd.hpp>
+#include <boost/math/special_functions/sqrt1pm1.hpp>
+#include <boost/math/special_functions/log1p.hpp>
 
 // This is the inverse of the hyperbolic sine function.
 
@@ -38,51 +41,41 @@
         using ::std::numeric_limits;
 #endif
         
- template<typename T>
- inline T asinh_imp(const T x)
+ template<typename T, class Policy>
+ inline T asinh_imp(const T x, const Policy& pol)
         {
- using ::std::abs;
- using ::std::sqrt;
- using ::std::log;
-
- T const one = static_cast<T>(1);
- T const two = static_cast<T>(2);
-
- static T const taylor_2_bound = sqrt(tools::epsilon<T>());
- static T const taylor_n_bound = sqrt(taylor_2_bound);
- static T const upper_taylor_2_bound = one/taylor_2_bound;
- static T const upper_taylor_n_bound = one/taylor_n_bound;
+ BOOST_MATH_STD_USING
             
- if (x >= +taylor_n_bound)
+ if (x >= tools::forth_root_epsilon<T>())
             {
- if (x > upper_taylor_n_bound)
+ if (x > 1 / tools::root_epsilon<T>())
+ {
+ // http://functions.wolfram.com/ElementaryFunctions/ArcSinh/06/01/06/01/0001/
+ // approximation by laurent series in 1/x at 0+ order from -1 to 1
+ return log(x * 2) + 1/ (4 * x * x);
+ }
+ else if(x < 0.5f)
                 {
- if (x > upper_taylor_2_bound)
- {
- // approximation by laurent series in 1/x at 0+ order from -1 to 0
- return( log( x * two) );
- }
- else
- {
- // approximation by laurent series in 1/x at 0+ order from -1 to 1
- return( log( x*two + (one/(x*two)) ) );
- }
+ // As below, but rearranged to preserve digits:
+ return boost::math::log1p(x + sqrt1pm1(x * x, pol), pol);
                 }
                 else
                 {
- return( log( x + sqrt(x*x+one) ) );
+ // http://functions.wolfram.com/ElementaryFunctions/ArcSinh/02/
+ return( log( x + sqrt(x*x+1) ) );
                 }
             }
- else if (x <= -taylor_n_bound)
+ else if (x <= -tools::forth_root_epsilon<T>())
             {
                 return(-asinh(-x));
             }
             else
             {
+ // http://functions.wolfram.com/ElementaryFunctions/ArcSinh/06/01/03/01/0001/
                 // approximation by taylor series in x at 0 up to order 2
                 T result = x;
                 
- if (abs(x) >= taylor_2_bound)
+ if (abs(x) >= tools::root_epsilon<T>())
                 {
                     T x3 = x*x*x;
                     
@@ -98,16 +91,22 @@
         template<typename T>
         inline typename tools::promote_args<T>::type asinh(const T x)
         {
- typedef typename tools::promote_args<T>::type result_type;
- return detail::asinh_imp(
- static_cast<result_type>(x));
+ return boost::math::asinh(x, policies::policy<>());
         }
         template<typename T, typename Policy>
         inline typename tools::promote_args<T>::type asinh(const T x, const Policy&)
         {
- typedef typename tools::promote_args<T>::type result_type;
- return detail::asinh_imp(
- static_cast<result_type>(x));
+ 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;
+ return policies::checked_narrowing_cast<result_type, forwarding_policy>(
+ detail::asinh_imp(static_cast<value_type>(x), forwarding_policy()),
+ "boost::math::asinh<%1%>(%1%)");
         }
 
     }

Modified: sandbox/math_toolkit/boost/math/special_functions/atanh.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/special_functions/atanh.hpp (original)
+++ sandbox/math_toolkit/boost/math/special_functions/atanh.hpp 2008-08-20 07:02:05 EDT (Wed, 20 Aug 2008)
@@ -1,6 +1,7 @@
 // boost atanh.hpp header file
 
 // (C) Copyright Hubert Holin 2001.
+// (C) Copyright John Maddock 2008.
 // Distributed under 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)
@@ -20,6 +21,7 @@
 #include <boost/math/tools/precision.hpp>
 #include <boost/math/policies/error_handling.hpp>
 #include <boost/math/special_functions/math_fwd.hpp>
+#include <boost/math/special_functions/log1p.hpp>
 
 // This is the inverse of the hyperbolic tangent function.
 
@@ -45,52 +47,45 @@
         template<typename T, typename Policy>
         inline T atanh_imp(const T x, const Policy& pol)
         {
- using ::std::abs;
- using ::std::sqrt;
- using ::std::log;
-
- using ::std::numeric_limits;
-
- T const one = static_cast<T>(1);
- T const two = static_cast<T>(2);
-
- static T const taylor_2_bound = sqrt(tools::epsilon<T>());
- static T const taylor_n_bound = sqrt(taylor_2_bound);
-
+ BOOST_MATH_STD_USING
             static const char* function = "boost::math::atanh<%1%>(%1%)";
             
- if (x < -one)
+ if(x < -1)
             {
                return policies::raise_domain_error<T>(
                   function,
                   "atanh requires x >= -1, but got x = %1%.", x, pol);
             }
- else if (x < -one + tools::epsilon<T>())
+ else if(x < -1 + tools::epsilon<T>())
             {
                // -Infinity:
                return -policies::raise_overflow_error<T>(function, 0, pol);
             }
- else if (x > one - tools::epsilon<T>())
+ else if(x > 1 - tools::epsilon<T>())
             {
                // Infinity:
                return -policies::raise_overflow_error<T>(function, 0, pol);
             }
- else if (x > +one)
+ else if(x > 1)
             {
                return policies::raise_domain_error<T>(
                   function,
                   "atanh requires x <= 1, but got x = %1%.", x, pol);
             }
- else if (abs(x) >= taylor_n_bound)
+ else if(abs(x) >= tools::forth_root_epsilon<T>())
             {
- return(log( (one + x) / (one - x) ) / two);
+ // http://functions.wolfram.com/ElementaryFunctions/ArcTanh/02/
+ if(abs(x) < 0.5f)
+ return (boost::math::log1p(x, pol) - boost::math::log1p(-x, pol)) / 2;
+ return(log( (1 + x) / (1 - x) ) / 2);
             }
             else
             {
+ // http://functions.wolfram.com/ElementaryFunctions/ArcTanh/06/01/03/01/
                 // approximation by taylor series in x at 0 up to order 2
                 T result = x;
                 
- if (abs(x) >= taylor_2_bound)
+ if (abs(x) >= tools::root_epsilon<T>())
                 {
                     T x3 = x*x*x;
                     
@@ -104,18 +99,24 @@
        }
 
         template<typename T, typename Policy>
- inline typename tools::promote_args<T>::type atanh(const T x, const Policy& pol)
+ inline typename tools::promote_args<T>::type atanh(const T x, const Policy&)
         {
- typedef typename tools::promote_args<T>::type result_type;
- return detail::atanh_imp(
- static_cast<result_type>(x), pol);
+ 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;
+ return policies::checked_narrowing_cast<result_type, forwarding_policy>(
+ detail::atanh_imp(static_cast<value_type>(x), forwarding_policy()),
+ "boost::math::atanh<%1%>(%1%)");
         }
         template<typename T>
         inline typename tools::promote_args<T>::type atanh(const T x)
         {
- typedef typename tools::promote_args<T>::type result_type;
- return detail::atanh_imp(
- static_cast<result_type>(x), policies::policy<>());
+ return boost::math::atanh(x, policies::policy<>());
         }
 
     }

Modified: sandbox/math_toolkit/boost/math/tools/precision.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/tools/precision.hpp (original)
+++ sandbox/math_toolkit/boost/math/tools/precision.hpp 2008-08-20 07:02:05 EDT (Wed, 20 Aug 2008)
@@ -232,6 +232,88 @@
 #endif
 }
 
+namespace detail{
+
+template <class T>
+inline T root_epsilon_imp(const mpl::int_<24>&)
+{
+ return static_cast<T>(0.00034526698300124390839884978618400831996329879769945L);
+}
+
+template <class T>
+inline T root_epsilon_imp(const mpl::int_<53>&)
+{
+ return static_cast<T>(0.1490116119384765625e-7L);
+}
+
+template <class T>
+inline T root_epsilon_imp(const mpl::int_<64>&)
+{
+ return static_cast<T>(0.32927225399135962333569506281281311031656150598474e-9L);
+}
+
+template <class T>
+inline T root_epsilon_imp(const mpl::int_<113>&)
+{
+ return static_cast<T>(0.1387778780781445675529539585113525390625e-16L);
+}
+
+template <class T, class Tag>
+inline T root_epsilon_imp(const Tag&)
+{
+ BOOST_MATH_STD_USING
+ static const T r_eps = sqrt(tools::epsilon<T>());
+ return r_eps;
+}
+
+template <class T>
+inline T forth_root_epsilon_imp(const mpl::int_<24>&)
+{
+ return static_cast<T>(0.018581361171917516667460937040007436176452688944747L);
+}
+
+template <class T>
+inline T forth_root_epsilon_imp(const mpl::int_<53>&)
+{
+ return static_cast<T>(0.0001220703125L);
+}
+
+template <class T>
+inline T forth_root_epsilon_imp(const mpl::int_<64>&)
+{
+ return static_cast<T>(0.18145860519450699870567321328132261891067079047605e-4L);
+}
+
+template <class T>
+inline T forth_root_epsilon_imp(const mpl::int_<113>&)
+{
+ return static_cast<T>(0.37252902984619140625e-8L);
+}
+
+template <class T, class Tag>
+inline T forth_root_epsilon_imp(const Tag&)
+{
+ BOOST_MATH_STD_USING
+ static const T r_eps = sqrt(sqrt(tools::epsilon<T>()));
+ return r_eps;
+}
+
+}
+
+template <class T>
+inline T root_epsilon()
+{
+ typedef mpl::int_<std::numeric_limits<T>::digits> tag_type;
+ return detail::root_epsilon_imp<T>(tag_type());
+}
+
+template <class T>
+inline T forth_root_epsilon()
+{
+ typedef mpl::int_<std::numeric_limits<T>::digits> tag_type;
+ return detail::forth_root_epsilon_imp<T>(tag_type());
+}
+
 } // namespace tools
 } // namespace math
 } // namespace boost

Modified: sandbox/math_toolkit/boost/math/tools/test.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/tools/test.hpp (original)
+++ sandbox/math_toolkit/boost/math/tools/test.hpp 2008-08-20 07:02:05 EDT (Wed, 20 Aug 2008)
@@ -151,9 +151,19 @@
 }
 #endif
 
+template <class T>
+void set_output_precision(T)
+{
+ if(std::numeric_limits<T>::digits10)
+ {
+ std::cout << std::setprecision(std::numeric_limits<T>::digits10 + 2);
+ }
+}
+
 template <class Seq>
 void print_row(const Seq& row)
 {
+ set_output_precision(row[0]);
    for(unsigned i = 0; i < row.size(); ++i)
    {
       if(i)

Modified: sandbox/math_toolkit/boost/math/tools/test_data.hpp
==============================================================================
--- sandbox/math_toolkit/boost/math/tools/test_data.hpp (original)
+++ sandbox/math_toolkit/boost/math/tools/test_data.hpp 2008-08-20 07:02:05 EDT (Wed, 20 Aug 2008)
@@ -328,8 +328,14 @@
 template <class T>
 inline float test_data<T>::truncate_to_float(float const * pf)
 {
- extern_val = *pf;
- return *pf;
+ BOOST_MATH_STD_USING
+ int expon;
+ float f = floor(ldexp(frexp(*pf, &expon), 22));
+ f = ldexp(f, expon - 22);
+ return f;
+
+ //extern_val = *pf;
+ //return *pf;
 }
 
 template <class T>

Modified: sandbox/math_toolkit/libs/math/test/Jamfile.v2
==============================================================================
--- sandbox/math_toolkit/libs/math/test/Jamfile.v2 (original)
+++ sandbox/math_toolkit/libs/math/test/Jamfile.v2 2008-08-20 07:02:05 EDT (Wed, 20 Aug 2008)
@@ -218,6 +218,7 @@
               <define>TEST_REAL_CONCEPT
         : test_igamma_inva_real_concept ;
 run test_instantiate1.cpp test_instantiate2.cpp ;
+run test_inv_hyp.cpp ;
 run test_laguerre.cpp ;
 run test_legendre.cpp ;
 run test_lognormal.cpp ;
@@ -491,3 +492,4 @@
 compile compile_test/tools_toms748_inc_test.cpp ;
 
 
+

Added: sandbox/math_toolkit/libs/math/test/acosh_data.ipp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/test/acosh_data.ipp 2008-08-20 07:02:05 EDT (Wed, 20 Aug 2008)
@@ -0,0 +1,266 @@
+#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+ static const boost::array<boost::array<T, 2>, 261> acosh_data = {{
+ { SC_(1.000001430511474609375), SC_(0.001691455665129294448190238354291760044433) },
+ { SC_(1.0000019073486328125), SC_(0.001953124689559275021527821917817027620963) },
+ { SC_(1.000007152557373046875), SC_(0.003782208044661295168504799813496158490314) },
+ { SC_(1.000013828277587890625), SC_(0.005258943946801101349061072655743616330534) },
+ { SC_(1.0000171661376953125), SC_(0.005859366618129202398694086527594451883545) },
+ { SC_(1.00006008148193359375), SC_(0.0109618319921888517811096976159923461784) },
+ { SC_(1.000116825103759765625), SC_(0.01528547213183042467192017645636643040682) },
+ { SC_(1.000148773193359375), SC_(0.01724931909352987823311560583970196658141) },
+ { SC_(1.000398159027099609375), SC_(0.02821817173865537359266716853098519889415) },
+ { SC_(1.000638484954833984375), SC_(0.03573281468231456624811499142438796295686) },
+ { SC_(1.001071453094482421875), SC_(0.04628740247287877599360006621134226755174) },
+ { SC_(1.003021717071533203125), SC_(0.07771996527168971264969648279358369972575) },
+ { SC_(1.004993915557861328125), SC_(0.09989759308602780434912638996550489375369) },
+ { SC_(1.00928401947021484375), SC_(0.1361593876803246479600670434737716450022) },
+ { SC_(1.024169921875), SC_(0.2194227900495835483852561715845842241518) },
+ { SC_(1.062277317047119140625), SC_(0.3511165938166054588185413287563455693446) },
+ { SC_(1.12234401702880859375), SC_(0.4897502671128818535428474267470966393752) },
+ { SC_(1.2495574951171875), SC_(0.6925568837084910405419269283192900693752) },
+ { SC_(1.491221904754638671875), SC_(0.9545305722214140465734705961617555409538) },
+ { SC_(1.983847141265869140625), SC_(1.307581416910453029674373062377350125402) },
+ { SC_(2.15761280059814453125), SC_(1.403518877974133434572205965467405839077) },
+ { SC_(2.40639781951904296875), SC_(1.525007084542751786819384889715403191957) },
+ { SC_(3.38695812225341796875), SC_(1.890537201307279875549078665860235683411) },
+ { SC_(4.4516773223876953125), SC_(2.173567339994825397387431806918552342932) },
+ { SC_(6.9391326904296875), SC_(2.625091127868242256287879402513352014572) },
+ { SC_(7.756023406982421875), SC_(2.737434918695162165715461546271032662695) },
+ { SC_(8.8823699951171875), SC_(2.874031716780194544439172840789924579634) },
+ { SC_(9.869171142578125), SC_(2.979986393289490221624555712675426245527) },
+ { SC_(16.848876953125), SC_(3.516549380542481075157493697729821147595) },
+ { SC_(16.88458251953125), SC_(3.518670034680249794623612003576884164306) },
+ { SC_(18.18859100341796875), SC_(3.593185165198828891634086870735797352995) },
+ { SC_(18.82012176513671875), SC_(3.627367214296338506596699897092700261917) },
+ { SC_(19.18418121337890625), SC_(3.646553244410946142822321573885913155251) },
+ { SC_(24.039520263671875), SC_(3.872413451393967155852229598937671193827) },
+ { SC_(26.5569915771484375), SC_(3.97208556893332931613088010770137243142) },
+ { SC_(27.92110443115234375), SC_(4.022209178119237972634584536383754567227) },
+ { SC_(32.314666748046875), SC_(4.168428891496629419926716002725343213186) },
+ { SC_(34.7300872802734375), SC_(4.24054622986100481621284684937772318866) },
+ { SC_(36.51556396484375), SC_(4.290698214968890417003449585503652329902) },
+ { SC_(38.851287841796875), SC_(4.352722738491573736218790864551080662126) },
+ { SC_(49.46875), SC_(4.59438616262944868606926670858880728888) },
+ { SC_(49.6726531982421875), SC_(4.598500387004538200979463375829093317529) },
+ { SC_(55.821014404296875), SC_(4.715217340185609026248077357993388963859) },
+ { SC_(57.119781494140625), SC_(4.738221040019820009132180121068224048563) },
+ { SC_(60.3798370361328125), SC_(4.793733825338028989056646578701956447074) },
+ { SC_(63.4661865234375), SC_(4.843592376953016901945130034442741537681) },
+ { SC_(63.822418212890625), SC_(4.849190310904695081724453083230505499) },
+ { SC_(64.366424560546875), SC_(4.857678972284480806836897045666147581194) },
+ { SC_(65.82318115234375), SC_(4.880061548144127001309581646898589070845) },
+ { SC_(68.60302734375), SC_(4.921430721025434361496543279369773904556) },
+ { SC_(70.173583984375), SC_(4.944068352080570156852448111271304401145) },
+ { SC_(71.80126953125), SC_(4.967000841791218009854450984654955748527) },
+ { SC_(75.407867431640625), SC_(5.016014824864731856945880331601344083118) },
+ { SC_(75.497711181640625), SC_(5.017205657609766266706283982466292758789) },
+ { SC_(78.06475830078125), SC_(5.050644871655082237287791451581061020693) },
+ { SC_(79.64892578125), SC_(5.070736320140527520131044330827542555678) },
+ { SC_(79.8707275390625), SC_(5.073517411135062274633407326047677797493) },
+ { SC_(82.14324951171875), SC_(5.101574796209937553992594384708408566472) },
+ { SC_(86.422149658203125), SC_(5.152357710985635411723269669070507384393) },
+ { SC_(87.758697509765625), SC_(5.167705692500116617668438212039278403675) },
+ { SC_(94.249420166015625), SC_(5.239063709802807411774762976165711451289) },
+ { SC_(95.002593994140625), SC_(5.24702367651990363562135237922593081374) },
+ { SC_(96.06402587890625), SC_(5.258134994273664228925894855596706922092) },
+ { SC_(99.10101318359375), SC_(5.289261389093961411474730159621540149161) },
+ { SC_(104.825958251953125), SC_(5.345425863147170918152692907733404160171) },
+ { SC_(105.894317626953125), SC_(5.355566478724588805787125327460047194459) },
+ { SC_(106.750244140625), SC_(5.363617180711894834893456209993366372702) },
+ { SC_(109.40167236328125), SC_(5.388152468690488330936438928871930644775) },
+ { SC_(111.295989990234375), SC_(5.40532022596301299871913818031312501789) },
+ { SC_(112.682159423828125), SC_(5.417698597745428582703028438959417637741) },
+ { SC_(115.847869873046875), SC_(5.445406415908932972979361284782173288771) },
+ { SC_(122.518951416015625), SC_(5.501396249028249309478903043850515943644) },
+ { SC_(126.29083251953125), SC_(5.531718947357248141901016725943097821463) },
+ { SC_(127.88677978515625), SC_(5.544277233951786833046255699209839124282) },
+ { SC_(128.29241943359375), SC_(5.547444176085567387868629933507681372844) },
+ { SC_(129.49658203125), SC_(5.556786759298987489018162005929203901677) },
+ { SC_(138.73651123046875), SC_(5.625710723366437130110566517151979116591) },
+ { SC_(139.18450927734375), SC_(5.628934733085021889655473009134778907233) },
+ { SC_(139.9705810546875), SC_(5.63456668505549125187745033695013277031) },
+ { SC_(143.6336669921875), SC_(5.660401141376928390068911580516739480767) },
+ { SC_(149.2176513671875), SC_(5.698541939965667319302405718431306124964) },
+ { SC_(150.61602783203125), SC_(5.707869896181299042045964962097048877529) },
+ { SC_(151.65460205078125), SC_(5.714741890601692470131657476637875234333) },
+ { SC_(154.77532958984375), SC_(5.735111323217677235163096422075933590581) },
+ { SC_(158.9586181640625), SC_(5.76178119164116056169664536557902282984) },
+ { SC_(159.23260498046875), SC_(5.76350337802895912932271749968885321291) },
+ { SC_(166.89166259765625), SC_(5.810483079631769347906173026231591180669) },
+ { SC_(169.22418212890625), SC_(5.824362807770767372309724658583543187687) },
+ { SC_(170.85247802734375), SC_(5.833939098607024938518744061528880726076) },
+ { SC_(175.641845703125), SC_(5.861586030831371111277316749706184493497) },
+ { SC_(176.47808837890625), SC_(5.866335876872543841804521246497450515591) },
+ { SC_(177.0284423828125), SC_(5.869449614294116474831852726381675383803) },
+ { SC_(178.81622314453125), SC_(5.879497954012966336157412623485146460234) },
+ { SC_(181.28570556640625), SC_(5.893213844044450514365554597289542581697) },
+ { SC_(190.84246826171875), SC_(5.944588630523773589353947366401268565142) },
+ { SC_(191.39764404296875), SC_(5.94749352592071287963619396611460598163) },
+ { SC_(194.2606201171875), SC_(5.962341215900494050109187978733428591562) },
+ { SC_(194.89630126953125), SC_(5.965608227627600046293288118981009401155) },
+ { SC_(196.72125244140625), SC_(5.974928484931286802822226328854017998272) },
+ { SC_(196.76788330078125), SC_(5.97516550017620215691682414383193227447) },
+ { SC_(198.0592041015625), SC_(5.981706804024238659640680772319516752432) },
+ { SC_(199.97052001953125), SC_(5.991310884439669647644011374615753552043) },
+ { SC_(202.70001220703125), SC_(6.004868209578553896003834136537443847497) },
+ { SC_(204.95684814453125), SC_(6.015940689286515853596140406483086930665) },
+ { SC_(206.92059326171875), SC_(6.025476453825986378650455090165700700781) },
+ { SC_(211.4588623046875), SC_(6.047172064627678522672151564001319932574) },
+ { SC_(211.6217041015625), SC_(6.047941864223159215142104276243607189411) },
+ { SC_(212.15936279296875), SC_(6.050479329955437674042299338123601544698) },
+ { SC_(219.93341064453125), SC_(6.086466833749718691309844243695794396376) },
+ { SC_(223.34747314453125), SC_(6.101870903204913623855234973179987714517) },
+ { SC_(228.56036376953125), SC_(6.12494274439855238424605675602915271015) },
+ { SC_(229.53656005859375), SC_(6.129204755426344240698049588914342485212) },
+ { SC_(231.15753173828125), SC_(6.136241935513705416652882857399712029477) },
+ { SC_(235.22589111328125), SC_(6.153688953514382528837249519861026992294) },
+ { SC_(237.17108154296875), SC_(6.16192447986332112027066888322817886098) },
+ { SC_(237.904541015625), SC_(6.165012268502458223847465413629334545746) },
+ { SC_(243.202392578125), SC_(6.187036941752031847781237018817248226575) },
+ { SC_(244.296875), SC_(6.191527178125453588013362995547294190556) },
+ { SC_(245.39239501953125), SC_(6.196001570568187444354689455736723305464) },
+ { SC_(245.80389404296875), SC_(6.197677082130341298614824238362609944761) },
+ { SC_(249.68365478515625), SC_(6.213337906126028634019511362668656048871) },
+ { SC_(252.32763671875), SC_(6.223871642756904989009941455863848621693) },
+ { SC_(253.4725341796875), SC_(6.228398760115368978419785861340394334949) },
+ { SC_(264.1583251953125), SC_(6.269692237869834655812588535960729291645) },
+ { SC_(265.867919921875), SC_(6.276143287577458434544566538806340395227) },
+ { SC_(273.893798828125), SC_(6.305884283737175999056149819356227140283) },
+ { SC_(274.060546875), SC_(6.306492908028796208195612980534832526609) },
+ { SC_(274.06298828125), SC_(6.306501816321711306242744764166827854238) },
+ { SC_(275.31201171875), SC_(6.311048924823309539122894248298646711515) },
+ { SC_(281.2171630859375), SC_(6.332271212543191917887016682596127229871) },
+ { SC_(284.3428955078125), SC_(6.343324976847916523668021506516982451804) },
+ { SC_(284.8428955078125), SC_(6.345081883725142172010442438360996090607) },
+ { SC_(287.3035888671875), SC_(6.353683609448095450690653155116609411345) },
+ { SC_(290.8973388671875), SC_(6.366114643735996187010064226141367713494) },
+ { SC_(293.0467529296875), SC_(6.373476431987165195009419682926258568514) },
+ { SC_(293.048583984375), SC_(6.3734826803404046607923256022891007467) },
+ { SC_(296.819091796875), SC_(6.386267177599691603449621482941540136447) },
+ { SC_(297.6572265625), SC_(6.389086936901673374370938395043767464615) },
+ { SC_(308.40625), SC_(6.424562459508494815578189029717236448261) },
+ { SC_(316.5472412109375), SC_(6.450617177370153067374226847837008577358) },
+ { SC_(320.2418212890625), SC_(6.462221144761522067224169792659123404149) },
+ { SC_(322.33642578125), SC_(6.468740575092417615259160797033210213863) },
+ { SC_(323.5101318359375), SC_(6.472375224718483717268648919441488851024) },
+ { SC_(327.8939208984375), SC_(6.485834999462653559161623555380871809288) },
+ { SC_(328.0833740234375), SC_(6.486412623146554512400295875149968123595) },
+ { SC_(328.214599609375), SC_(6.486812521370483270051173204357170113696) },
+ { SC_(332.13916015625), SC_(6.498698952535686590971725425771901435577) },
+ { SC_(339.6888427734375), SC_(6.521175044233962334855405597829204127829) },
+ { SC_(340.171630859375), SC_(6.522595306993372841176959822169835487203) },
+ { SC_(340.22998046875), SC_(6.522766822935215301119395768816736464171) },
+ { SC_(340.9984130859375), SC_(6.525022854134450397488249525584977969848) },
+ { SC_(347.719482421875), SC_(6.544541182598698837108180066568285561192) },
+ { SC_(347.921142578125), SC_(6.545120967585682780158986289403626335039) },
+ { SC_(349.8392333984375), SC_(6.550618853671590396954212923343777795426) },
+ { SC_(353.1812744140625), SC_(6.560126626713879038902701972848577987576) },
+ { SC_(353.3170166015625), SC_(6.560510895819138848557847535694659145744) },
+ { SC_(354.9730224609375), SC_(6.56518699003913475265728787337345634833) },
+ { SC_(355.6412353515625), SC_(6.567067660815945254763768403011524099801) },
+ { SC_(363.193603515625), SC_(6.588081320423385926941395650884632048324) },
+ { SC_(363.7503662109375), SC_(6.589613116365141119507599520545813820205) },
+ { SC_(366.66650390625), SC_(6.597598047275183820713128823864925712214) },
+ { SC_(370.5828857421875), SC_(6.608222493065004674432923629831401595644) },
+ { SC_(371.822998046875), SC_(6.611563301604297330780249554012149222974) },
+ { SC_(375.8822021484375), SC_(6.622421213257872616605790226875280590718) },
+ { SC_(377.1107177734375), SC_(6.625684248051367798967594517111734939065) },
+ { SC_(377.588623046875), SC_(6.626950731244344518396423054010667385835) },
+ { SC_(378.8428955078125), SC_(6.630267034079058832474904688332205765807) },
+ { SC_(379.1123046875), SC_(6.630977920761718188663355128303457269644) },
+ { SC_(381.1038818359375), SC_(6.636217452968849140199299619634845177402) },
+ { SC_(382.1112060546875), SC_(6.63885714989915892916806173377813464616) },
+ { SC_(382.9927978515625), SC_(6.641161660644278254856011296094169025726) },
+ { SC_(387.1845703125), SC_(6.652047018118426624071335253039983067027) },
+ { SC_(389.669921875), SC_(6.658445560711747733097363184134660374201) },
+ { SC_(389.804443359375), SC_(6.658790721334144459483338624834811878532) },
+ { SC_(396.3114013671875), SC_(6.675345858154136306174834824525273599533) },
+ { SC_(397.005126953125), SC_(6.677094789236718239327386065258295745882) },
+ { SC_(397.1934814453125), SC_(6.677569116668089765968288575699796076917) },
+ { SC_(397.8046875), SC_(6.679106750673113062518913783394959687397) },
+ { SC_(398.8426513671875), SC_(6.681712590609844816466059398426090860379) },
+ { SC_(399.1663818359375), SC_(6.682523938576487571986006995202709018951) },
+ { SC_(399.2547607421875), SC_(6.682745323455160373493982153327465350514) },
+ { SC_(400.33984375), SC_(6.68545941647717813159478393220239518843) },
+ { SC_(403.9578857421875), SC_(6.6944562778394978005276529277337054901) },
+ { SC_(404.279541015625), SC_(6.69525222285407608719250824812439781544) },
+ { SC_(405.0574951171875), SC_(6.697174677114241660699777628750006369949) },
+ { SC_(407.328125), SC_(6.702764738337774266407206003201536960489) },
+ { SC_(407.547119140625), SC_(6.703302231179959306927821131625588949855) },
+ { SC_(410.5994873046875), SC_(6.710763953621196143396177253879091429692) },
+ { SC_(410.8016357421875), SC_(6.711256159037372934708585809074885390587) },
+ { SC_(411.129638671875), SC_(6.712054288828398871484168355341928910672) },
+ { SC_(411.9053955078125), SC_(6.71393940750234669898410033879058990879) },
+ { SC_(415.5833740234375), SC_(6.722828986708716597641935076657699092718) },
+ { SC_(417.669189453125), SC_(6.727835453862131466839432640652077316451) },
+ { SC_(420.517822265625), SC_(6.734632628835640647510302384260878716087) },
+ { SC_(424.3853759765625), SC_(6.743787740494532100937084679719803238806) },
+ { SC_(424.7154541015625), SC_(6.744565219553757289338296980369793898726) },
+ { SC_(436.3419189453125), SC_(6.771572021268065472972105624143419455948) },
+ { SC_(438.501953125), SC_(6.776510146304200360440233381235270942742) },
+ { SC_(439.3369140625), SC_(6.778412462065226061129312213528458641603) },
+ { SC_(445.5606689453125), SC_(6.792479340600349658156225315328718026016) },
+ { SC_(452.9901123046875), SC_(6.809016260337228831936738732897410136218) },
+ { SC_(453.77490234375), SC_(6.810747231716348697176150895548602377257) },
+ { SC_(456.7745361328125), SC_(6.817335895109250694056391088138248559173) },
+ { SC_(457.9520263671875), SC_(6.819910421197310978529029433663908470507) },
+ { SC_(458.6795654296875), SC_(6.821497844004013502448409287800537132756) },
+ { SC_(460.5164794921875), SC_(6.825494642872147128332763285398798677976) },
+ { SC_(461.8717041015625), SC_(6.828433164406686771701521855077910926631) },
+ { SC_(464.7025146484375), SC_(6.834543470287694007429787493802694241702) },
+ { SC_(467.0626220703125), SC_(6.839609377592375029558701051277174984946) },
+ { SC_(467.0712890625), SC_(6.83962793384421245687931998241985864452) },
+ { SC_(470.096923828125), SC_(6.846084943645238808995975141700921096311) },
+ { SC_(475.1607666015625), SC_(6.856799276049143563229337105263608232029) },
+ { SC_(477.5537109375), SC_(6.861822721577315741859023908594798480392) },
+ { SC_(478.626220703125), SC_(6.864066049482580522441871176709541953581) },
+ { SC_(478.7958984375), SC_(6.8644204973336804815313774177052514308) },
+ { SC_(479.6864013671875), SC_(6.86627865397306926299976132455469132911) },
+ { SC_(479.7867431640625), SC_(6.866487814627139251181098007832885765806) },
+ { SC_(479.9122314453125), SC_(6.866749331118839213169502276407114725047) },
+ { SC_(482.4793701171875), SC_(6.872084270243208288559827917865564857217) },
+ { SC_(482.5181884765625), SC_(6.872164723177874204251489651336382789811) },
+ { SC_(483.8797607421875), SC_(6.874982560453873383658251901541786496761) },
+ { SC_(484.4649658203125), SC_(6.876191234145179554349993597841191267853) },
+ { SC_(485.3258056640625), SC_(6.877966548833207350351265217595172972905) },
+ { SC_(490.57373046875), SC_(6.888721726428236039221890401406352667404) },
+ { SC_(493.7423095703125), SC_(6.895159895589969853078001763235883415882) },
+ { SC_(494.272216796875), SC_(6.896232568812717932403585431953843090099) },
+ { SC_(496.44775390625), SC_(6.900624415355815565025217006388610220335) },
+ { SC_(497.0401611328125), SC_(6.901816998553274960978831433918910814375) },
+ { SC_(498.234130859375), SC_(6.904216282287646841845864948036717548583) },
+ { SC_(665.0791015625), SC_(7.193052598670792558912351099032198333184) },
+ { SC_(1170.29150390625), SC_(7.758155143419731595147190189684865359835) },
+ { SC_(2058.7958984375), SC_(8.323023697145112010072186763207801515396) },
+ { SC_(5824.533203125), SC_(9.362981311610990187535171280837584820237) },
+ { SC_(9114.30859375), SC_(9.810748008110925084589570791503788344652) },
+ { SC_(31388.40625), SC_(11.04734105631420306080680845572519805956) },
+ { SC_(53732.765625), SC_(11.58492543551253544550738607240822985131) },
+ { SC_(117455.09375), SC_(12.3669585392073964063765790447351364021) },
+ { SC_(246210.625), SC_(13.10708982832787479175510220013343945066) },
+ { SC_(513670.125), SC_(13.84248373881161892648765606597953800527) },
+ { SC_(788353.25), SC_(14.2708487357510805583139091933979145572) },
+ { SC_(1736171), SC_(15.06033985221540896276800056693696357419) },
+ { SC_(3770530), SC_(15.83587331365755605568701554508826253991) },
+ { SC_(4344090), SC_(15.97747403917326507392988269405762331118) },
+ { SC_(11419360), SC_(16.94396789915014469006155507384872743685) },
+ { SC_(31023240), SC_(17.9433943395609684013300439026124645108) },
+ { SC_(40665424), SC_(18.21403593674543079149440340324547029148) },
+ { SC_(129788064), SC_(19.37456058170921543648305825985098346634) },
+ { SC_(225668224), SC_(19.9277236237785460971743917048171789264) },
+ { SC_(450631936), SC_(20.61930863840059519949232655148142693395) },
+ { SC_(750941952), SC_(21.1299860930266968673735341410555546727) },
+ { SC_(1887358976), SC_(22.05159150215413004649732665310838648331) },
+ { SC_(3738011648), SC_(22.73496684263974142690946105862900518113) },
+ { SC_(7486695424), SC_(23.42954051928097083366085869187241049078) },
+ { SC_(12668080128), SC_(23.95549847139166892348970713379911103008) },
+ { SC_(23918272512), SC_(24.59105572458284785473015955570721968617) },
+ { SC_(48862560256), SC_(25.30542448179939429678484289438720749573) },
+ { SC_(113763549184), SC_(26.15053518194943663075151882301281675861) },
+ { SC_(161334755328), SC_(26.49989444953256419131899378956019192586) },
+ { SC_(321933279232), SC_(27.19075733422631778452130090694771384112) },
+ { SC_(715734122496), SC_(27.98972177820814613504868209029528272152) },
+ { SC_(1875817529344), SC_(28.95321287653379863631300659442341812344) }
+ }};
+#undef SC_
+

Added: sandbox/math_toolkit/libs/math/test/asinh_data.ipp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/test/asinh_data.ipp 2008-08-20 07:02:05 EDT (Wed, 20 Aug 2008)
@@ -0,0 +1,286 @@
+#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+ static const boost::array<boost::array<T, 2>, 281> asinh_data = {{
+ { SC_(-497.181640625), SC_(-6.902103625349694816896128061929344488774) },
+ { SC_(-495.216552734375), SC_(-6.898143347143858285101511567975488446084) },
+ { SC_(-488.0980224609375), SC_(-6.883664481302669222996695409880306523751) },
+ { SC_(-486.4609375), SC_(-6.880304842490272781295755933349565066089) },
+ { SC_(-482.2261962890625), SC_(-6.87156154650904602462361416438487324277) },
+ { SC_(-468.167236328125), SC_(-6.841973895837549314760586943747302390125) },
+ { SC_(-465.553955078125), SC_(-6.836376331805492593765664636569933371943) },
+ { SC_(-464.288330078125), SC_(-6.833654100575195198545828306587445927099) },
+ { SC_(-463.558837890625), SC_(-6.832081663500904935919737735423649299577) },
+ { SC_(-453.82861328125), SC_(-6.81086801736630853656142245668310545817) },
+ { SC_(-448.7835693359375), SC_(-6.799689165151486910757237507031024212372) },
+ { SC_(-446.0499267578125), SC_(-6.793579326246197169098958913912928750651) },
+ { SC_(-432.4046630859375), SC_(-6.762510387544996144846476710732722287747) },
+ { SC_(-424.145751953125), SC_(-6.74322572098922178423984261142063288429) },
+ { SC_(-402.8682861328125), SC_(-6.69175839599430693315848859453612846314) },
+ { SC_(-402.4595947265625), SC_(-6.690743430063694316478378930442947372479) },
+ { SC_(-390.1383056640625), SC_(-6.65965012921145083591836824643494979965) },
+ { SC_(-387.5355224609375), SC_(-6.652956360641761371501126846246743833405) },
+ { SC_(-381.0023193359375), SC_(-6.635954365364266311169729037072694814964) },
+ { SC_(-374.8172607421875), SC_(-6.619587562578274050554380148151080691039) },
+ { SC_(-374.1033935546875), SC_(-6.617681179427804403332414367961774779791) },
+ { SC_(-373.01318359375), SC_(-6.614762741096184771534770781005436075363) },
+ { SC_(-370.0938720703125), SC_(-6.606905687537060691122483933557635629252) },
+ { SC_(-364.5230712890625), SC_(-6.591738907156093293807291816593779744849) },
+ { SC_(-361.3756103515625), SC_(-6.583066984213974024130269349536598335519) },
+ { SC_(-358.1136474609375), SC_(-6.573999516974134646764605942478671320562) },
+ { SC_(-350.8861083984375), SC_(-6.553610904389895936746972395658913458292) },
+ { SC_(-350.7060546875), SC_(-6.553097634736137347416591397792124912806) },
+ { SC_(-345.5616455078125), SC_(-6.538320325468201861196672683728074373679) },
+ { SC_(-342.386962890625), SC_(-6.529090881007076202584033383216307968614) },
+ { SC_(-341.9425048828125), SC_(-6.527791927233787108981347318463639017897) },
+ { SC_(-337.3883056640625), SC_(-6.51438388615078099259979168949837683455) },
+ { SC_(-328.8133544921875), SC_(-6.488639771044976384845381893407049569445) },
+ { SC_(-326.1348876953125), SC_(-6.480460592697476652284072277108613530788) },
+ { SC_(-313.12744140625), SC_(-6.439759999015992467577771895808599408942) },
+ { SC_(-311.6180419921875), SC_(-6.434927968512049412470577925892037200619) },
+ { SC_(-303.40478515625), SC_(-6.408217734896572191669656774970329190625) },
+ { SC_(-291.9320068359375), SC_(-6.369671035834964490622480119650197877027) },
+ { SC_(-289.791015625), SC_(-6.362310184909174825124230502026784750431) },
+ { SC_(-288.07568359375), SC_(-6.356373428913315483326002974850146028147) },
+ { SC_(-282.76220703125), SC_(-6.337756593913613854161781726501299103316) },
+ { SC_(-278.9659423828125), SC_(-6.3242400970614694374776334482330766038) },
+ { SC_(-276.1881103515625), SC_(-6.314232650754295158800596164826483845909) },
+ { SC_(-269.843994140625), SC_(-6.290994606392703105943420882029653368811) },
+ { SC_(-256.47509765625), SC_(-6.240182555852785458496224304526376585373) },
+ { SC_(-248.91619873046875), SC_(-6.210267503979360726887449195178911415313) },
+ { SC_(-245.71783447265625), SC_(-6.197335184435549180000272192577714732671) },
+ { SC_(-244.9049072265625), SC_(-6.194021350132334791819182281057947070343) },
+ { SC_(-242.49176025390625), SC_(-6.184119163536405964259882205805060501935) },
+ { SC_(-223.97491455078125), SC_(-6.104686221071835053635371385862353306867) },
+ { SC_(-223.0770263671875), SC_(-6.100669325836893543736746195548392269128) },
+ { SC_(-221.50177001953125), SC_(-6.093582856519022569016903564242082589239) },
+ { SC_(-214.1610107421875), SC_(-6.059880750068793807232821057354816859259) },
+ { SC_(-202.9705810546875), SC_(-6.006214296526251845395554109089589227751) },
+ { SC_(-200.1683349609375), SC_(-5.992312107336994557313003250781997964749) },
+ { SC_(-198.0869140625), SC_(-5.981859446096082920408103292664994574137) },
+ { SC_(-191.8330078125), SC_(-5.949779216585290285138095990044779123562) },
+ { SC_(-183.4495849609375), SC_(-5.905094497458789993605346377453537455651) },
+ { SC_(-182.9005126953125), SC_(-5.90209701227578839648368537690039781634) },
+ { SC_(-167.5517578125), SC_(-5.814448391006795100253762785669751772879) },
+ { SC_(-162.87738037109375), SC_(-5.786154254111213380715127555746974140457) },
+ { SC_(-159.6142578125), SC_(-5.765917008989404365321507899157382728927) },
+ { SC_(-150.01629638671875), SC_(-5.703902219845273396365649927451080691209) },
+ { SC_(-148.34051513671875), SC_(-5.69266895044603959347064515800579166058) },
+ { SC_(-147.23760986328125), SC_(-5.685206387751923160853276372644826819905) },
+ { SC_(-143.65484619140625), SC_(-5.660572815631807047475426769799365771506) },
+ { SC_(-138.70599365234375), SC_(-5.625516713960632970798501811037458042606) },
+ { SC_(-119.554168701171875), SC_(-5.476934234171878793825519703714137456694) },
+ { SC_(-118.441558837890625), SC_(-5.467584665632571047898569146378815818543) },
+ { SC_(-112.7041015625), SC_(-5.41793267560343365856590869885928647495) },
+ { SC_(-111.430206298828125), SC_(-5.406565756574078635952822819651240567772) },
+ { SC_(-107.772979736328125), SC_(-5.373195678988387579981120804358907493552) },
+ { SC_(-107.6795654296875), SC_(-5.372328571218373638952712194621628880899) },
+ { SC_(-105.091796875), SC_(-5.348004040102252742967063201190196082691) },
+ { SC_(-101.261474609375), SC_(-5.310877589708960332430067923458969169195) },
+ { SC_(-95.79150390625), SC_(-5.255348419702703704863588329233038165262) },
+ { SC_(-91.26885986328125), SC_(-5.206986845736275651134721240774128212633) },
+ { SC_(-87.33349609375), SC_(-5.162914035396618398952584430311544798966) },
+ { SC_(-78.238739013671875), SC_(-5.052952927749896114494197793427686940384) },
+ { SC_(-77.912353515625), SC_(-5.048772883924985058524898899156261070079) },
+ { SC_(-76.83489990234375), SC_(-5.03484848764480888947313271747141240657) },
+ { SC_(-61.255645751953125), SC_(-4.808269821238498732397629948430226353629) },
+ { SC_(-54.4138031005859375), SC_(-4.689849459883310559788337051110370703783) },
+ { SC_(-43.967193603515625), SC_(-4.476720236388958724591705984989483327501) },
+ { SC_(-42.0108489990234375), SC_(-4.431216695067421800858619793836241888979) },
+ { SC_(-30.609375), SC_(-4.114720236218123790586146467787932912866) },
+ { SC_(-26.7111663818359375), SC_(-3.978579083165602241813343216612781617222) },
+ { SC_(-25.2413177490234375), SC_(-3.922021583095348294972916890287113874009) },
+ { SC_(-14.624359130859375), SC_(-3.377002632462029261128559390722023174755) },
+ { SC_(-12.431087493896484375), SC_(-3.214961448471211148851788664569558466737) },
+ { SC_(-10.235607147216796875), SC_(-3.021397455139020950019259089284989476735) },
+ { SC_(-9.41094970703125), SC_(-2.937831931335705068892682801940661221814) },
+ { SC_(-1.635939121246337890625), SC_(-1.267878515574958901161281414987746394126) },
+ { SC_(0.165048140085555239409131900174543261528e-11), SC_(0.1650481400855552394091318252402434490969e-11) },
+ { SC_(0.2065420751096169738048047292977571487427e-11), SC_(0.2065420751096169738048045824476195851805e-11) },
+ { SC_(0.6933230031758164102484442992135882377625e-11), SC_(0.6933230031758164102484387445779249960378e-11) },
+ { SC_(0.1335144494962747785393730737268924713135e-10), SC_(0.1335144494962747785393691069885154254178e-10) },
+ { SC_(0.1639981206391638579589198343455791473389e-10), SC_(0.1639981206391638579589124830249793630233e-10) },
+ { SC_(0.5730159402528300915946601890027523040771e-10), SC_(0.5730159402528300915943466086387879674642e-10) },
+ { SC_(0.1113731329382972035091370344161987304688e-9), SC_(0.1113731329382972035089067894949093881495e-9) },
+ { SC_(0.1421470718909745301061775535345077514648e-9), SC_(0.1421470718909745301056988545527660628072e-9) },
+ { SC_(0.3800632031314421510614920407533645629883e-9), SC_(0.3800632031314421510523421433949182208556e-9) },
+ { SC_(0.6091627202664540163823403418064117431641e-9), SC_(0.6091627202664540163446657373156062782485e-9) },
+ { SC_(0.1022164131114777774200774729251861572266e-8), SC_(0.1022164131114777774022778557990306872369e-8) },
+ { SC_(0.2881922256392499548383057117462158203125e-8), SC_(0.2881922256392499544393767813667092771012e-8) },
+ { SC_(0.4762776839584148547146469354629516601563e-8), SC_(0.476277683958414852913996340565203355397e-8) },
+ { SC_(0.8854133426439148024655878543853759765625e-8), SC_(0.8854133426439147908968245283871083240172e-8) },
+ { SC_(0.2305032609228874207474291324615478515625e-7), SC_(0.2305032609228874003356918102983865074646e-7) },
+ { SC_(0.593924909253473742865025997161865234375e-7), SC_(0.5939249092534733936898428443727569533982e-7) },
+ { SC_(0.116676488914890796877443790435791015625e-6), SC_(0.1166764889148905321500984793498641255822e-6) },
+ { SC_(0.23799674409019644372165203094482421875e-6), SC_(0.2379967440901941969351979802846104416105e-6) },
+ { SC_(0.468465941594331525266170501708984375e-6), SC_(0.4684659415943143903171559983024977629855e-6) },
+ { SC_(0.938269977268646471202373504638671875e-6), SC_(0.9382699772685088034539126253793231155849e-6) },
+ { SC_(0.11039855962735600769519805908203125e-5), SC_(0.1103985596273335823585612314642277768255e-5) },
+ { SC_(0.3291776010883040726184844970703125e-5), SC_(0.3291776010877095894302224300936487731914e-5) },
+ { SC_(0.7517213816754519939422607421875e-5), SC_(0.7517213816683722188794989550887653607132e-5) },
+ { SC_(0.1511466689407825469970703125e-4), SC_(0.1511466689350275580917503171217159502838e-4) },
+ { SC_(0.2986399340443313121795654296875e-4), SC_(0.2986399339999405714013629488236926241004e-4) },
+ { SC_(0.338702811859548091888427734375e-4), SC_(0.3387028117947883430533095948345065139191e-4) },
+ { SC_(0.906601198948919773101806640625e-4), SC_(0.906601197706988351306957830965994124706e-4) },
+ { SC_(0.0002194953267462551593780517578125), SC_(0.0002194953249837736286256750985648679367941) },
+ { SC_(0.000439521507360041141510009765625), SC_(0.0004395214932089767739989257698158711437628) },
+ { SC_(0.000633315183222293853759765625), SC_(0.0006333151408864353233898099984279240916971) },
+ { SC_(0.0011151232756674289703369140625), SC_(0.001115123044558274291478926657905120008324) },
+ { SC_(0.001962467096745967864990234375), SC_(0.001962465837080717523701980763915077400694) },
+ { SC_(0.00555375404655933380126953125), SC_(0.005553725496786973429128982795141683132844) },
+ { SC_(0.0086911283433437347412109375), SC_(0.008691018931968293864799414130929206833958) },
+ { SC_(0.0299333631992340087890625), SC_(0.02992889492062483965221469264905787460865) },
+ { SC_(0.05124260485172271728515625), SC_(0.05122020579778826952521305025815121247091) },
+ { SC_(0.1120129525661468505859375), SC_(0.1117800293787827963417928974597546321371) },
+ { SC_(0.23480379581451416015625), SC_(0.2326980652154337550758180136962670174127) },
+ { SC_(0.48987305164337158203125), SC_(0.4721357117742938088066477027937692054202) },
+ { SC_(0.7518312931060791015625), SC_(0.6946115711893359819020679952345318169567) },
+ { SC_(1.6557407379150390625), SC_(1.278160734826225530236928993772347284054) },
+ { SC_(3.59585666656494140625), SC_(1.991726234324511503262116200593118895023) },
+ { SC_(3.66270542144775390625), SC_(2.009484184971721909158848583710336926639) },
+ { SC_(4.14284515380859375), SC_(2.128787712416204967344704932367445907457) },
+ { SC_(5.957065582275390625), SC_(2.484696793415547705602607297785951657088) },
+ { SC_(10.890350341796875), SC_(3.083125584533294091723482211217314707631) },
+ { SC_(27.3714599609375), SC_(4.002981567623351049359177787856924686562) },
+ { SC_(29.58606719970703125), SC_(4.080736210902825878904303085045024018186) },
+ { SC_(30.79753875732421875), SC_(4.12084543001111324730244006549246292804) },
+ { SC_(38.7815704345703125), SC_(4.351258506393415652318140630603706518075) },
+ { SC_(46.8814849853515625), SC_(4.540883728536112674069796475595291204506) },
+ { SC_(47.21551513671875), SC_(4.547981853382592216976253569088895438026) },
+ { SC_(47.2205810546875), SC_(4.548089117076700023837192332723136228729) },
+ { SC_(49.7236175537109375), SC_(4.599728302509060806991933759403338520635) },
+ { SC_(61.557464599609375), SC_(4.813184271185753146544327202950243752583) },
+ { SC_(67.821624755859375), SC_(4.910082619934557664814376219665476353171) },
+ { SC_(68.823638916015625), SC_(4.924747230639766605446150280099353765226) },
+ { SC_(73.754669189453125), SC_(4.993937439635390959095430118863527649672) },
+ { SC_(80.956695556640625), SC_(5.087099712053553781191118720872632390369) },
+ { SC_(85.264068603515625), SC_(5.138934697019629394937832600298516485788) },
+ { SC_(85.2677001953125), SC_(5.138977285472120998185283011836704311053) },
+ { SC_(92.8238525390625), SC_(5.223879832616765332217842454967156441878) },
+ { SC_(94.503570556640625), SC_(5.241812789460326774676763952219373084611) },
+ { SC_(116.044677734375), SC_(5.447141014648796298911597081177174321311) },
+ { SC_(123.775543212890625), SC_(5.511633288238573314525515498135556594256) },
+ { SC_(132.3592529296875), SC_(5.578681289305597653175233933020307342597) },
+ { SC_(139.7633056640625), SC_(5.633110296634630769495301352527335620124) },
+ { SC_(143.9609375), SC_(5.662701238627724704458477126104574527542) },
+ { SC_(146.31298828125), SC_(5.67890694100532316423025711195756179793) },
+ { SC_(155.0980224609375), SC_(5.737214893086865588590011960998256979258) },
+ { SC_(155.47784423828125), SC_(5.739660763047893353413979379888554852015) },
+ { SC_(155.74066162109375), SC_(5.741349685869528141606229427222705529931) },
+ { SC_(163.60546875), SC_(5.790614371552514063824117620171866397141) },
+ { SC_(178.735107421875), SC_(5.879059869096351492478036425245903640013) },
+ { SC_(179.70269775390625), SC_(5.884458728291027196042299574564237490922) },
+ { SC_(179.81976318359375), SC_(5.885109945587401516601219374963261030511) },
+ { SC_(181.3594970703125), SC_(5.893636014368935823237345043968331464439) },
+ { SC_(194.82861328125), SC_(5.965274032538233309914029311001854910366) },
+ { SC_(195.23284912109375), SC_(5.967346683696556361432840609074921098744) },
+ { SC_(199.07666015625), SC_(5.986843466070591664424697234367005123532) },
+ { SC_(205.77423095703125), SC_(6.019932686217941432444903969630541836634) },
+ { SC_(206.04608154296875), SC_(6.021252909681260874009121058600710829746) },
+ { SC_(209.36480712890625), SC_(6.037231102920488838374618484909263149999) },
+ { SC_(210.703857421875), SC_(6.043606439928323259236771869386592943524) },
+ { SC_(215.2139892578125), SC_(6.064785410115010353953388909263073452906) },
+ { SC_(225.83892822265625), SC_(6.112974120371601210219399663570367666925) },
+ { SC_(226.95465087890625), SC_(6.117902255760310722524206309196088056026) },
+ { SC_(232.79864501953125), SC_(6.143325688959409019088830019463644651492) },
+ { SC_(240.647216796875), SC_(6.176483527820343060796486861138751990657) },
+ { SC_(243.1324462890625), SC_(6.186757751007361577528719065211514303001) },
+ { SC_(251.26702880859375), SC_(6.219667373726848075772693817688242362523) },
+ { SC_(253.72906494140625), SC_(6.22941808808355428724031065923268579187) },
+ { SC_(254.6866455078125), SC_(6.233184983047428276974209254934385269649) },
+ { SC_(257.2001953125), SC_(6.243005711460191965779748682542918291165) },
+ { SC_(257.7401123046875), SC_(6.245102704489326829989715358050375153164) },
+ { SC_(261.731201171875), SC_(6.260468857392133508067336988271711266899) },
+ { SC_(263.75), SC_(6.268152459140511369534885468430435001253) },
+ { SC_(265.5167236328125), SC_(6.27482855458316535698354618677862660051) },
+ { SC_(273.9171142578125), SC_(6.305976070434008107321296347063621346142) },
+ { SC_(278.897705078125), SC_(6.323995460699820076921115676535829705602) },
+ { SC_(279.167236328125), SC_(6.324961403980196616927106861416582346957) },
+ { SC_(292.207275390625), SC_(6.370613506132747051155136954016356169709) },
+ { SC_(293.5975341796875), SC_(6.375359978930308922973172601759003753776) },
+ { SC_(293.9749755859375), SC_(6.37664472001459930030121377025213179339) },
+ { SC_(295.1998291015625), SC_(6.380802563199264354475951774362027757146) },
+ { SC_(297.2799072265625), SC_(6.387824152942428878634062028172724987619) },
+ { SC_(297.9285888671875), SC_(6.390003820200830500292592492268074658657) },
+ { SC_(298.1058349609375), SC_(6.390598568067900196600610103133530143627) },
+ { SC_(300.2803955078125), SC_(6.397866642974941387667911791807820745523) },
+ { SC_(307.531005859375), SC_(6.421725738171607321147138767579512701297) },
+ { SC_(308.1754150390625), SC_(6.423818963102848059254801023392818581651) },
+ { SC_(309.7344970703125), SC_(6.42886525591175973950489819292419777646) },
+ { SC_(314.2847900390625), SC_(6.443449261058926842539512498259875923692) },
+ { SC_(314.7236328125), SC_(6.444844602076255234209250709648120853169) },
+ { SC_(320.8406982421875), SC_(6.464094341970106436820739729174428145587) },
+ { SC_(321.2459716796875), SC_(6.465356699668166045068069215854964871388) },
+ { SC_(321.9031982421875), SC_(6.467400466944124604717633061439316010097) },
+ { SC_(323.457763671875), SC_(6.472218114936839319482664927965675017022) },
+ { SC_(330.82861328125), SC_(6.494749921382326159049677218709809728653) },
+ { SC_(335.008544921875), SC_(6.507305446835735629461798195367913785079) },
+ { SC_(340.7171630859375), SC_(6.52420203343567514995053263208100130883) },
+ { SC_(348.4677734375), SC_(6.546694993078936223411278280975538973745) },
+ { SC_(349.1292724609375), SC_(6.548591493378012538030220208753185699103) },
+ { SC_(372.4288330078125), SC_(6.613194950203131899741436452253747959432) },
+ { SC_(376.7574462890625), SC_(6.624750543633906159543027563737013064495) },
+ { SC_(378.4306640625), SC_(6.629181796246806383589594972543857520438) },
+ { SC_(390.9031982421875), SC_(6.661608771130218794653929942801159149921) },
+ { SC_(405.7918701171875), SC_(6.698989091751706872771950506377356853297) },
+ { SC_(407.3646240234375), SC_(6.702857353572475083661986001523177171689) },
+ { SC_(413.3758544921875), SC_(6.717505881986416333938861696792809072989) },
+ { SC_(415.7354736328125), SC_(6.723197804327891152771611004762978333262) },
+ { SC_(417.193603515625), SC_(6.726699007993022779613295744938090059081) },
+ { SC_(420.874755859375), SC_(6.735483889307782773060913517308358177287) },
+ { SC_(429.2635498046875), SC_(6.755219602793124098109976875531119009337) },
+ { SC_(429.756103515625), SC_(6.756366380816258251898421006493740831209) },
+ { SC_(433.9931640625), SC_(6.766177290841292993057892254025351144187) },
+ { SC_(434.0106201171875), SC_(6.766217511883345263895227495273810179399) },
+ { SC_(440.073974609375), SC_(6.780091308338912469861271641540800609593) },
+ { SC_(450.2220458984375), SC_(6.802889310303153472760070274877750654792) },
+ { SC_(455.017578125), SC_(6.813484439494547291485100306142865313692) },
+ { SC_(457.1668701171875), SC_(6.818196843455478403993903909497663695391) },
+ { SC_(457.5068359375), SC_(6.818940201487998386877795327256997263141) },
+ { SC_(459.2913818359375), SC_(6.822833193143804950038640831090638344206) },
+ { SC_(459.492431640625), SC_(6.823270835445770195995146570284994476855) },
+ { SC_(459.743896484375), SC_(6.823817951018000432957797403476399271545) },
+ { SC_(464.888427734375), SC_(6.834945773756887582002201745232432180165) },
+ { SC_(464.96630859375), SC_(6.835113285253827054382848168952118996735) },
+ { SC_(467.6949462890625), SC_(6.840964582694129262617973631406633110533) },
+ { SC_(468.86767578125), SC_(6.843468905210339769583953244362473799296) },
+ { SC_(470.5927734375), SC_(6.847141429556456346098564888170408445454) },
+ { SC_(481.109619140625), SC_(6.869243403190376592226057897975831923528) },
+ { SC_(487.4595947265625), SC_(6.882355637062963925878474710879054534122) },
+ { SC_(488.521484375), SC_(6.884531678915821025400961463061609241284) },
+ { SC_(492.8812255859375), SC_(6.893416432937340181639026008051884214636) },
+ { SC_(494.0684814453125), SC_(6.895822338701104787981876142689381248646) },
+ { SC_(496.4613037109375), SC_(6.900653737167637608469868350257964416187) },
+ { SC_(716.154052734375), SC_(7.2670429692740963323840103680788401489) },
+ { SC_(1799.92578125), SC_(8.18864796812207220842639194214816612374) },
+ { SC_(3564.845703125), SC_(8.872023251113288479644702153534943187411) },
+ { SC_(7139.869140625), SC_(9.566596912986166722124065953497502737374) },
+ { SC_(12081.22265625), SC_(10.09255486190560839163513867694963651638) },
+ { SC_(22810.2421875), SC_(10.72811211386442708825132311411659945728) },
+ { SC_(46598.96875), SC_(11.44248087071561781484413254045580909559) },
+ { SC_(108493.375), SC_(12.2875915707717694181967755881243802905) },
+ { SC_(153860.8125), SC_(12.63695083834421849044542638165059455958) },
+ { SC_(307019.5), SC_(13.32781372303006380727775468144124321804) },
+ { SC_(682577.25), SC_(14.12677816700977652906247822629132152831) },
+ { SC_(1788919), SC_(15.09026926533497056732451999718664988024) },
+ { SC_(3769169), SC_(15.83551229128394411859348316953904317643) },
+ { SC_(4327820), SC_(15.97372168955474121405849637207319473463) },
+ { SC_(11044024), SC_(16.91054720571544732784968725481341574805) },
+ { SC_(21423208), SC_(17.57313255890322504472542433762806340181) },
+ { SC_(62828288), SC_(18.64906315643796382994112822618240813581) },
+ { SC_(70207360), SC_(18.7601108873651530393019317938988457707) },
+ { SC_(154231424), SC_(19.54711196618087428636344348941647974165) },
+ { SC_(294509056), SC_(20.1939674915675244205666343569672677746) },
+ { SC_(1070557184), SC_(21.48459226315622322979093631189365864251) },
+ { SC_(1957922816), SC_(22.08829714102155481686957732827526425736) },
+ { SC_(3912507392), SC_(22.78059146269991677250675041832419710247) },
+ { SC_(7279233024), SC_(23.40143852031869095098313030835785443555) },
+ { SC_(9665245184), SC_(23.68494949808078517275225570625127768937) },
+ { SC_(22627590144), SC_(24.53558298204260156687347955127694595939) },
+ { SC_(60601991168), SC_(25.52074076759958328225601044752066239618) },
+ { SC_(134018236416), SC_(26.31438890085421876104087786768111623882) },
+ { SC_(204864946176), SC_(26.73876398039978985836947169876252884996) },
+ { SC_(284346286080), SC_(27.06660583008717947194092254982253381033) },
+ { SC_(914576637952), SC_(28.23487428494463574299686107465880501208) },
+ { SC_(1581915832320), SC_(28.7828049610810604762091293247739091717) }
+ }};
+#undef SC_
+

Added: sandbox/math_toolkit/libs/math/test/atanh_data.ipp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/test/atanh_data.ipp 2008-08-20 07:02:05 EDT (Wed, 20 Aug 2008)
@@ -0,0 +1,265 @@
+#define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+ static const boost::array<boost::array<T, 2>, 260> atanh_data = {{
+ { SC_(-0.9999983310699462890625), SC_(-6.998237084679026894944012639589359039154) },
+ { SC_(-0.9999978542327880859375), SC_(-6.872579751329170618373487147465365112113) },
+ { SC_(-0.999992847442626953125), SC_(-6.270592097465752658938563627507298840894) },
+ { SC_(-0.999986171722412109375), SC_(-5.94096761408481303343713262973790932529) },
+ { SC_(-0.9999828338623046875), SC_(-5.832855225378502201556044619092381320613) },
+ { SC_(-0.99993991851806640625), SC_(-5.206463012087559958576821359878019831698) },
+ { SC_(-0.9998834133148193359375), SC_(-4.874982184181078415951979525893507005727) },
+ { SC_(-0.9998509883880615234375), SC_(-4.752279497280337973604777810710354182427) },
+ { SC_(-0.9996016025543212890625), SC_(-4.260504202858904159948511594799808172686) },
+ { SC_(-0.9993612766265869140625), SC_(-4.024433435320311666223352267171267188441) },
+ { SC_(-0.9989283084869384765625), SC_(-3.765564108299923386710499391156429825334) },
+ { SC_(-0.996978282928466796875), SC_(-3.246782610980921221976121268600437559073) },
+ { SC_(-0.9950058460235595703125), SC_(-2.995067117994093910327278839368162513171) },
+ { SC_(-0.9942638874053955078125), SC_(-2.925624274960953689217686505461794222524) },
+ { SC_(-0.9907157421112060546875), SC_(-2.683964628330836423435761449812536808992) },
+ { SC_(-0.990334033966064453125), SC_(-2.663723350226517894297444398633783948406) },
+ { SC_(-0.9760982990264892578125), SC_(-2.207464998348322224447911930881940831481) },
+ { SC_(-0.975830078125), SC_(-2.201817459680555978821333155035293326746) },
+ { SC_(-0.972824573516845703125), SC_(-2.142454230829143642120980722087236052917) },
+ { SC_(-0.964355945587158203125), SC_(-2.004668675602091699628236313728557407114) },
+ { SC_(-0.9377224445343017578125), SC_(-1.718833734617706500332405835370646660471) },
+ { SC_(-0.936240673065185546875), SC_(-1.706694048256515431631815885672233674251) },
+ { SC_(-0.9310147762298583984375), SC_(-1.665954300553314591750124550883856364694) },
+ { SC_(-0.9284839630126953125), SC_(-1.647283871876074775612635961977408037529) },
+ { SC_(-0.92702484130859375), SC_(-1.636806734088156154435563850211913111601) },
+ { SC_(-0.907566547393798828125), SC_(-1.513547347731111539787447924356304439238) },
+ { SC_(-0.8974773883819580078125), SC_(-1.45909860863314960721683880733144126731) },
+ { SC_(-0.89201068878173828125), SC_(-1.431681573516303182182852281763191690617) },
+ { SC_(-0.87765598297119140625), SC_(-1.365471286049011032989426113780315638737) },
+ { SC_(-0.864722728729248046875), SC_(-1.31177055834445394659795622633703969998) },
+ { SC_(-0.8482067584991455078125), SC_(-1.249725893334944048400811976134680437019) },
+ { SC_(-0.805655956268310546875), SC_(-1.114524602859225810626832366034868507092) },
+ { SC_(-0.8048388957977294921875), SC_(-1.112200609756455010839566277837214844325) },
+ { SC_(-0.780198574066162109375), SC_(-1.045877833082255648218230662475846475501) },
+ { SC_(-0.774993419647216796875), SC_(-1.032711173436253036051634900441573817364) },
+ { SC_(-0.761928558349609375), SC_(-1.000796728136218508274740551519944314059) },
+ { SC_(-0.7504425048828125), SC_(-0.9739672824457071545212558891424185128762) },
+ { SC_(-0.7495596408843994140625), SC_(-0.9719492983286864197920761015664283271976) },
+ { SC_(-0.7481319904327392578125), SC_(-0.9686989420144869980652193388237565424316) },
+ { SC_(-0.7459518909454345703125), SC_(-0.9637657636705832060477647484529718099027) },
+ { SC_(-0.740113735198974609375), SC_(-0.9507308314464193446531653906278264445993) },
+ { SC_(-0.7289731502532958984375), SC_(-0.926532531986765318247140551363667818701) },
+ { SC_(-0.7226788997650146484375), SC_(-0.9132299082876395943553155758462776294309) },
+ { SC_(-0.7161557674407958984375), SC_(-0.8997082193533088241452821117641146130759) },
+ { SC_(-0.7017018795013427734375), SC_(-0.8706453720344795324137713806233471643566) },
+ { SC_(-0.7013418674468994140625), SC_(-0.869936501309450037837255615527206388543) },
+ { SC_(-0.6910541057586669921875), SC_(-0.8499705913361888274674607430873352657984) },
+ { SC_(-0.6847054958343505859375), SC_(-0.8379194558420050243680161679293990119402) },
+ { SC_(-0.683816432952880859375), SC_(-0.8362476144993315210191634049830735329595) },
+ { SC_(-0.6747090816497802734375), SC_(-0.8193374156276963181623971413078624527231) },
+ { SC_(-0.6575610637664794921875), SC_(-0.7885046044142132636244565971148537710756) },
+ { SC_(-0.6522045135498046875), SC_(-0.7791255597799838714478027675042210151575) },
+ { SC_(-0.6261923313140869140625), SC_(-0.7351275788820003190814567583601297864281) },
+ { SC_(-0.62317371368408203125), SC_(-0.7301771459970386661436038123301221899899) },
+ { SC_(-0.6067488193511962890625), SC_(-0.703759752613062694606340098389939027562) },
+ { SC_(-0.583805561065673828125), SC_(-0.6682166303197607887197770868026216259119) },
+ { SC_(-0.57952404022216796875), SC_(-0.6617457665293066615721543987931600748293) },
+ { SC_(-0.5760939121246337890625), SC_(-0.6565964588573980673410012745962406194225) },
+ { SC_(-0.56546783447265625), SC_(-0.6408350116350283247012343252539212893332) },
+ { SC_(-0.557876110076904296875), SC_(-0.6297442839791668262390512924219530985196) },
+ { SC_(-0.552320957183837890625), SC_(-0.6217149641475686188387285842099747744544) },
+ { SC_(-0.5396339893341064453125), SC_(-0.6036390747171697770925487100621985766607) },
+ { SC_(-0.512898921966552734375), SC_(-0.566655625606477066963814924576009526094) },
+ { SC_(-0.5087778568267822265625), SC_(-0.5610793900942041010450981003401240686441) },
+ { SC_(-0.49778258800506591796875), SC_(-0.5463539505715040435095828997881628670016) },
+ { SC_(-0.49138653278350830078125), SC_(-0.5378865967606702825309467710240853062652) },
+ { SC_(-0.48976075649261474609375), SC_(-0.5357455496477737185521806219611537015446) },
+ { SC_(-0.4849350452423095703125), SC_(-0.5294166456244710849865087993139911130393) },
+ { SC_(-0.447905063629150390625), SC_(-0.4820764946679978939347292302681479739796) },
+ { SC_(-0.4461095333099365234375), SC_(-0.4798325976916710897104638200930521631286) },
+ { SC_(-0.442959308624267578125), SC_(-0.4759065337156127733780647024545262009008) },
+ { SC_(-0.4282791614532470703125), SC_(-0.4577873936293679104616687959332340265949) },
+ { SC_(-0.40590059757232666015625), SC_(-0.4306933608076878743806295938648362982359) },
+ { SC_(-0.40029656887054443359375), SC_(-0.4240020382545707218942432038948084774496) },
+ { SC_(-0.3961341381072998046875), SC_(-0.4190551379319939121143095387765817810309) },
+ { SC_(-0.38362753391265869140625), SC_(-0.4043062717590873607565891081374512836717) },
+ { SC_(-0.3668625354766845703125), SC_(-0.3847928551425506989844364335805100378916) },
+ { SC_(-0.36576449871063232421875), SC_(-0.383524642274593405044354917396013672621) },
+ { SC_(-0.33507001399993896484375), SC_(-0.3485286317501441759395903809820783149922) },
+ { SC_(-0.325722217559814453125), SC_(-0.3380352468276521988337991305273476357259) },
+ { SC_(-0.3191967010498046875), SC_(-0.3307524237890151189189282578009246778706) },
+ { SC_(-0.300002574920654296875), SC_(-0.3095224337886502772553678318463405679109) },
+ { SC_(-0.296651363372802734375), SC_(-0.3058438250228024929192737081479944125667) },
+ { SC_(-0.2944457530975341796875), SC_(-0.3034271164344304639271762476267134487006) },
+ { SC_(-0.287281036376953125), SC_(-0.2956001834724682534366346933530868053292) },
+ { SC_(-0.277384281158447265625), SC_(-0.2848460820316943671684268151981802822583) },
+ { SC_(-0.239084422588348388671875), SC_(-0.2438028008332661157406055005411967471601) },
+ { SC_(-0.23685944080352783203125), SC_(-0.2414442516939151847702918137086915005926) },
+ { SC_(-0.2253856658935546875), SC_(-0.2293228153248167922436892209184552796457) },
+ { SC_(-0.222838103771209716796875), SC_(-0.2266405306474514216815783549721039495306) },
+ { SC_(-0.2155244350433349609375), SC_(-0.2189577360114399508892266906786141753798) },
+ { SC_(-0.215337574481964111328125), SC_(-0.2187617810795299603977983273974692894269) },
+ { SC_(-0.210162580013275146484375), SC_(-0.213341433207717363756996669992890635922) },
+ { SC_(-0.202502727508544921875), SC_(-0.2053409277979887156428422481476167713845) },
+ { SC_(-0.1915638446807861328125), SC_(-0.1939600847413307517360830799803393191118) },
+ { SC_(-0.182519435882568359375), SC_(-0.1845877143932293893050297021219967479454) },
+ { SC_(-0.1746494770050048828125), SC_(-0.1764584460861806768647912839605350112421) },
+ { SC_(-0.15646183490753173828125), SC_(-0.1577576667718915543508871956214699612414) },
+ { SC_(-0.155809104442596435546875), SC_(-0.1570886262196417664166148374546893502577) },
+ { SC_(-0.15365445613861083984375), SC_(-0.1548811251554959173309605263848373765859) },
+ { SC_(-0.1224990189075469970703125), SC_(-0.1231173360990485154969499505998906050858) },
+ { SC_(-0.1088167130947113037109375), SC_(-0.1092492929673783678150776545155488162838) },
+ { SC_(-0.0879255831241607666015625), SC_(-0.08815322150790301444935652020860591175639) },
+ { SC_(-0.084013283252716064453125), SC_(-0.08421178632314607700273933837777975783955) },
+ { SC_(-0.06121261417865753173828125), SC_(-0.06128924075509795947903082912344529497771) },
+ { SC_(-0.0534169971942901611328125), SC_(-0.05346789060550385741248960046699294299987) },
+ { SC_(-0.0504775941371917724609375), SC_(-0.0505205318923802872873054309617566051014) },
+ { SC_(-0.029245793819427490234375), SC_(-0.02925413623733265658295603323356445573956) },
+ { SC_(-0.024859689176082611083984375), SC_(-0.02486481220617492008704879514284669118942) },
+ { SC_(-0.02046917378902435302734375), SC_(-0.02047203328100153078698678836073163016822) },
+ { SC_(-0.0188200175762176513671875), SC_(-0.01882224002175634892911631496693598606876) },
+ { SC_(-0.01615250110626220703125), SC_(-0.01615390607310920464304141890191065645265) },
+ { SC_(-0.003271550871431827545166015625), SC_(-0.003271562543358962122360602166863449874156) },
+ { SC_(0.165048140085555239409131900174543261528e-11), SC_(0.1650481400855552394091320500431428863902e-11) },
+ { SC_(0.2065420751096169738048047292977571487427e-11), SC_(0.206542075109616973804805022998032275867e-11) },
+ { SC_(0.6933230031758164102484442992135882377625e-11), SC_(0.6933230031758164102484554084849147212117e-11) },
+ { SC_(0.1335144494962747785393730737268924713135e-10), SC_(0.1335144494962747785393810072036465631048e-10) },
+ { SC_(0.1639981206391638579589198343455791473389e-10), SC_(0.16399812063916385795893453698677871597e-10) },
+ { SC_(0.5730159402528300915946601890027523040771e-10), SC_(0.573015940252830091595287349730680977303e-10) },
+ { SC_(0.1113731329382972035091370344161987304688e-9), SC_(0.1113731329382972035095975242587774151074e-9) },
+ { SC_(0.1421470718909745301061775535345077514648e-9), SC_(0.1421470718909745301071349514979911287802e-9) },
+ { SC_(0.3800632031314421510614920407533645629883e-9), SC_(0.3800632031314421510797918354702572472565e-9) },
+ { SC_(0.6091627202664540163823403418064117431641e-9), SC_(0.6091627202664540164576895507880226730245e-9) },
+ { SC_(0.1022164131114777774200774729251861572266e-8), SC_(0.1022164131114777774556767071774970972449e-8) },
+ { SC_(0.2881922256392499548383057117462158203125e-8), SC_(0.288192225639249955636163572505228913693e-8) },
+ { SC_(0.4762776839584148547146469354629516601563e-8), SC_(0.4762776839584148583159481252584483554515e-8) },
+ { SC_(0.8854133426439148024655878543853759765625e-8), SC_(0.8854133426439148256031145063819131862293e-8) },
+ { SC_(0.2305032609228874207474291324615478515625e-7), SC_(0.2305032609228874615709037767878933144975e-7) },
+ { SC_(0.593924909253473742865025997161865234375e-7), SC_(0.5939249092534744412153923027426683753111e-7) },
+ { SC_(0.116676488914890796877443790435791015625e-6), SC_(0.1166764889148913263321344126152128598244e-6) },
+ { SC_(0.23799674409019644372165203094482421875e-6), SC_(0.2379967440902009372945601325325051016678e-6) },
+ { SC_(0.468465941594331525266170501708984375e-6), SC_(0.4684659415943657951641995164188851895468e-6) },
+ { SC_(0.938269977268646471202373504638671875e-6), SC_(0.9382699772689218066992955176687134214945e-6) },
+ { SC_(0.11039855962735600769519805908203125e-5), SC_(0.1103985596274008583684717717140945872849e-5) },
+ { SC_(0.3291776010883040726184844970703125e-5), SC_(0.3291776010894930389950221585822451540922e-5) },
+ { SC_(0.7517213816754519939422607421875e-5), SC_(0.7517213816896115440686244581232090380807e-5) },
+ { SC_(0.1511466689407825469970703125e-4), SC_(0.151146668952292524810471268542864819142e-4) },
+ { SC_(0.2986399340443313121795654296875e-4), SC_(0.2986399341331127938191098992807520418566e-4) },
+ { SC_(0.338702811859548091888427734375e-4), SC_(0.3387028119890675897146774685716560577438e-4) },
+ { SC_(0.906601198948919773101806640625e-4), SC_(0.9066012014327826381277876686817592943471e-4) },
+ { SC_(0.0002194953267462551593780517578125), SC_(0.0002194953302712183992004987083863068286575) },
+ { SC_(0.000439521507360041141510009765625), SC_(0.0004395215356621756172832388067699815859163) },
+ { SC_(0.000633315183222293853759765625), SC_(0.0006333152678940465733692213551976187060063) },
+ { SC_(0.0011151232756674289703369140625), SC_(0.001115123737886341835357675971473032730801) },
+ { SC_(0.001962467096745967864990234375), SC_(0.001962469616086656343101697360448994447248) },
+ { SC_(0.00555375404655933380126953125), SC_(0.005553811147953337251608673095795926379418) },
+ { SC_(0.0073246769607067108154296875), SC_(0.007324807956742500088707032291078962161983) },
+ { SC_(0.0086911283433437347412109375), SC_(0.008691347183450786003338484767259005750621) },
+ { SC_(0.01191294193267822265625), SC_(0.01191350553503790551712224267804100577312) },
+ { SC_(0.0299333631992340087890625), SC_(0.02994230816857020273948279830730524489901) },
+ { SC_(0.05124260485172271728515625), SC_(0.05128752666822782052568477249433836427776) },
+ { SC_(0.05473744869232177734375), SC_(0.05479221508125443603584511761951841280462) },
+ { SC_(0.0615889132022857666015625), SC_(0.0616669638195183068123715085691638305692) },
+ { SC_(0.0937536060810089111328125), SC_(0.09402975380882211958737150286272764887037) },
+ { SC_(0.0944215953350067138671875), SC_(0.09470370926367391764663232920446630580688) },
+ { SC_(0.0944317281246185302734375), SC_(0.09471393321406025987803236345499696649722) },
+ { SC_(0.099437296390533447265625), SC_(0.09976699249016486016395021218834536220752) },
+ { SC_(0.1120129525661468505859375), SC_(0.1124849830355889429846170463794901835017) },
+ { SC_(0.123102605342864990234375), SC_(0.1237301640233916802510730091978889755734) },
+ { SC_(0.1356296539306640625), SC_(0.136470609508612479912140462032722727509) },
+ { SC_(0.137633502483367919921875), SC_(0.1385125786609474520950316182245783874744) },
+ { SC_(0.1474945545196533203125), SC_(0.1485782998046483417449330959482946265992) },
+ { SC_(0.161897182464599609375), SC_(0.163334331667904492581671816308390067676) },
+ { SC_(0.170511066913604736328125), SC_(0.1721929869363735526203806645402133592389) },
+ { SC_(0.170518338680267333984375), SC_(0.1722004764629990854468820758107275101776) },
+ { SC_(0.1856291294097900390625), SC_(0.1878064731815008603331954720151705472375) },
+ { SC_(0.188988208770751953125), SC_(0.1912876932893582208057658208318612269009) },
+ { SC_(0.23206615447998046875), SC_(0.2363721243391452317792593455314737006561) },
+ { SC_(0.23480379581451416015625), SC_(0.2392675448267426979141683097039145007706) },
+ { SC_(0.2646920680999755859375), SC_(0.271147290330230077990690324884981633411) },
+ { SC_(0.27949869632720947265625), SC_(0.287138205934443267371748751232576707068) },
+ { SC_(0.2878930568695068359375), SC_(0.2962673858386818760743191664695461734079) },
+ { SC_(0.29259669780731201171875), SC_(0.3014037366523923189237135841752647308831) },
+ { SC_(0.310164928436279296875), SC_(0.3207278827697849622886565511333038417846) },
+ { SC_(0.31092464923858642578125), SC_(0.321568689394455844291345719208687599694) },
+ { SC_(0.31145012378692626953125), SC_(0.3221505056451928603025272541357270447997) },
+ { SC_(0.3271782398223876953125), SC_(0.339664946169947805312598648269899355103) },
+ { SC_(0.3574345111846923828125), SC_(0.3739415343654542284372692080523616239196) },
+ { SC_(0.35936939716339111328125), SC_(0.3761615922309022376646457727379955025932) },
+ { SC_(0.35960352420806884765625), SC_(0.376430465969337149289307260724149960882) },
+ { SC_(0.36268270015716552734375), SC_(0.3799714809649667171023188371749734970087) },
+ { SC_(0.38961827754974365234375), SC_(0.4113499159905352551364249131399712396774) },
+ { SC_(0.3904266357421875), SC_(0.4123033008021400244918917567469642157756) },
+ { SC_(0.39811360836029052734375), SC_(0.4214052375603138698610724190400452927171) },
+ { SC_(0.41150724887847900390625), SC_(0.4374243870957909704688484065341332398408) },
+ { SC_(0.4120509624481201171875), SC_(0.438079118237434936389702798117975965435) },
+ { SC_(0.41868770122528076171875), SC_(0.4460997186945703025969092767121680940872) },
+ { SC_(0.4213654994964599609375), SC_(0.4493511447897728936819156706558562191803) },
+ { SC_(0.4516327381134033203125), SC_(0.4867494899047367852559605895765155264024) },
+ { SC_(0.45386397838592529296875), SC_(0.4895560176112374916678981118235718808999) },
+ { SC_(0.46555078029632568359375), SC_(0.5043748446613432644265368658689527269923) },
+ { SC_(0.48124635219573974609375), SC_(0.5246050193978662791545681419778026197093) },
+ { SC_(0.4862163066864013671875), SC_(0.5310932154891663069921221983411478381793) },
+ { SC_(0.48987305164337158203125), SC_(0.5358932909903700749055224508487508967699) },
+ { SC_(0.502483844757080078125), SC_(0.5526234425942533333497748944931154989089) },
+ { SC_(0.5074074268341064453125), SC_(0.5592320547729961905967162368329222398251) },
+ { SC_(0.50932216644287109375), SC_(0.5618140818296767894194272698942620318047) },
+ { SC_(0.5143489837646484375), SC_(0.5686253097655145706303693099066490153432) },
+ { SC_(0.5154285430908203125), SC_(0.5700943191671631767428541315644447456688) },
+ { SC_(0.5234100818634033203125), SC_(0.5810250825991417575052326759884079418476) },
+ { SC_(0.527447223663330078125), SC_(0.5866018515043636631396476583453040565353) },
+ { SC_(0.5309803485870361328125), SC_(0.5915094458340507867953465738492206518901) },
+ { SC_(0.5477793216705322265625), SC_(0.615203099922968789392563855123133294432) },
+ { SC_(0.5577394962310791015625), SC_(0.6295459624918965701898701179409871117547) },
+ { SC_(0.558278560638427734375), SC_(0.6303287742357745455208912482493484545533) },
+ { SC_(0.5843560695648193359375), SC_(0.6690521906099504661825293948827417437714) },
+ { SC_(0.58713626861572265625), SC_(0.6732844960442398402790025978545962104976) },
+ { SC_(0.587891101837158203125), SC_(0.6744372167164567880432735474026414000937) },
+ { SC_(0.59034061431884765625), SC_(0.6781887236623533927703862563260315607999) },
+ { SC_(0.5945003032684326171875), SC_(0.684597775489552027208298442397307157518) },
+ { SC_(0.59579753875732421875), SC_(0.686606510213166504449707209584681039618) },
+ { SC_(0.5961520671844482421875), SC_(0.6871563252400655469505525776500166368732) },
+ { SC_(0.6005008220672607421875), SC_(0.6939300827887145041443406444376899260605) },
+ { SC_(0.6150004863739013671875), SC_(0.7169242329194352408292786592670047478091) },
+ { SC_(0.6162893772125244140625), SC_(0.718999805549710753361347867549953319929) },
+ { SC_(0.6194069385528564453125), SC_(0.7240422748778544828852658840299672671419) },
+ { SC_(0.62850666046142578125), SC_(0.7389438896054792083692956718844417119266) },
+ { SC_(0.6293842792510986328125), SC_(0.7403958734869583175052115753160537014235) },
+ { SC_(0.641617298126220703125), SC_(0.7609178886018203867768570854585116358618) },
+ { SC_(0.6424276828765869140625), SC_(0.7622965466812235050838313606820415418465) },
+ { SC_(0.643742084503173828125), SC_(0.7645378650643100878873860589743586646119) },
+ { SC_(0.6468508243560791015625), SC_(0.7698647951781609863982541324817513695536) },
+ { SC_(0.661591053009033203125), SC_(0.7956379107512945487304413199186620675388) },
+ { SC_(0.669950008392333984375), SC_(0.8106524185805045490744310224054265386895) },
+ { SC_(0.6813662052154541015625), SC_(0.8316597473423232100463095038096703191227) },
+ { SC_(0.6968657970428466796875), SC_(0.861181279065929560893743209045814929335) },
+ { SC_(0.69818878173828125), SC_(0.8637579113749143394578018115274414809977) },
+ { SC_(0.7447831630706787109375), SC_(0.9611360201710216528199065175645895870797) },
+ { SC_(0.7518312931060791015625), SC_(0.9771540941752986840434538256366757954859) },
+ { SC_(0.753439426422119140625), SC_(0.9808634133542228689124290623167881332843) },
+ { SC_(0.7567856311798095703125), SC_(0.9886489208209698781284720459176833206972) },
+ { SC_(0.781728267669677734375), SC_(1.049799171982895646434536064092181561482) },
+ { SC_(0.8115026950836181640625), SC_(1.13141414441875853996497925019619325203) },
+ { SC_(0.8146479129791259765625), SC_(1.140694775558441751141132778566016009721) },
+ { SC_(0.8266689777374267578125), SC_(1.177523083369968036920622084233473757412) },
+ { SC_(0.8313877582550048828125), SC_(1.192613822570143323026054454909849845367) },
+ { SC_(0.83430385589599609375), SC_(1.202132332303961254992584113869002097916) },
+ { SC_(0.8416652679443359375), SC_(1.226857064433516189319978030947873360052) },
+ { SC_(0.85844135284423828125), SC_(1.287389667157365295856183109440507044615) },
+ { SC_(0.8678996562957763671875), SC_(1.324504043392939851303939943290664403741) },
+ { SC_(0.8679344654083251953125), SC_(1.324645130926160707039340948233535357264) },
+ { SC_(0.8800599575042724609375), SC_(1.376033487778217701076449442272672558944) },
+ { SC_(0.900353908538818359375), SC_(1.474085296119410724208965851686464033313) },
+ { SC_(0.909944057464599609375), SC_(1.527199085186199482742984118973093246969) },
+ { SC_(0.9142425060272216796875), SC_(1.552776894827300414876536030721521100862) },
+ { SC_(0.9149219989776611328125), SC_(1.556931837197935820864845994901316963069) },
+ { SC_(0.918490886688232421875), SC_(1.579289662838161287932020406856633071199) },
+ { SC_(0.91889286041259765625), SC_(1.581866335942762753838726342973068309432) },
+ { SC_(0.919395923614501953125), SC_(1.585108284332000716017087123313008639504) },
+ { SC_(0.9296839237213134765625), SC_(1.656055522329536863771852381599659592259) },
+ { SC_(0.929839611053466796875), SC_(1.6572041418041492174589693922205395004) },
+ { SC_(0.9352962970733642578125), SC_(1.69909864336192661532416961180476119912) },
+ { SC_(0.937641620635986328125), SC_(1.718164398807964846646482962730886595432) },
+ { SC_(0.9410912990570068359375), SC_(1.747508407724663243809927907107491941803) },
+ { SC_(0.96212291717529296875), SC_(1.973718016345510160586126866935192466646) },
+ { SC_(0.974821567535400390625), SC_(2.181122777108378116176876272951870175355) },
+ { SC_(0.976945400238037109375), SC_(2.225721449969825368029395993270411091677) },
+ { SC_(0.985663890838623046875), SC_(2.465463560165053850170474882317767473537) },
+ { SC_(0.98803806304931640625), SC_(2.556586922814200202245299755886851508354) },
+ { SC_(0.9928233623504638671875), SC_(2.813238353909419376753157236188061588174) }
+ }};
+#undef SC_
+

Modified: sandbox/math_toolkit/libs/math/test/handle_test_result.hpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/handle_test_result.hpp (original)
+++ sandbox/math_toolkit/libs/math/test/handle_test_result.hpp 2008-08-20 07:02:05 EDT (Wed, 20 Aug 2008)
@@ -135,6 +135,14 @@
    {
       std::cout << "\n worst case at row: "
          << row << "\n { ";
+ if(std::numeric_limits<T>::digits10)
+ {
+ std::cout << std::setprecision(std::numeric_limits<T>::digits10 + 2);
+ }
+ else
+ {
+ std::cout << std::setprecision(std::numeric_limits<long double>::digits10 + 2);
+ }
       for(unsigned i = 0; i < worst.size(); ++i)
       {
          if(i)

Added: sandbox/math_toolkit/libs/math/test/test_inv_hyp.cpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/test/test_inv_hyp.cpp 2008-08-20 07:02:05 EDT (Wed, 20 Aug 2008)
@@ -0,0 +1,237 @@
+// (C) Copyright John Maddock 2006.
+// 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/concepts/real_concept.hpp>
+#include <boost/math/special_functions/acosh.hpp>
+#include <boost/math/special_functions/asinh.hpp>
+#include <boost/math/special_functions/atanh.hpp>
+#include <boost/test/included/test_exec_monitor.hpp>
+#include <boost/test/floating_point_comparison.hpp>
+#include <boost/math/tools/stats.hpp>
+#include <boost/math/tools/test.hpp>
+#include <boost/math/constants/constants.hpp>
+#include <boost/type_traits/is_floating_point.hpp>
+#include <boost/array.hpp>
+#include "functor.hpp"
+
+#include "handle_test_result.hpp"
+
+//
+// DESCRIPTION:
+// ~~~~~~~~~~~~
+//
+// This file tests the inverse hyperbolic functions. There are two sets of tests:
+// 1) Sanity checks: comparison to test values created with the
+// online calculator at functions.wolfram.com
+// 2) Accuracy tests use values generated with NTL::RR at
+// 1000-bit precision and our generic versions of these functions.
+//
+// Note that when this file is first run on a new platform many of
+// these tests will fail: the default accuracy is 1 epsilon which
+// is too tight for most platforms. In this situation you will
+// need to cast a human eye over the error rates reported and make
+// a judgement as to whether they are acceptable. Either way please
+// report the results to the Boost mailing list. Acceptable rates of
+// error are marked up below as a series of regular expressions that
+// identify the compiler/stdlib/platform/data-type/test-data/test-function
+// along with the maximum expected peek and RMS mean errors for that
+// test.
+//
+
+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";
+ }
+ else
+ {
+ largest_type = "long double";
+ }
+#else
+ largest_type = "(long\\s+)?double";
+#endif
+
+ add_expected_result(
+ ".*", // compiler
+ ".*", // stdlib
+ ".*", // platform
+ "real_concept", // test type(s)
+ ".*", // test data group
+ ".*", 4, 2); // test function
+ add_expected_result(
+ ".*", // compiler
+ ".*", // stdlib
+ ".*", // platform
+ ".*", // test type(s)
+ ".*", // test data group
+ ".*", 2, 1); // test function
+
+ std::cout << "Tests run with " << BOOST_COMPILER << ", "
+ << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
+}
+
+template <class T>
+void do_test_asinh(const T& data, const char* type_name, const char* test_name)
+{
+ //
+ // test asinh(T) against data:
+ //
+ using namespace std;
+ typedef typename T::value_type row_type;
+ typedef typename row_type::value_type value_type;
+
+ std::cout << test_name << " with type " << type_name << std::endl;
+
+ typedef value_type (*pg)(value_type);
+#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
+ pg funcp = boost::math::asinh<value_type>;
+#else
+ pg funcp = boost::math::asinh;
+#endif
+
+ boost::math::tools::test_result<value_type> result;
+ //
+ // test asinh against data:
+ //
+ result = boost::math::tools::test(
+ data,
+ bind_func(funcp, 0),
+ extract_result(1));
+ handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::asinh", test_name);
+ std::cout << std::endl;
+}
+
+template <class T>
+void do_test_acosh(const T& data, const char* type_name, const char* test_name)
+{
+ //
+ // test acosh(T) against data:
+ //
+ using namespace std;
+ typedef typename T::value_type row_type;
+ typedef typename row_type::value_type value_type;
+
+ std::cout << test_name << " with type " << type_name << std::endl;
+
+ typedef value_type (*pg)(value_type);
+#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
+ pg funcp = boost::math::acosh<value_type>;
+#else
+ pg funcp = boost::math::acosh;
+#endif
+
+ boost::math::tools::test_result<value_type> result;
+ //
+ // test acosh against data:
+ //
+ result = boost::math::tools::test(
+ data,
+ bind_func(funcp, 0),
+ extract_result(1));
+ handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::acosh", test_name);
+ std::cout << std::endl;
+}
+
+template <class T>
+void do_test_atanh(const T& data, const char* type_name, const char* test_name)
+{
+ //
+ // test atanh(T) against data:
+ //
+ using namespace std;
+ typedef typename T::value_type row_type;
+ typedef typename row_type::value_type value_type;
+
+ std::cout << test_name << " with type " << type_name << std::endl;
+
+ typedef value_type (*pg)(value_type);
+#if defined(BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS)
+ pg funcp = boost::math::atanh<value_type>;
+#else
+ pg funcp = boost::math::atanh;
+#endif
+
+ boost::math::tools::test_result<value_type> result;
+ //
+ // test atanh against data:
+ //
+ result = boost::math::tools::test(
+ data,
+ bind_func(funcp, 0),
+ extract_result(1));
+ handle_test_result(result, data[result.worst()], result.worst(), type_name, "boost::math::atanh", test_name);
+ std::cout << std::endl;
+}
+
+template <class T>
+void test_inv_hyperbolics(T, const char* name)
+{
+ //
+ // The actual test data is rather verbose, so it's in a separate file
+ //
+#include "asinh_data.ipp"
+ do_test_asinh(asinh_data, name, "asinh");
+#include "acosh_data.ipp"
+ do_test_acosh(acosh_data, name, "acosh");
+#include "atanh_data.ipp"
+ do_test_atanh(atanh_data, name, "atanh");
+}
+
+extern "C" double zetac(double);
+
+template <class T>
+void test_spots(T, const char* t)
+{
+ std::cout << "Testing basic sanity checks for type " << t << std::endl;
+ //
+ // Basic sanity checks, tolerance is either 5 or 10 epsilon
+ // expressed as a percentage:
+ //
+ T tolerance = boost::math::tools::epsilon<T>() * 100 *
+ (boost::is_floating_point<T>::value ? 5 : 10);
+ //BOOST_CHECK_CLOSE(::boost::math::zeta(static_cast<T>(0.125)), static_cast<T>(-0.63277562349869525529352526763564627152686379131122L), tolerance);
+ (void)tolerance;
+}
+
+int test_main(int, char* [])
+{
+ expected_results();
+ BOOST_MATH_CONTROL_FP;
+
+ test_spots(0.0f, "float");
+ test_spots(0.0, "double");
+#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+ test_spots(0.0L, "long double");
+ test_spots(boost::math::concepts::real_concept(0.1), "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
+
+ test_inv_hyperbolics(0.1F, "float");
+ test_inv_hyperbolics(0.1, "double");
+#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+ test_inv_hyperbolics(0.1L, "long double");
+ test_inv_hyperbolics(boost::math::concepts::real_concept(0.1), "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;
+}
+
+
+

Added: sandbox/math_toolkit/libs/math/tools/inv_hyp_data.cpp
==============================================================================
--- (empty file)
+++ sandbox/math_toolkit/libs/math/tools/inv_hyp_data.cpp 2008-08-20 07:02:05 EDT (Wed, 20 Aug 2008)
@@ -0,0 +1,134 @@
+// 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)
+
+#include <boost/math/bindings/rr.hpp>
+#include <boost/test/included/test_exec_monitor.hpp>
+#include <boost/math/constants/constants.hpp>
+#include <boost/math/tools/test.hpp>
+#include <fstream>
+
+#include <boost/math/tools/test_data.hpp>
+
+using namespace boost::math::tools;
+using namespace std;
+
+struct asinh_data_generator
+{
+ boost::math::ntl::RR operator()(boost::math::ntl::RR z)
+ {
+ std::cout << z << " ";
+ boost::math::ntl::RR result = log(z + sqrt(z * z + 1));
+ std::cout << result << std::endl;
+ return result;
+ }
+};
+
+struct acosh_data_generator
+{
+ boost::math::ntl::RR operator()(boost::math::ntl::RR z)
+ {
+ std::cout << z << " ";
+ boost::math::ntl::RR result = log(z + sqrt(z * z - 1));
+ std::cout << result << std::endl;
+ return result;
+ }
+};
+
+struct atanh_data_generator
+{
+ boost::math::ntl::RR operator()(boost::math::ntl::RR z)
+ {
+ std::cout << z << " ";
+ boost::math::ntl::RR result = log((z + 1) / (1 - z)) / 2;
+ std::cout << result << std::endl;
+ return result;
+ }
+};
+
+int test_main(int argc, char*argv [])
+{
+ boost::math::ntl::RR::SetPrecision(500);
+ boost::math::ntl::RR::SetOutputPrecision(40);
+
+ parameter_info<boost::math::ntl::RR> arg1;
+ test_data<boost::math::ntl::RR> data;
+ std::ofstream ofs;
+
+ bool cont;
+ std::string line;
+
+ std::cout << "Welcome.\n"
+ "This program will generate spot tests for the inverse hyperbolic sin function:\n";
+
+ do{
+ if(0 == get_user_parameter_info(arg1, "z"))
+ return 1;
+ data.insert(asinh_data_generator(), arg1);
+
+ std::cout << "Any more data [y/n]?";
+ std::getline(std::cin, line);
+ boost::algorithm::trim(line);
+ cont = (line == "y");
+ }while(cont);
+
+ std::cout << "Enter name of test data file [default=asinh_data.ipp]";
+ std::getline(std::cin, line);
+ boost::algorithm::trim(line);
+ if(line == "")
+ line = "asinh_data.ipp";
+ ofs.open(line.c_str());
+ write_code(ofs, data, "asinh_data");
+ data.clear();
+
+ std::cout << "Welcome.\n"
+ "This program will generate spot tests for the inverse hyperbolic cos function:\n";
+
+ do{
+ if(0 == get_user_parameter_info(arg1, "z"))
+ return 1;
+ data.insert(acosh_data_generator(), arg1);
+
+ std::cout << "Any more data [y/n]?";
+ std::getline(std::cin, line);
+ boost::algorithm::trim(line);
+ cont = (line == "y");
+ }while(cont);
+
+ std::cout << "Enter name of test data file [default=acosh_data.ipp]";
+ std::getline(std::cin, line);
+ boost::algorithm::trim(line);
+ if(line == "")
+ line = "acosh_data.ipp";
+ ofs.close();
+ ofs.open(line.c_str());
+ write_code(ofs, data, "acosh_data");
+ data.clear();
+
+ std::cout << "Welcome.\n"
+ "This program will generate spot tests for the inverse hyperbolic tan function:\n";
+
+ do{
+ if(0 == get_user_parameter_info(arg1, "z"))
+ return 1;
+ data.insert(atanh_data_generator(), arg1);
+
+ std::cout << "Any more data [y/n]?";
+ std::getline(std::cin, line);
+ boost::algorithm::trim(line);
+ cont = (line == "y");
+ }while(cont);
+
+ std::cout << "Enter name of test data file [default=atanh_data.ipp]";
+ std::getline(std::cin, line);
+ boost::algorithm::trim(line);
+ if(line == "")
+ line = "atanh_data.ipp";
+ ofs.close();
+ ofs.open(line.c_str());
+ write_code(ofs, data, "atanh_data");
+
+ return 0;
+}
+


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