2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-19 04:22:09 +00:00

Remove unused variables, variables set but unused, set floating point number that would flush to zero to identically zero.

This commit is contained in:
Nick Thompson
2017-05-03 15:30:24 -06:00
parent cf35d745d1
commit bcff4eae78
3 changed files with 7 additions and 27 deletions

View File

@@ -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<double, boost::math::policies::policy<> >() == boost::math::policies::digits<long double, boost::math::policies::policy<> >())
{
largest_type = "(long\\s+)?double|real_concept";
}
else
{
largest_type = "long double|real_concept";
}
#else
largest_type = "(long\\s+)?double|real_concept";
#endif
//
// 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<RealType>() * 500, RealType(1e-25));
RealType x = 2;
boost::math::non_central_f_distribution<RealType> 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<RealType>(0.5)), static_cast<RealType>(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 )

View File

@@ -70,7 +70,7 @@ private:
BOOST_AUTO_TEST_CASE( test_main )
{
int newton_limits = static_cast<int>(std::numeric_limits<double>::digits * 0.6);
int halley_limits = static_cast<int>(std::numeric_limits<double>::digits * 0.4);
double arg = 1e-50;
while(arg < 1e50)
{

View File

@@ -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;
}