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

[Carlson RG] Fix test failures and concept-checking failures.

This commit is contained in:
jzmaddock
2015-01-21 17:46:14 +00:00
parent b358c793d5
commit 63525295e4
4 changed files with 27 additions and 2 deletions

View File

@@ -69,7 +69,7 @@ namespace boost { namespace math { namespace detail{
{
// x = y, z != 0
swap(x, z);
return (x == 0) ? sqrt(z) / 2 : (y * ellint_rc_imp(x, y, pol) + sqrt(x)) / 2;
return (x == 0) ? T(sqrt(z) / 2) : T((y * ellint_rc_imp(x, y, pol) + sqrt(x)) / 2);
}
}
else if(y == z)
@@ -77,7 +77,7 @@ namespace boost { namespace math { namespace detail{
if(x == 0)
return constants::pi<T>() * sqrt(y) / 4;
else
return (y == 0) ? sqrt(x) / 2 : (y * ellint_rc_imp(x, y, pol) + sqrt(x)) / 2;
return (y == 0) ? T(sqrt(x) / 2) : T((y * ellint_rc_imp(x, y, pol) + sqrt(x)) / 2);
}
return (z * ellint_rf_imp(x, y, z, pol)

View File

@@ -784,6 +784,7 @@ run compile_test/sf_ellint_rc_incl_test.cpp compile_test_main ;
run compile_test/sf_ellint_rd_incl_test.cpp compile_test_main ;
run compile_test/sf_ellint_rf_incl_test.cpp compile_test_main ;
run compile_test/sf_ellint_rj_incl_test.cpp compile_test_main ;
run compile_test/sf_ellint_rg_incl_test.cpp compile_test_main ;
run compile_test/sf_erf_incl_test.cpp compile_test_main ;
run compile_test/sf_expint_incl_test.cpp compile_test_main ;
run compile_test/sf_expm1_incl_test.cpp compile_test_main ;

View File

@@ -0,0 +1,23 @@
// 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)
//
// Basic sanity check that header <boost/math/special_functions/ellint_rf.hpp>
// #includes all the files that it needs to.
//
#include <boost/math/special_functions/ellint_rg.hpp>
//
// Note this header includes no other headers, this is
// important if this test is to be meaningful:
//
#include "test_compile_result.hpp"
void compile_and_link_test()
{
check_result<float>(boost::math::ellint_rg<float>(f, f, f));
check_result<double>(boost::math::ellint_rg<double>(d, d, d));
#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
check_result<long double>(boost::math::ellint_rg<long double>(l, l, l));
#endif
}

View File

@@ -10,6 +10,7 @@
#include <boost/math/special_functions/ellint_rd.hpp>
#include <boost/math/special_functions/ellint_rf.hpp>
#include <boost/math/special_functions/ellint_rj.hpp>
#include <boost/math/special_functions/ellint_rg.hpp>
#include "libs/math/test/test_carlson.hpp"
void expected_results()