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

## [Octave-bug-tracker] [bug #37613] Octave precision/accuracy is much lowe

 From: anonymous Subject: [Octave-bug-tracker] [bug #37613] Octave precision/accuracy is much lower for quadgk Date: Mon, 22 Oct 2012 13:59:37 +0000 User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1

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

Summary: Octave precision/accuracy is much lower  for quadgk
Project: GNU Octave
Submitted by: None
Submitted on: Mon 22 Oct 2012 01:59:36 PM UTC
Category: Libraries
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Inaccurate Result
Status: None
Assigned to: None
Originator Name: Pramod Kumbhar
Open/Closed: Open
Discussion Lock: Any
Release: 3.4.3
Operating System: Any

_______________________________________________________

Details:

Hello All,

I am new to Octave and running Matlab code on Octave 3.4.3. I am getting
incorrect results for my simulations, basically because of lower

For example, say we have

f = @(x)x.^5.*exp(-x).*sin(x);

In Matlab I get:

q      = -1.499999999999836e+01
errbnd =  9.438576028474561e-09

But in the Octave, I get

warning: quadgk: Error tolerance not met. Estimated error 0.0329476
q      = -1.49999941897813e+01
errbnd =  3.29475856720323e-02

>From above simple test, I see Octave accuracy is very low.

To find the cause of this, I loooked into the implementation of quadgk routine

The problem is, when one of the limit of integral is Inf, current
implementation don't divide subintervals further due to below condition (line
no 322):

if (any (abs (diff (trans (subs), [], 2) / h0) < 100 * myeps))
.....
break
endif

When a or b is Inf, h0 is Inf and hence code returns results with very low
accuracy.

I am not a mathematician and not sure if this is expected behaviour. But
simply removing above check we get more accurate results similar to Matlab.

results?

Regards,
Pramod.

_______________________________________________________

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

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

```