boostorg / boostorg/boost

boost non_central_chi_squared_distribution() exception.

Đang mở
#577 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
HTML
Star
8.6k
Fork
1.9k
Merge trung bình
39 phút
Pull request đã merge (30 ngày)
2

Mô tả

The following code used to give correct result (1.53) but now (1.77) throws exception:

```
boost::math::non_central_chi_squared_distribution nchi2(0.001, 100);
double res = quantile(nchi2, 0.00000000000003659);

```
// use to return 5.8758639130601491, now throws exception

I traced the issue to line 476 in boost/math/distributions/non_central_chi_squared.hpp

instead

```
if(guess == 0)
guess = tools::min_value();
```
add the checking of guess for infinity fixes the issue

```
if(guess == 0 || isinf(guess))
guess = tools::min_value();
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.