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: David Bateman
Subject: Re: fntest.m results in test directry on cygwin octave : check rand.cc
Date: Thu, 27 Dec 2007 08:36:18 +0100
User-agent: Thunderbird 1.5.0.7 (X11/20060921)

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.

reply via email to

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