help-octave
[Top][All Lists]
Advanced

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

Re: fntest.m results in test directry on cygwin octave : check rand.cc


From: Tatsuro MATSUOKA
Subject: Re: fntest.m results in test directry on cygwin octave : check rand.cc
Date: Fri, 28 Dec 2007 05:34:27 +0900 (JST)

Hi David
Thank you for your reply and  patch.
However you made a small mistake in the patch

    `assert(OBSERVED, EXPECTED, TOL)'
          Accept a tolerance when comparing numbers.  If TOL is
          possitive use it as an absolute tolerance, will produce an
          error if `abs(OBSERVED - EXPECTED) > abs(TOL)'.  If TOL is
          negative use it as a relative tolerance, will produce an
          error if `abs(OBSERVED - EXPECTED) > abs(TOL * EXPECTED)'.
          If EXPECTED is zero TOL will always be used as an absolute
          tolerance.                         

Then
! %! assert(randp(1e9,1,6),[1000006208 1000012224 999981120 999963520 999963072 
999981440],1e-6)
should be 
! %! assert(randp(1e9,1,6),[1000006208 1000012224 999981120 999963520 999963072 
999981440],-1e-6)

After that it went well.  Thanks!
 src/DLD-FUNCTIONS/rand.cc .............................. PASS   57/57

Regards
Tatsuro

--- David Bateman <address@hidden> wrote:

> Tatsuro MATSUOKA wrote:
> > Hello
> > 
> > I have not carried out make check on the cygwin because run_octave did not 
> > work.
> > Today I have found the test directory in the extracted source file 
> > directories and carried out
> the
> > 'fntests'. 
> > 
> > ********************************
> > Summary:
> > 
> >   PASS   2617
> >   FAIL      2
> > 
> > There was 1 expected failure (see fntests.log for details).
> > 
> > Expected failures are known bugs. Please help improve
> > Octave by contributing fixes for them.
> > 
> > 1514 (of 1667) files have no tests.  Please help improve Octave by
> > contributing tests for these files (see the list in the file fntests.log).
> > error: can't perform indexing operations for <unknown type> type
> > *******************
> > 
> > I checked the fntests.log.
> > **************** 
> >>>>>> processing 
> >>>>>> /usr/tatsu/cygwin/octave/octave-3.0.0/src/DLD-FUNCTIONS/rand.cc
> >   ***** test
> >  % Test fixed state
> >  randp("seed",1);
> >  assert(randp(1e9,1,6),[1000006208 1000012224 999981120 999963520 999963072 
> > 999981440])
> > !!!!! test failed
> > error: assert (randp (1e9, 1, 6),[1000006208, 1000012224, 999981120, 
> > 999963520, 999963072,
> 999981440])
> > expected
> >    1.0000e+09   1.0000e+09   9.9998e+08   9.9996e+08   9.9996e+08   
> > 9.9998e+08
> > but got
> >    1.0000e+09   1.0000e+09   9.9998e+08   9.9996e+08   9.9996e+08   
> > 9.9998e+08
> > values do not match
> > shared variables {
> >   __random_statistical_tests__ = 0
> > }
> > ****************
> > So I have carried out.
> > 
> > octave:1>  randp("seed",1);
> > octave:2> format long
> > octave:5> assert(randp(1e9,1,6),[1000006208 1000012224 999981120 999963520 
> > 999963072
> 999981440])
> > error: assert (randp (1e9, 1, 6),[1000006208, 1000012224, 999981120, 
> > 999963520,
> > 999963072, 999981440]) expected
> >    1000006208   1000012224    999981120    999963520    999963072    
> > 999981440
> > but got
> >    1000006225   1000012251    999981100    999963538    999963053    
> > 999981432
> > values do not match
> > 
> > I think this difference is trivial and perhaps comes from the 
> > implementation of rand()
> function on
> > cygwin gcc is different from the gcc on other platforms.
> > 
> > Is this right? Can I ignore the difference?
> > 
> > Regards
> > 
> > Tatsuro
> 
> 
> This is to do with the way the pascal distribution with large lambda is
> calculated, and it seems that there are still a few differences for
> large lambda's depending on the processors floating point arithmetic.
> There is an error limit for the new generators (the  ones where the
> state is set), but not for the old generators (using the seed). The
> attached patch should at least hide this trivial issue.
> 
> D.
> 
> > Index: src/DLD-FUNCTIONS/rand.cc
> ===================================================================
> RCS file: /usr/local/cvsroot/octave/src/DLD-FUNCTIONS/rand.cc,v
> retrieving revision 1.43
> diff -c -r1.43 rand.cc
> *** src/DLD-FUNCTIONS/rand.cc 13 Nov 2007 18:02:52 -0000      1.43
> --- src/DLD-FUNCTIONS/rand.cc 27 Dec 2007 07:33:51 -0000
> ***************
> *** 950,956 ****
>   %!test
>   %! % Test fixed state
>   %! randp("seed",1);
> ! %! assert(randp(1e9,1,6),[1000006208 1000012224 999981120 999963520 
> 999963072 999981440])
>   %!test
>   %! if (__random_statistical_tests__)
>   %!   % statistical tests may fail occasionally.
> --- 950,956 ----
>   %!test
>   %! % Test fixed state
>   %! randp("seed",1);
> ! %! assert(randp(1e9,1,6),[1000006208 1000012224 999981120 999963520 
> 999963072 999981440],1e-6)
>   %!test
>   %! if (__random_statistical_tests__)
>   %!   % statistical tests may fail occasionally.
> > _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
> 



--------------------------------------
Easy + Joy + Powerful = Yahoo! Bookmarks x Toolbar
http://pr.mail.yahoo.co.jp/toolbar/


reply via email to

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