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 13:31:00 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0

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

It would be fun to have bragging rights to an algorithm which is both faster
than Matlab and unbiased so I tried implementing the "new" algorithm in the
paper in randi_new.cpp.  The author outlined the algorithm, and also provided
a code implementation for L=64.  Because we have L=53 I could not use his code
directly and instead coded the algorithm as I understood it.  What I found was
that it worked for small values of imax, but hung in an essentially infinite
loop for large values.  That may be my misunderstanding, but I wasn't super
motivated to find out.  The algorithm relies on 128-bit unsigned data types,
which g++ does support, but they are not part of the C++ standard and so there
would need to be some extra work in the configure script to determine which
compiler was being used, whether 128-bit primitives were supported, and a
fallback mechanism if they were not.

    _______________________________________________________

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]