bugGNU Octave - Bugs: bug #33863, One test fails in quadl.m (MinGW)

 
 

bug #33863: One test fails in quadl.m (MinGW)

Submitter:  Tatsuro MATSUOKA <tmacchant>
Submitted:  Tue 26 Jul 2011 04:29:56 AM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Microsoft Windows
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Mon 19 Dec 2011 09:54:49 AM UTC, comment #16: 

I have confirmed the fix. Thanks!

Tatsuro MATSUOKA <tmacchant>
Mon 19 Dec 2011 05:18:44 AM UTC, comment #15: 

I relaxed the tolerance to -1.1e-15 (http://hg.savannah.gnu.org/hgweb/octave/rev/6eeb9e8e63cf) and it should work now.  This will be part of the 3.6.0 release.


Rik <rik5>
Group administrator
Sun 18 Dec 2011 09:19:08 PM UTC, comment #14: 

I have attached trace.txt.
Hope this result is useful.

(file #24626)

Tatsuro MATSUOKA <tmacchant>
Fri 16 Dec 2011 06:49:37 PM UTC, comment #13: 

Tatsuro,

Maybe we debug this by running the "TRACE" feature of quadl to output the intermediate results.

Can you try the following commands and attach the output, "trace.txt", to this bug report.


diary trace.txt
clear all
format long
quadl (@(x) sin (3*x).*cosh (x).*sinh (x),10,15, [], true)
diary off


Rik <rik5>
Group administrator
Mon 03 Oct 2011 08:08:13 AM UTC, comment #12: 

Rik,

you are right. I checked your result with maxima. I cannot reproduce my old "exact" value. Sorry for the noise.

Marco

Marco Caliari <caliari>
Group Member
Mon 03 Oct 2011 03:21:39 AM UTC, comment #11: 

Marco suggested that the exact value for the integral test that is failing is incorrect in the last digit.  I'm unable to verify this.  I used the website wolframalpha.com which provides a front end to Mathematica and their arbitrary precision output.  The value for the integral in question is attached as .gif.  Mathematica believes the current value for the integral (2.588424538641647e+10) is correct.

This means that there will still be one test failing for quadl.m on the MinGW platform.

(file #24087)

Rik <rik5>
Group administrator
Sun 02 Oct 2011 03:02:27 PM UTC, comment #10: 

Re-titling bug report now that only one issue remains.

Rik <rik5>
Group administrator
Fri 26 Aug 2011 03:36:28 AM UTC, comment #9: 

Sorry I have misled

The result for quad (but not quadl)
octave:3> quad (@(x) sin (3*x).*cosh (x).*sinh (x),10,15)
ans =  25884245386.4172

is little differ from that by quadl.

However, the last digit may be corrected as Marco said

Tatsuro MATSUOKA <tmacchant>
Fri 26 Aug 2011 02:39:24 AM UTC, comment #8: 

Follow-up Comment #7: (Rik)

The error with quadl and large tolerances has been fixed in this changeset
(http://hg.savannah.gnu.org/hgweb/octave/rev/85dac13a911b).  If you can verify this then we can close the bug report.

The changeset solved the first error.

The second error is not related the above changeset.


octave:2> test quadl
  ***** assert (quadl (@(x) sin (3*x).*cosh (x).*sinh (x),10,15),
         2.588424538641647e+10, -9e-15)
!!!!! test failed
assert (quadl (@(x) sin (3 * x) .* cosh (x) .* sinh (x), 10, 15),2.588424538641647e+10,-9e-15) expected
 25884245386.4165
but got
 25884245386.4162
maximum relative error 1.04636e-014 exceeds tolerance 9e-015
octave:3> quad (@(x) sin (3*x).*cosh (x).*sinh (x),10,15)
ans =  25884245386.4172


As Marco pointed out, the change

-%!         2.588424538641647e+10, -9e-15)
+%!         2.588424538641642e+10, -9e-15)

should be attached.

Regards

Tatsuro

Tatsuro MATSUOKA <tmacchant>
Thu 25 Aug 2011 05:04:25 PM UTC, comment #7: 

The error with quadl and large tolerances has been fixed in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/85dac13a911b).  If you can verify this then we can close the bug report.

Rik <rik5>
Group administrator
Thu 18 Aug 2011 12:05:29 AM UTC, comment #6: 

Sorry for my late reply.

The change you have shown

-%!         2.588424538641647e+10, -9e-15)
+%!         2.588424538641642e+10, -9e-15)


is OK for the MinGW build.

Regards

Tatsuro

Tatsuro MATSUOKA <tmacchant>
Tue 09 Aug 2011 06:50:02 AM UTC, comment #5: 

Dear Tatsuro,

the last digit in the reference solution is wrong. I think you should change your changeset into


-%!         2.588424538641647e+10, -9e-15)
+%!         2.588424538641642e+10, -9e-15)


Do you confirm that with 2 instead of 7 as last digit, you get a relative error < 9e-15 on MinGW?

Marco

