Boost logo

Boost-Commit :

From: john_at_[hidden]
Date: 2008-08-22 04:51:23


Author: johnmaddock
Date: 2008-08-22 04:51:22 EDT (Fri, 22 Aug 2008)
New Revision: 48289
URL: http://svn.boost.org/trac/boost/changeset/48289

Log:
Fixes for gcc compilation.
Added sanity checks to tests.
Text files modified:
   sandbox/math_toolkit/boost/math/special_functions/acosh.hpp | 1
   sandbox/math_toolkit/boost/math/tools/precision.hpp | 22 ++++++++++----------
   sandbox/math_toolkit/libs/math/test/acosh_data.ipp | 42 ++++++++++++++++++++--------------------
   sandbox/math_toolkit/libs/math/test/asinh_data.ipp | 42 ++++++++++++++++++++--------------------
   sandbox/math_toolkit/libs/math/test/test_inv_hyp.cpp | 21 +++++++++++++++++--
   5 files changed, 72 insertions(+), 56 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-22 04:51:22 EDT (Fri, 22 Aug 2008)
@@ -20,6 +20,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 cosine function.
 

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-22 04:51:22 EDT (Fri, 22 Aug 2008)
@@ -241,25 +241,25 @@
 }
 
 template <class T>
-inline T root_epsilon_imp(const mpl::int_<53>&)
+inline T root_epsilon_imp(const T*, const mpl::int_<53>&)
 {
    return static_cast<T>(0.1490116119384765625e-7L);
 }
 
 template <class T>
-inline T root_epsilon_imp(const mpl::int_<64>&)
+inline T root_epsilon_imp(const T*, const mpl::int_<64>&)
 {
    return static_cast<T>(0.32927225399135962333569506281281311031656150598474e-9L);
 }
 
 template <class T>
-inline T root_epsilon_imp(const mpl::int_<113>&)
+inline T root_epsilon_imp(const T*, const mpl::int_<113>&)
 {
    return static_cast<T>(0.1387778780781445675529539585113525390625e-16L);
 }
 
 template <class T, class Tag>
-inline T root_epsilon_imp(const Tag&)
+inline T root_epsilon_imp(const T*, const Tag&)
 {
    BOOST_MATH_STD_USING
    static const T r_eps = sqrt(tools::epsilon<T>());
@@ -267,31 +267,31 @@
 }
 
 template <class T>
-inline T forth_root_epsilon_imp(const mpl::int_<24>&)
+inline T forth_root_epsilon_imp(const T*, const mpl::int_<24>&)
 {
    return static_cast<T>(0.018581361171917516667460937040007436176452688944747L);
 }
 
 template <class T>
-inline T forth_root_epsilon_imp(const mpl::int_<53>&)
+inline T forth_root_epsilon_imp(const T*, const mpl::int_<53>&)
 {
    return static_cast<T>(0.0001220703125L);
 }
 
 template <class T>
-inline T forth_root_epsilon_imp(const mpl::int_<64>&)
+inline T forth_root_epsilon_imp(const T*, const mpl::int_<64>&)
 {
    return static_cast<T>(0.18145860519450699870567321328132261891067079047605e-4L);
 }
 
 template <class T>
-inline T forth_root_epsilon_imp(const mpl::int_<113>&)
+inline T forth_root_epsilon_imp(const T*, const mpl::int_<113>&)
 {
    return static_cast<T>(0.37252902984619140625e-8L);
 }
 
 template <class T, class Tag>
-inline T forth_root_epsilon_imp(const Tag&)
+inline T forth_root_epsilon_imp(const T*, const Tag&)
 {
    BOOST_MATH_STD_USING
    static const T r_eps = sqrt(sqrt(tools::epsilon<T>()));
@@ -304,14 +304,14 @@
 inline T root_epsilon()
 {
    typedef mpl::int_<std::numeric_limits<T>::digits> tag_type;
- return detail::root_epsilon_imp<T>(tag_type());
+ return detail::root_epsilon_imp(static_cast<T const*>(0), 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());
+ return detail::forth_root_epsilon_imp(static_cast<T const*>(0), tag_type());
 }
 
 } // namespace tools

