You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During the PR, #1255, the default policy boost_policy_t has been changed to avoid the propagation of input arguments from double to long double which is the default policy for boost::math. This boost_policy_t affects the boost::math functions in stan::math of
rising_factorial
falling_factorial
digamma
lgamma
The reason to avoid the propagation to long double is performance. Without the over-propagation the lgamma function runs significantly faster (~3x); the digamma function runs faster as well (2x). Negative binomial models, which use the digamma function, run now 2x faster while giving the same results. Thus, the slightly reduced precision due to avoiding the propagation does not seem to have noticeable speed precision impacts.
Moreover, the boost::math folks are considering themselves to change the default behaviour of boost::math to avoid the over propagation in future releases (see boostorg/math#241).
Therefore, we should consider to avoid the over-propagation for all boost math functions. This can be achieved by adding -DBOOST_MATH_PROMOTE_DOUBLE_POLICY=false to our makefiles.
Example
NA
Expected Output
Faster model inferences which involve boost::math functions
Current Version:
v2.20.0
The text was updated successfully, but these errors were encountered:
Description
During the PR, #1255, the default policy
boost_policy_t
has been changed to avoid the propagation of input arguments fromdouble
tolong double
which is the default policy for boost::math. Thisboost_policy_t
affects the boost::math functions in stan::math ofThe reason to avoid the propagation to long double is performance. Without the over-propagation the lgamma function runs significantly faster (~3x); the digamma function runs faster as well (2x). Negative binomial models, which use the digamma function, run now 2x faster while giving the same results. Thus, the slightly reduced precision due to avoiding the propagation does not seem to have noticeable speed precision impacts.
Moreover, the boost::math folks are considering themselves to change the default behaviour of boost::math to avoid the over propagation in future releases (see boostorg/math#241).
Therefore, we should consider to avoid the over-propagation for all boost math functions. This can be achieved by adding
-DBOOST_MATH_PROMOTE_DOUBLE_POLICY=false
to our makefiles.Example
NA
Expected Output
Faster model inferences which involve boost::math functions
Current Version:
v2.20.0
The text was updated successfully, but these errors were encountered: