diff --git a/include/boost/math/distributions/non_central_chi_squared.hpp b/include/boost/math/distributions/non_central_chi_squared.hpp index 3b6c19023..154e82ce5 100644 --- a/include/boost/math/distributions/non_central_chi_squared.hpp +++ b/include/boost/math/distributions/non_central_chi_squared.hpp @@ -113,7 +113,7 @@ namespace boost // *before* the largest term so that backwards iteration // is strictly converging. // - for(int i = k - 1; i >= 0; --i) + for(i = k - 1; i >= 0; --i) { T term = poisb * gamb; sum += term; diff --git a/include/boost/math/special_functions/beta.hpp b/include/boost/math/special_functions/beta.hpp index 917984621..dd9bed50f 100644 --- a/include/boost/math/special_functions/beta.hpp +++ b/include/boost/math/special_functions/beta.hpp @@ -308,8 +308,8 @@ T ibeta_power_terms(T a, // general case: T b1 = (x * cgh) / agh; T b2 = (y * cgh) / bgh; - T l1 = a * log(b1); - T l2 = b * log(b2); + l1 = a * log(b1); + l2 = b * log(b2); if((l1 >= tools::log_max_value()) || (l1 <= tools::log_min_value()) || (l2 >= tools::log_max_value()) diff --git a/include/boost/math/special_functions/detail/ibeta_inverse.hpp b/include/boost/math/special_functions/detail/ibeta_inverse.hpp index 04898db87..0c1ae76f2 100644 --- a/include/boost/math/special_functions/detail/ibeta_inverse.hpp +++ b/include/boost/math/special_functions/detail/ibeta_inverse.hpp @@ -234,10 +234,10 @@ T temme_method_2_ibeta_inverse(T /*a*/, T /*b*/, T z, T r, T theta, const Policy workspace[0] = s * s; workspace[1] = s * c; workspace[2] = (1 - 2 * workspace[0]) / 3; - static const BOOST_MATH_INT_TABLE_TYPE(T, int) co3[] = { 1, -13, 13 }; - workspace[3] = tools::evaluate_polynomial(co3, workspace[0], 3) / (36 * s * c); - static const BOOST_MATH_INT_TABLE_TYPE(T, int) co4[] = { 1, 21, -69, 46 }; - workspace[4] = tools::evaluate_polynomial(co4, workspace[0], 4) / (270 * workspace[0] * c * c); + static const BOOST_MATH_INT_TABLE_TYPE(T, int) co12[] = { 1, -13, 13 }; + workspace[3] = tools::evaluate_polynomial(co12, workspace[0], 3) / (36 * s * c); + static const BOOST_MATH_INT_TABLE_TYPE(T, int) co13[] = { 1, 21, -69, 46 }; + workspace[4] = tools::evaluate_polynomial(co13, workspace[0], 4) / (270 * workspace[0] * c * c); x = tools::evaluate_polynomial(workspace, eta, 5); #ifdef BOOST_INSTRUMENT std::cout << "Estimating x with Temme method 2 (small eta): " << x << std::endl; diff --git a/include/boost/math/special_functions/gamma.hpp b/include/boost/math/special_functions/gamma.hpp index 6caeb660f..df344ee60 100644 --- a/include/boost/math/special_functions/gamma.hpp +++ b/include/boost/math/special_functions/gamma.hpp @@ -253,10 +253,9 @@ T lgamma_imp(T z, const Policy& pol, const L& l, int* sign = 0) { // regular evaluation: T zgh = static_cast(z + L::g() - boost::math::constants::half()); - T l = L::lanczos_sum_expG_scaled(z); result = log(zgh) - 1; result *= z - 0.5f; - result += log(l); + result += log(L::lanczos_sum_expG_scaled(z)); } if(sign)