Modified: sandbox/math_toolkit/libs/math/test/acosh_data.ipp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/acosh_data.ipp (original)
+++ sandbox/math_toolkit/libs/math/test/acosh_data.ipp 2008-08-22 04:51:22 EDT (Fri, 22 Aug 2008)
@@ -240,27 +240,27 @@
       { 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) }
+ { SC_(1736171.0), SC_(15.06033985221540896276800056693696357419) },
+ { SC_(3770530.0), SC_(15.83587331365755605568701554508826253991) },
+ { SC_(4344090.0), SC_(15.97747403917326507392988269405762331118) },
+ { SC_(11419360.0), SC_(16.94396789915014469006155507384872743685) },
+ { SC_(31023240.0), SC_(17.9433943395609684013300439026124645108) },
+ { SC_(40665424.0), SC_(18.21403593674543079149440340324547029148) },
+ { SC_(129788064.0), SC_(19.37456058170921543648305825985098346634) },
+ { SC_(225668224.0), SC_(19.9277236237785460971743917048171789264) },
+ { SC_(450631936.0), SC_(20.61930863840059519949232655148142693395) },
+ { SC_(750941952.0), SC_(21.1299860930266968673735341410555546727) },
+ { SC_(1887358976.0), SC_(22.05159150215413004649732665310838648331) },
+ { SC_(3738011648.0), SC_(22.73496684263974142690946105862900518113) },
+ { SC_(7486695424.0), SC_(23.42954051928097083366085869187241049078) },
+ { SC_(12668080128.0), SC_(23.95549847139166892348970713379911103008) },
+ { SC_(23918272512.0), SC_(24.59105572458284785473015955570721968617) },
+ { SC_(48862560256.0), SC_(25.30542448179939429678484289438720749573) },
+ { SC_(113763549184.0), SC_(26.15053518194943663075151882301281675861) },
+ { SC_(161334755328.0), SC_(26.49989444953256419131899378956019192586) },
+ { SC_(321933279232.0), SC_(27.19075733422631778452130090694771384112) },
+ { SC_(715734122496.0), SC_(27.98972177820814613504868209029528272152) },
+ { SC_(1875817529344.0), SC_(28.95321287653379863631300659442341812344) }
    }};
 #undef SC_
 

Modified: sandbox/math_toolkit/libs/math/test/asinh_data.ipp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/asinh_data.ipp (original)
+++ sandbox/math_toolkit/libs/math/test/asinh_data.ipp 2008-08-22 04:51:22 EDT (Fri, 22 Aug 2008)
@@ -260,27 +260,27 @@
       { 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) }
+ { SC_(1788919.0), SC_(15.09026926533497056732451999718664988024) },
+ { SC_(3769169.0), SC_(15.83551229128394411859348316953904317643) },
+ { SC_(4327820.0), SC_(15.97372168955474121405849637207319473463) },
+ { SC_(11044024.0), SC_(16.91054720571544732784968725481341574805) },
+ { SC_(21423208.0), SC_(17.57313255890322504472542433762806340181) },
+ { SC_(62828288.0), SC_(18.64906315643796382994112822618240813581) },
+ { SC_(70207360.0), SC_(18.7601108873651530393019317938988457707) },
+ { SC_(154231424.0), SC_(19.54711196618087428636344348941647974165) },
+ { SC_(294509056.0), SC_(20.1939674915675244205666343569672677746) },
+ { SC_(1070557184.0), SC_(21.48459226315622322979093631189365864251) },
+ { SC_(1957922816.0), SC_(22.08829714102155481686957732827526425736) },
+ { SC_(3912507392.0), SC_(22.78059146269991677250675041832419710247) },
+ { SC_(7279233024.0), SC_(23.40143852031869095098313030835785443555) },
+ { SC_(9665245184.0), SC_(23.68494949808078517275225570625127768937) },
+ { SC_(22627590144.0), SC_(24.53558298204260156687347955127694595939) },
+ { SC_(60601991168.0), SC_(25.52074076759958328225601044752066239618) },
+ { SC_(134018236416.0), SC_(26.31438890085421876104087786768111623882) },
+ { SC_(204864946176.0), SC_(26.73876398039978985836947169876252884996) },
+ { SC_(284346286080.0), SC_(27.06660583008717947194092254982253381033) },
+ { SC_(914576637952.0), SC_(28.23487428494463574299686107465880501208) },
+ { SC_(1581915832320.0), SC_(28.7828049610810604762091293247739091717) }
    }};
 #undef SC_
 

