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

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

[Octave-bug-tracker] [bug #54619] randi() is biased


From: Rik
Subject: [Octave-bug-tracker] [bug #54619] randi() is biased
Date: Mon, 10 Sep 2018 14:00:31 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0

Follow-up Comment #23, bug #54619 (project octave):

Going forward, I have other bug reports that I want to sqaush so I won't be
working on this.  My suggestion would be implement the functionality in
liboctave in oct-rand.cc or a combination of oct-rand.cc and randmtzig.cc. 
The interpreter then needs a way to access the new functionality.  I would
probably put that in libinterp/corefcn/rand.cc.  There is code in rand.cc, or
fill_matrix() in data.cc, for extracting the dimensions from a variable number
of input arguments which could be borrowed for randi input processing.

For the moment I would prefer to keep rand returning values within [0,2^53). 
The base data type in Octave is a double with only 53 bits of precision and I
fear introducing more bias during the conversion from 64 to 53 bits.  Also,
minimal change necessary to solve the problem seems best from a software
engineering perspective.

There is still a good GSOC project here to convert to using C++ standard
libraries for random numbers.  Maybe simultaneously with that project we could
investigate the impact of returning a uint64_t from an internal API.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?54619>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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