Issue 14730

Summary: pseudorandom number generator -> mersenne twister
Product: Calc Reporter: tristanb <tristan_burtenshaw>
Component: codeAssignee: AOO issues mailing list <issues>
Status: ACCEPTED --- QA Contact:
Severity: Trivial    
Priority: P4 CC: ace_dent, issues
Version: 644m11   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
URL: http://www.math.keio.ac.jp/~matumoto/emt.html
See Also: https://issues.apache.org/ooo/show_bug.cgi?id=121421
Issue Type: FEATURE Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Original paper with some C code. none

Description tristanb 2003-05-22 07:31:17 UTC
i'm probably embarassing myself saying this, as i'm no expert.

I'm assuming that the random number generator OOo uses is just an 
implementation of the math.h one. (As i can find no previous issues mentioning 
it.)

Would it be possible to instead use the Mersenne Twister algorithm? (see url) 
It is faster than rand() and much more 'random'. It is under the the BSD 
license.

This could replace all calc's current random functions, or new MT functions 
merely added.

This would improve its desirability for use as a simple statistical modeller.
Comment 1 frank 2003-05-22 08:25:49 UTC
Hi Bettina,

1 4 u

Frank
Comment 2 ace_dent 2007-06-07 14:09:04 UTC
URL is no longer available, but web pages have been cached via Internet Archive:
http://www.archive.org/web/web.php

I will upload the pdf from the original author.
Comment 3 ace_dent 2007-06-07 14:10:13 UTC
Created attachment 45730 [details]
Original paper with some C code.
Comment 4 bettina.haberer 2010-05-21 15:09:28 UTC
To grep the issues easier via "requirements" I put the issues currently lying on
my owner to the owner "requirements". 
Comment 5 Pedro Giffuni 2012-12-07 16:00:11 UTC
Mersenne Twister is available as an extension (MTRNG).

For the time being I would like to offer different options for users so I implemented Wichmann-Hill 2006 in revision 1416271 which should cover all the needs for Calc users.

This said, Mersenne Twister is actually better (much better period) and replacing the C code with the algorithm in the paper should be relatively straightforward. If the WH-2006 shows to be insufficient or have problems we could review the code and plug in the new algorithm relatively easily.