Modified: sandbox/math_toolkit/libs/math/test/test_inv_hyp.cpp
==============================================================================
--- sandbox/math_toolkit/libs/math/test/test_inv_hyp.cpp (original)
+++ sandbox/math_toolkit/libs/math/test/test_inv_hyp.cpp 2008-08-22 04:51:22 EDT (Fri, 22 Aug 2008)
@@ -73,7 +73,7 @@
       ".*", // platform
       ".*", // test type(s)
       ".*", // test data group
- ".*", 2, 1); // test function
+ ".*", 4, 1); // test function
 
    std::cout << "Tests run with " << BOOST_COMPILER << ", "
       << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl;
@@ -198,8 +198,23 @@
    //
    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;
+ BOOST_CHECK_CLOSE(::boost::math::acosh(static_cast<T>(262145)/262144L), static_cast<T>(0.00276213498595136093375633956331651432309750291610866833462649L), tolerance);
+ BOOST_CHECK_CLOSE(::boost::math::acosh(static_cast<T>(2)), static_cast<T>(1.31695789692481670862504634730796844402698197146751647976847L), tolerance);
+ BOOST_CHECK_CLOSE(::boost::math::acosh(static_cast<T>(40)), static_cast<T>(4.38187034804006698696313269586603717076961771721038534547948L), tolerance);
+ BOOST_CHECK_CLOSE(::boost::math::acosh(static_cast<T>(262145L)), static_cast<T>(13.1698002453253126137651962522659827810753786944786303017757L), tolerance);
+
+ BOOST_CHECK_CLOSE(::boost::math::asinh(static_cast<T>(0)), static_cast<T>(0), tolerance);
+ BOOST_CHECK_CLOSE(::boost::math::asinh(static_cast<T>(1)/262145L), static_cast<T>(3.81468271375603081996185039385472561751449912305225962381803e-6L), tolerance);
+ BOOST_CHECK_CLOSE(::boost::math::asinh(static_cast<T>(0.25)), static_cast<T>(0.247466461547263452944781549788359289253766903098567696469117L), tolerance);
+ BOOST_CHECK_CLOSE(::boost::math::asinh(static_cast<T>(1)), static_cast<T>(0.881373587019543025232609324979792309028160328261635410753296L), tolerance);
+ BOOST_CHECK_CLOSE(::boost::math::asinh(static_cast<T>(10)), static_cast<T>(2.99822295029796973884659553759645347660705805487730365573446L), tolerance);
+ BOOST_CHECK_CLOSE(::boost::math::asinh(static_cast<T>(262145L)), static_cast<T>(13.1698002453325885158685460826511173257938039316922010439486L), tolerance);
+
+ BOOST_CHECK_CLOSE(::boost::math::atanh(static_cast<T>(0)), static_cast<T>(0), tolerance);
+ BOOST_CHECK_CLOSE(::boost::math::atanh(static_cast<T>(1)/262145L), static_cast<T>(3.81468271378378607794264842456613940280945630999769224301574e-6L), tolerance);
+ BOOST_CHECK_CLOSE(::boost::math::atanh(static_cast<T>(-1)/262145L), static_cast<T>(-3.81468271378378607794264842456613940280945630999769224301574e-6L), tolerance);
+ BOOST_CHECK_CLOSE(::boost::math::atanh(static_cast<T>(0.5)), static_cast<T>(0.549306144334054845697622618461262852323745278911374725867347L), tolerance);
+ BOOST_CHECK_CLOSE(::boost::math::atanh(static_cast<T>(-0.5)), static_cast<T>(-0.549306144334054845697622618461262852323745278911374725867347L), tolerance);
 }
 
 int test_main(int, char* [])


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk