Issue 14730 - pseudorandom number generator -> mersenne twister
Summary: pseudorandom number generator -> mersenne twister
Status: ACCEPTED
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: 644m11
Hardware: PC Windows 2000
: P4 Trivial with 3 votes (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL: http://www.math.keio.ac.jp/~matumoto/...
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-22 07:31 UTC by tristanb
Modified: 2013-02-07 22:19 UTC (History)
2 users (show)

See Also:
Issue Type: FEATURE
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Original paper with some C code. (397.91 KB, application/pdf)
2007-06-07 14:10 UTC, ace_dent
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
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.