From bcff4eae78085be210bbdb67104cca48f40b5b6f Mon Sep 17 00:00:00 2001 From: Nick Thompson Date: Wed, 3 May 2017 15:30:24 -0600 Subject: [PATCH] Remove unused variables, variables set but unused, set floating point number that would flush to zero to identically zero. --- test/test_nc_f.cpp | 29 +++++------------------------ test/test_root_iterations.cpp | 2 +- test/test_tr1.c | 3 +-- 3 files changed, 7 insertions(+), 27 deletions(-) diff --git a/test/test_nc_f.cpp b/test/test_nc_f.cpp index 014200f10..b1a3d354f 100644 --- a/test/test_nc_f.cpp +++ b/test/test_nc_f.cpp @@ -69,28 +69,10 @@ using std::numeric_limits; 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 >() == boost::math::policies::digits >()) - { - largest_type = "(long\\s+)?double|real_concept"; - } - else - { - largest_type = "long double|real_concept"; - } -#else - largest_type = "(long\\s+)?double|real_concept"; -#endif - - // - // Finish off by printing out the compiler/stdlib/platform names, + // Printing out the compiler/stdlib/platform names, // we do this to make it easier to mark up expected error rates. // - std::cout << "Tests run with " << BOOST_COMPILER << ", " + std::cout << "Tests run with " << BOOST_COMPILER << ", " << BOOST_STDLIB << ", " << BOOST_PLATFORM << std::endl; } @@ -255,7 +237,7 @@ void test_spots(RealType) // RealType tol2 = (std::max)(boost::math::tools::epsilon() * 500, RealType(1e-25)); RealType x = 2; - + boost::math::non_central_f_distribution dist(20, 15, 30); // mean: BOOST_CHECK_CLOSE( @@ -282,7 +264,7 @@ void test_spots(RealType) coefficient_of_variation(dist) , standard_deviation(dist) / mean(dist), tol2); BOOST_CHECK_CLOSE( - median(dist), + median(dist), quantile( dist, static_cast(0.5)), static_cast(tol2)); @@ -328,6 +310,5 @@ BOOST_AUTO_TEST_CASE( test_main ) #endif #endif - -} // BOOST_AUTO_TEST_CASE( test_main ) +} // BOOST_AUTO_TEST_CASE( test_main ) diff --git a/test/test_root_iterations.cpp b/test/test_root_iterations.cpp index 27fe602b4..643b91658 100644 --- a/test/test_root_iterations.cpp +++ b/test/test_root_iterations.cpp @@ -70,7 +70,7 @@ private: BOOST_AUTO_TEST_CASE( test_main ) { int newton_limits = static_cast(std::numeric_limits::digits * 0.6); - int halley_limits = static_cast(std::numeric_limits::digits * 0.4); + double arg = 1e-50; while(arg < 1e50) { diff --git a/test/test_tr1.c b/test/test_tr1.c index 8f080cd6e..345a0c2fe 100644 --- a/test/test_tr1.c +++ b/test/test_tr1.c @@ -275,7 +275,7 @@ void test_values_f(const char* name) check_close_f(cyl_bessel_kf(10240/1024.0f, 1/1024.0f), 2.35522579263922076203415803966825431039900000000993410734978e38f, eps * 5000, __LINE__); check_close_f(cyl_bessel_kf(10240/1024.0f, 10), 0.00161425530039067002345725193091329085443750382929208307802221f, eps * 5000, __LINE__); check_close_f(cyl_bessel_kf(144793/1024.0f, 100), 1.39565245860302528069481472855619216759142225046370312329416e-6f, eps * 5000, __LINE__); - check_close_f(cyl_bessel_kf(144793/1024.0f, 200), 9.11950412043225432171915100042647230802198254567007382956336e-68f, eps * 5000, __LINE__); + check_close_f(cyl_bessel_kf(144793/1024.0f, 200), 0.0f, eps * 5000, __LINE__); check_close_f(cyl_neumannf(0.5f, 1 / (1024.0f*1024)), -817.033790261762580469303126467917092806755460418223776544122f, eps * 5000, __LINE__); check_close_f(cyl_neumannf(5.5f, 3.125), -2.61489440328417468776474188539366752698192046890955453259866f, eps * 5000, __LINE__); @@ -1064,4 +1064,3 @@ int main(int argc, char* argv[]) #endif return errors; } -