alashworth / test-issue-import

0 stars 0 forks source link

floating point values beyond representable range #127

Open alashworth opened 5 years ago

alashworth commented 5 years ago

Issue by bgoodri Thursday Jan 19, 2017 at 03:43 GMT Originally opened as https://github.com/stan-dev/stan/issues/2208


Summary:

ADVI (at least) can yield a value of something that is -6.63215e+311, which is beyond what can be expressed as a double but does not overflow to negative infinity. This is apparently undefined behavior.

Description:

ADVI (at least) can yield a value of something that is -6.63215e+311, which is beyond what can be expressed as a double but does not overflow to negative infinity. This is apparently undefined behavior.

Reproducible Steps:

Install rstanarm with -fsanitize=address in CXXFLAGS and clang++ as CXX. I don't know if g++ has the same issue. Then, execute

library(rstanarm)
stan_glm(Days ~ Sex/(Age + Eth*Lrn), data = MASS::quine, seed = 123,
          family = neg_binomial_2, QR = TRUE, algorithm = "fullrank") 

Current Output:

Begin eta adaptation.
Iteration:   1 / 250 [  0%]  (Adaptation)
/data/gannet/ripley/R/test-clang/BH/include/boost/math/policies/error_handling.hpp:707:32: runtime error: value -6.63215e+311 is outside the range of representable values of type 'double'
SUMMARY: AddressSanitizer: undefined-behavior /data/gannet/ripley/R/test-clang/BH/include/boost/math/policies/error_handling.hpp:707:32 in 

Expected Output:

Regular

Additional Information:

Current Version:

v2.14.0