Skip to content

Commit 851b357

Browse files
committed
Fix pessimization on unaffected platforms
1 parent 0a014fd commit 851b357

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

include/boost/math/special_functions/beta.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ T ibeta_series(T a, T b, T x, T s0, const Lanczos&, bool normalised, T* p_deriva
586586
if(a * b < bgh * 10)
587587
result *= exp((b - 0.5f) * boost::math::log1p(a / bgh, pol));
588588
else
589-
result *= pow(cgh / bgh, T(b - 0.5f));
589+
result *= pow(cgh / bgh, T(b - T(0.5)));
590590
result *= pow(x * cgh / agh, a);
591591
result *= sqrt(agh / boost::math::constants::e<T>());
592592

include/boost/math/special_functions/detail/bessel_jy_series.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,12 @@ T bessel_yn_small_z(int n, T z, T* scale, const Policy& pol)
236236
}
237237
else
238238
{
239+
#if (defined(__GNUC__) && __GNUC__ == 13)
239240
auto p = static_cast<T>(pow(z / 2, T(n)));
241+
#else
242+
auto p = static_cast<T>(pow(z / 2, n));
243+
#endif
244+
240245
T result = -((boost::math::factorial<T>(n - 1, pol) / constants::pi<T>()));
241246
if(p * tools::max_value<T>() < result)
242247
{

include/boost/math/special_functions/detail/hypergeometric_pFq_checked_series.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,13 @@
146146
return std::make_pair(r, r);
147147
}
148148
std::pair<Real, Real> r = hypergeometric_pFq_checked_series_impl(aj, bj, Real(1 / z), pol, termination, log_scale);
149+
150+
#if (defined(__GNUC__) && __GNUC__ == 13)
149151
Real mul = pow(-z, Real(-*aj.begin()));
152+
#else
153+
Real mul = pow(-z, -*aj.begin());
154+
#endif
155+
150156
r.first *= mul;
151157
r.second *= mul;
152158
return r;

0 commit comments

Comments
 (0)