Marco Caliari <caliari>
Group Member
Tue 09 Aug 2011 05:44:42 AM UTC, comment #4: 

I will propose a changeset the below to avoid error on the MinGW platform


# HG changeset patch
# User Tatsuro Matsuoka <tmacchant@yahoo.co.jp>
# Date 1312868193 -32400
# Node ID a026c9007420c2bd090256cf068a932592106a6b
# Parent  9f2679a1436686171d1facd918acf83d0347c31d
Increase relative tolerance of one the test of quadl.m

diff -r 9f2679a14366 -r a026c9007420 scripts/general/quadl.m
--- a/scripts/general/quadl.m   Mon Aug 08 21:31:55 2011 -0700
+++ b/scripts/general/quadl.m   Tue Aug 09 14:36:33 2011 +0900
@@ -201,7 +201,7 @@

 ## the values here are very high so it may be unavoidable that this fails
 %!assert ( quadl (@(x) sin (3*x).*cosh (x).*sinh (x),10,15),
-%!         2.588424538641647e+10, -9e-15)
+%!         2.588424538641647e+10, -2e-14)

 ## extra parameters
 %!assert (quadl (@(x,a,b) sin (a + b*x), 0, 1, [], [], 2, 3),


Tatsuro MATSUOKA <tmacchant>
Thu 04 Aug 2011 09:28:44 PM UTC, comment #3: 

Hello Macro


For the first erro, you are right. Can you make a changeset for the test?

Regards

Tatsuro

Tatsuro MATSUOKA <tmacchant>
Mon 01 Aug 2011 02:28:45 PM UTC, comment #2: 

Dear Tatsuro,

regarding the first failure, do you know that quadl uses a default relative tolerance equal to eps? Then,


abs(quadl(@(x) sin(3*x).*cosh(x).*sinh(x),10,15)-exact)/exact
ans =  8.40038953790526e-15


which is not eps, but still quite good (and less than 9e-15). About the value of exact, it seems that the value provided in the test is wrong in the last digit: in fact, I also get


exact = 2.588424538641647e+10;
abs(quadl(@(x) sin(3*x).*cosh(x).*sinh(x),10,15)-exact)/exact
ans =  1.04636431086188e-14


but if I use the exact value


exact = 25884245386.416416168212890625


everything is fine. Regarding the second failure, I will say something in #33792.

Marco

Marco Caliari <caliari>
Group Member
Tue 26 Jul 2011 05:25:57 AM UTC, comment #1: 

The second fail is the same as
http://savannah.gnu.org/bugs/?33792

Tatsuro MATSUOKA <tmacchant>
Tue 26 Jul 2011 04:29:56 AM UTC, original submission:  

Hello

I have encountered two test fails in quadl.m


  ***** assert ( quadl (@(x) sin (3*x).*cosh (x).*sinh (x),10,15),
         2.588424538641647e+10, -9e-15)
!!!!! test failed
assert (quadl (@(x) sin (3 * x) .* cosh (x) .* sinh (x), 10, 15),2.588424538641647e+10,-9e-15) expected
2.5884e+010
but got
2.5884e+010
maximum relative error 1.04636e-014 exceeds tolerance 9e-015



  ***** assert ( quadl (@(x) sin (2 + 3*x).^2, 0, 10, 0.3, []),
        (60 + sin(4) - sin(64))/12, -0.3)
!!!!! test failed
assert (quadl (@(x) sin (2 + 3 * x) .^ 2, 0, 10, 0.3, []),(60 + sin (4) - sin (64)) / 12,-0.3) expected
 4.8603
but got
 8.1963
maximum relative error 0.686392 exceeds tolerance 0.3


For the first fail,

> quadl (@(x) sin (3 x) . cosh (x) .* sinh (x), 10, 15) - 2.588424538641647e+10

ans = -2.70843505859375e-004

Error seems large.

For second fail, error is apparently large.
I tried


octave:8> quad (@(x) sin (2 + 3 * x) .^ 2, 0, 10, 0.3, [])
warning: implicit conversion from null_matrix to real vector
ans =  4.86026428887461


quadl does not work correctly in some cases.

Regards

Tatsuro

Tatsuro MATSUOKA <tmacchant>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #24626:  trace.txt added by tmacchant (39KiB - text/plain)
file #24087:  integral.gif added by rik5 (8KiB - image/gif)

 

Depends on the following items: None found

Items that depend on this one

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by caliari (Posted a comment)
  • -email is unavailable- added by tmacchant (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-12-19 rik5 StatusNeed Info Fixed
        Open/ClosedOpen Closed
    2011-12-18 tmacchant Attached File- Added trace.txt, #24626
    2011-11-30 rik5 Dependencies- bugs #34942 is dependent
    2011-10-03 rik5 Attached File- Added integral.gif, #24087
    2011-10-02 rik5 SummaryTwo test fails in quadl.m (dev. source MinGW) One test fails in quadl.m (MinGW)
    2011-08-25 rik5 StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code