mirror of
https://github.com/boostorg/math.git
synced 2026-01-19 04:22:09 +00:00
More Borland workarounds.
[SVN r39855]
This commit is contained in:
@@ -527,7 +527,7 @@ namespace boost
|
||||
// since the probability of zero failures may be non-zero,
|
||||
return 0; // but zero is the best we can do:
|
||||
}
|
||||
if (-Q <= powm1(dist.success_fraction(), dist.successes(), Policy()))
|
||||
if (-Q <= boost::math::powm1(dist.success_fraction(), dist.successes(), Policy()))
|
||||
{ // q <= cdf(complement(dist, 0)) == pdf(dist, 0)
|
||||
return 0; //
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ namespace boost
|
||||
}
|
||||
|
||||
// result = RealType(1) - pow((location / x), shape);
|
||||
result = -powm1(location/x, shape, Policy()); // should be more accurate.
|
||||
result = -boost::math::powm1(location/x, shape, Policy()); // should be more accurate.
|
||||
return result;
|
||||
} // cdf
|
||||
|
||||
|
||||
@@ -724,7 +724,7 @@ T beta_small_b_large_a_series(T a, T b, T x, T y, T s0, T mult, const Policy& po
|
||||
return s0;
|
||||
if(normalised)
|
||||
{
|
||||
prefix = h / tgamma_delta_ratio(a, b, pol);
|
||||
prefix = h / boost::math::tgamma_delta_ratio(a, b, pol);
|
||||
prefix /= pow(t, b);
|
||||
}
|
||||
else
|
||||
@@ -741,7 +741,7 @@ T beta_small_b_large_a_series(T a, T b, T x, T y, T s0, T mult, const Policy& po
|
||||
//
|
||||
// Now an initial value for J, see 9.6:
|
||||
//
|
||||
T j = gamma_q(b, u, pol) / h;
|
||||
T j = boost::math::gamma_q(b, u, pol) / h;
|
||||
//
|
||||
// Now we can start to pull things together and evaluate the sum in Eq 9:
|
||||
//
|
||||
@@ -777,11 +777,11 @@ T beta_small_b_large_a_series(T a, T b, T x, T y, T s0, T mult, const Policy& po
|
||||
for(unsigned m = 1; m < n; ++m)
|
||||
{
|
||||
mbn = m * b - n;
|
||||
p[n] += mbn * p[n-m] / unchecked_factorial<T>(tmp1);
|
||||
p[n] += mbn * p[n-m] / boost::math::unchecked_factorial<T>(tmp1);
|
||||
tmp1 += 2;
|
||||
}
|
||||
p[n] /= n;
|
||||
p[n] += bm1 / unchecked_factorial<T>(tnp1);
|
||||
p[n] += bm1 / boost::math::unchecked_factorial<T>(tnp1);
|
||||
//
|
||||
// Now we want Jn from Jn-1 using Eq 9.6:
|
||||
//
|
||||
|
||||
@@ -37,8 +37,8 @@ int temme_ik(T v, T x, T* K, T* K1, const Policy& pol)
|
||||
BOOST_ASSERT(abs(x) <= 2);
|
||||
BOOST_ASSERT(abs(v) <= 0.5f);
|
||||
|
||||
T gp = tgamma1pm1(v, pol);
|
||||
T gm = tgamma1pm1(-v, pol);
|
||||
T gp = boost::math::tgamma1pm1(v, pol);
|
||||
T gm = boost::math::tgamma1pm1(-v, pol);
|
||||
|
||||
a = log(x / 2);
|
||||
b = exp(v * a);
|
||||
|
||||
@@ -41,8 +41,8 @@ int temme_jy(T v, T x, T* Y, T* Y1, const Policy& pol)
|
||||
|
||||
BOOST_ASSERT(fabs(v) <= 0.5f); // precondition for using this routine
|
||||
|
||||
T gp = tgamma1pm1(v, pol);
|
||||
T gm = tgamma1pm1(-v, pol);
|
||||
T gp = boost::math::tgamma1pm1(v, pol);
|
||||
T gm = boost::math::tgamma1pm1(-v, pol);
|
||||
T spv = sin_pi(v, pol);
|
||||
T spv2 = sin_pi(v/2, pol);
|
||||
T xp = pow(x/2, v);
|
||||
|
||||
@@ -66,7 +66,7 @@ T igamma_temme_large(T a, T x, const Policy& pol, mpl::int_<64> const *)
|
||||
{
|
||||
BOOST_MATH_STD_USING // ADL of std functions
|
||||
T sigma = (x - a) / a;
|
||||
T phi = -log1pmx(sigma, pol);
|
||||
T phi = -boost::math::log1pmx(sigma, pol);
|
||||
T y = a * phi;
|
||||
T z = sqrt(2 * phi);
|
||||
if(x < a)
|
||||
@@ -271,7 +271,7 @@ T igamma_temme_large(T a, T x, const Policy& pol, mpl::int_<53> const *)
|
||||
{
|
||||
BOOST_MATH_STD_USING // ADL of std functions
|
||||
T sigma = (x - a) / a;
|
||||
T phi = -log1pmx(sigma, pol);
|
||||
T phi = -boost::math::log1pmx(sigma, pol);
|
||||
T y = a * phi;
|
||||
T z = sqrt(2 * phi);
|
||||
if(x < a)
|
||||
@@ -413,7 +413,7 @@ T igamma_temme_large(T a, T x, const Policy& pol, mpl::int_<24> const *)
|
||||
{
|
||||
BOOST_MATH_STD_USING // ADL of std functions
|
||||
T sigma = (x - a) / a;
|
||||
T phi = -log1pmx(sigma, pol);
|
||||
T phi = -boost::math::log1pmx(sigma, pol);
|
||||
T y = a * phi;
|
||||
T z = sqrt(2 * phi);
|
||||
if(x < a)
|
||||
@@ -469,7 +469,7 @@ T igamma_temme_large(T a, T x, const Policy& pol, mpl::int_<113> const *)
|
||||
{
|
||||
BOOST_MATH_STD_USING // ADL of std functions
|
||||
T sigma = (x - a) / a;
|
||||
T phi = -log1pmx(sigma, pol);
|
||||
T phi = -boost::math::log1pmx(sigma, pol);
|
||||
T y = a * phi;
|
||||
T z = sqrt(2 * phi);
|
||||
if(x < a)
|
||||
|
||||
@@ -133,7 +133,7 @@ T rising_factorial_imp(T x, int n, const Policy& pol)
|
||||
// tgamma_delta_ratio is alreay optimised for that
|
||||
// use case:
|
||||
//
|
||||
return 1 / tgamma_delta_ratio(x, static_cast<T>(n), pol);
|
||||
return 1 / boost::math::tgamma_delta_ratio(x, static_cast<T>(n), pol);
|
||||
}
|
||||
|
||||
template <class T, class Policy>
|
||||
@@ -162,7 +162,7 @@ inline T falling_factorial_imp(T x, unsigned n, const Policy& pol)
|
||||
unsigned n2 = tools::real_cast<unsigned>(floor(xp1));
|
||||
if(n2 == xp1)
|
||||
return 0;
|
||||
T result = tgamma_delta_ratio(xp1, -static_cast<T>(n2), pol);
|
||||
T result = boost::math::tgamma_delta_ratio(xp1, -static_cast<T>(n2), pol);
|
||||
x -= n2;
|
||||
result *= x;
|
||||
++n2;
|
||||
@@ -177,7 +177,7 @@ inline T falling_factorial_imp(T x, unsigned n, const Policy& pol)
|
||||
// because tgamma_delta_ratio is alreay optimised
|
||||
// for that use case:
|
||||
//
|
||||
return tgamma_delta_ratio(x + 1, -static_cast<T>(n), pol);
|
||||
return boost::math::tgamma_delta_ratio(x + 1, -static_cast<T>(n), pol);
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
|
||||
@@ -623,7 +623,7 @@ T regularised_gamma_prefix(T a, T z, const Policy& pol, const L& l)
|
||||
else if((fabs(d*d*a) <= 100) && (a > 150))
|
||||
{
|
||||
// special case for large a and a ~ z.
|
||||
prefix = a * log1pmx(d, pol) + z * static_cast<T>(0.5 - L::g()) / agh;
|
||||
prefix = a * boost::math::log1pmx(d, pol) + z * static_cast<T>(0.5 - L::g()) / agh;
|
||||
prefix = exp(prefix);
|
||||
}
|
||||
else
|
||||
@@ -726,7 +726,8 @@ inline T tgamma_small_upper_part(T a, T x, const Policy& pol)
|
||||
//
|
||||
// Compute the full upper fraction (Q) when a is very small:
|
||||
//
|
||||
T result = tgamma1pm1(a, pol) - powm1(x, a, pol);
|
||||
T result;
|
||||
result = boost::math::tgamma1pm1(a, pol) - boost::math::powm1(x, a, pol);
|
||||
result /= a;
|
||||
detail::small_gamma2_series<T> s(a, x);
|
||||
boost::uintmax_t max_iter = policies::get_max_series_iterations<Policy>();
|
||||
|
||||
@@ -34,7 +34,7 @@ inline T spherical_harmonic_prefix(unsigned n, unsigned m, T theta, const Policy
|
||||
|
||||
T leg = detail::legendre_p_imp(n, m, x, pow(fabs(sin_theta), T(m)), pol);
|
||||
|
||||
T prefix = tgamma_delta_ratio(static_cast<T>(n - m + 1), static_cast<T>(2 * m), pol);
|
||||
T prefix = boost::math::tgamma_delta_ratio(static_cast<T>(n - m + 1), static_cast<T>(2 * m), pol);
|
||||
prefix *= (2 * n + 1) / (4 * constants::pi<T>());
|
||||
prefix = sqrt(prefix);
|
||||
return prefix * leg;
|
||||
|
||||
Reference in New Issue
Block a user