bug-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-gsl] [bug #44612] Bug in vegas.c


From: Patrick Alken
Subject: [Bug-gsl] [bug #44612] Bug in vegas.c
Date: Mon, 23 Mar 2015 20:21:36 +0000
User-agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:36.0) Gecko/20100101 Firefox/36.0

URL:
  <http://savannah.gnu.org/bugs/?44612>

                 Summary: Bug in vegas.c
                 Project: GNU Scientific Library
            Submitted by: psa
            Submitted on: Mon 23 Mar 2015 08:21:35 PM GMT
                Category: Runtime error
                Severity: 3 - Normal
        Operating System: 
                  Status: None
             Assigned to: None
             Open/Closed: Open
                 Release: 
         Discussion Lock: Any

    _______________________________________________________

Details:

>From diazona =at= ellipsix =dot= net

I'm fairly sure I've identified a small bug in the VEGAS implementation: in
lines 280-283 of vegas.c on the master branch,

    if (var > 0) { wgt = 1.0 / var; }

very small but nonzero values of var (like 1e-322) will cause wgt to be set
to inf, and that in turn causes gsl_monte_vegas_integrate to return nan.
The logical fix seems to be to treat any value of var satisfying
1.0/var==inf as zero, i.e.

-    if (var > 0)
+    if (var > 0 && gsl_finite(1.0 / var))

I don't know if that would break anything else, but I can't imagine how.
Thoughts?

I can send a proper patch file if desired (it's on my other computer).

 David



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Mon 23 Mar 2015 08:21:35 PM GMT  Name: gsl_vegas_bug_demo.c  Size: 2kB  
By: psa

<http://savannah.gnu.org/bugs/download.php?file_id=33433>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?44612>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]