octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #33055] Serious problem with quadgk with exp(-


From: M. Badawy
Subject: [Octave-bug-tracker] [bug #33055] Serious problem with quadgk with exp(-s.^2) from -Inf to 0
Date: Tue, 12 Apr 2011 07:05:02 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.16 (KHTML, like Gecko) Chrome/10.0.648.204 Safari/534.16

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

                 Summary: Serious problem with quadgk with exp(-s.^2) from
-Inf to 0
                 Project: GNU Octave
            Submitted by: firstharmonic
            Submitted on: Tue 12 Apr 2011 07:05:01 AM GMT
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.2.4
        Operating System: GNU/Linux

    _______________________________________________________

Details:

I got the following from the terminal:

>>> quadgk(@(s) exp(-s.^2), -Inf, 0)
ans = -0.24489

First, this is a positive function, so the answer can't be negative. 

Second, the answer should be equal to: sqrt(pi)/2 =  0.88623.

Despite this problem, Octave gets the right answer for:

>>> quadgk(@(s) exp(-s.^2), -Inf, Inf)
ans =  1.7725   ( = sqrt(pi))

and

>>> quadgk(@(s) exp(-s.^2), 0,  Inf)
ans =  0.88623   ( = sqrt(pi)/2) 

In my research, I encountered the same problem when using quadgk with an even
integrand integrating from -Inf to 0.

Hope this helps. 




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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