boostorg / boostorg/boost

boost non_central_chi_squared_distribution() exception.

Aperta
#577 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
HTML
Stelle
8.6k
Fork
1.9k
Merge medio
39m
PR unite (30g)
2

Descrizione

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();
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.