JP2001067207A - Normal random number generating device, and recording medium - Google Patents

Normal random number generating device, and recording medium

Info

Publication number
JP2001067207A
JP2001067207A JP24301199A JP24301199A JP2001067207A JP 2001067207 A JP2001067207 A JP 2001067207A JP 24301199 A JP24301199 A JP 24301199A JP 24301199 A JP24301199 A JP 24301199A JP 2001067207 A JP2001067207 A JP 2001067207A
Authority
JP
Japan
Prior art keywords
random number
normal random
pool
random numbers
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP24301199A
Other languages
Japanese (ja)
Other versions
JP3580737B2 (en
Inventor
Brent Richard
ブレント リチャード
Makoto Nakanishi
誠 中西
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Australian National University
Fujitsu Ltd
Original Assignee
Australian National University
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Australian National University, Fujitsu Ltd filed Critical Australian National University
Priority to JP24301199A priority Critical patent/JP3580737B2/en
Publication of JP2001067207A publication Critical patent/JP2001067207A/en
Application granted granted Critical
Publication of JP3580737B2 publication Critical patent/JP3580737B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To make automatically generable a highly reliable normal random number corresponding to interface specification fast by repeatedly generating and storing other normal random numbers and outputting some of them by switching a 1st and a 2nd pool. SOLUTION: According to normal random numbers taken out of a pool 1 and a pool 2, new normal random numbers are generated and stored in the pool 2 and pool 1. Some of the normal random numbers which are generated and stored in the pools 1 and 2 are taken out and stored in an output buffer in order and when a specified number of normal random numbers are stored in the output buffer, they are returned together to a request source. Namely, new normal random numbers are generated fast according to normal random numbers of the pool 1 and pool 2 and some of them are outputted; and a return to the beginning is made when the generation is repeated as many times as specified by switching the pools 1 and 2, thus repeatedly generating uniform random numbers. Simulation, etc., can, therefore, be made fast.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は、正規乱数を高速に生成
する正規乱数生成装置および記録媒体に関するものであ
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a normal random number generating device for generating normal random numbers at high speed and a recording medium.

【0002】[0002]

【従来の技術】従来、シミュレーションなどを行うとき
に必要となる正規分布を持った乱数(正規乱数という)
を生成する場合、Pola法と呼ばれる方法で正規乱数
を生成していた。
2. Description of the Related Art Conventionally, a random number having a normal distribution required for performing a simulation or the like (referred to as a normal random number).
Is generated, a normal random number is generated by a method called the Pola method.

【0003】Pola法は、基本的に以下の手順で一様
乱数を使って正規乱数を生成している。 ステップ1:[−1,1]の区間の一様乱数を生成す
る。
In the Pola method, normal random numbers are generated using uniform random numbers in the following procedure. Step 1: Generate a uniform random number in the section [-1, 1].

【0004】 ステップ2:s←x2+y2 ステップ3:s≧1なら goto 1.さもなければ
goto 4. ステップ4:r←{−2ln(s)/s}1/2 ステップ5:ステップ4の結果を要求元に返す。
Step 2: s ← x 2 + y 2 Step 3: If s ≧ 1, goto 1. Otherwise goto 4. Step 4: r ← {−2ln (s) / s} 1/2 Step 5: Return the result of Step 4 to the request source.

【0005】ステップ6:要求された正規乱数の数分だ
け、ステップ1からステップ5を繰り返す。
Step 6: Steps 1 to 5 are repeated for the number of requested normal random numbers.

【0006】[0006]

【発明が解決しようとする課題】上述したPola法に
よる正規乱数の生成手法では、正規乱数を生成する毎に
ステップ4で自然対数および平方根などの演算を計算機
では近似計算を行う関係で非常に多くの計算時間を必要
としてしまい、シミュレーションなどで数百万(106)
の正規乱数を必要とする場合には非常に多くの時間が必
要となってしまう問題があった。
In the method of generating normal random numbers according to the Pola method described above, every time a normal random number is generated, the calculation such as the natural logarithm and the square root is carried out in step 4 because the computer performs an approximate calculation. Calculation time is required, and several million (10 6 )
When a normal random number is required, there is a problem that a very long time is required.

【0007】本発明は、これらの問題を解決するため、
インタフェースで指定された情報をもとに一様乱数を生
成してこれをもとに正規乱数を生成してプールに格納
し、当該プールの正規乱数をもとに新たな正規乱数を高
速生成して他のプールに格納すると共にその一部を出力
し、プールを切替えて所定回数繰り返したときに最初に
戻り異なる一様乱数の生成などを繰り返し、インタフェ
ース指定に対応した信頼性の高い正規乱数を自動的に高
速生成することを目的としている。
[0007] The present invention solves these problems,
Generates a uniform random number based on the information specified by the interface, generates a normal random number based on this, stores it in the pool, and generates a new normal random number at high speed based on the normal random number in the pool. The pool is stored in another pool and a part of it is output, and when the pool is switched and repeated a predetermined number of times, it returns to the beginning and repeats generation of a different uniform random number, etc. The purpose is to generate automatically at high speed.

【0008】[0008]

【課題を解決するための手段】図1を参照して課題を解
決するための手段を説明する。図1において、S2は、
一様乱数を生成して正規乱数を生成し、プール1に入れ
たりなどする。
Means for solving the problem will be described with reference to FIG. In FIG. 1, S2 is
For example, a uniform random number is generated to generate a normal random number, and the generated random number is put into the pool 1.

【0009】S5、S6は、プールから取り出した正規
乱数から他の正規乱数を生成したりなどする。S9は、
他の正規乱数を生成した生成回数が所定値(例えば10
00回)を越えたときに、一様乱数から正規乱数を生成
してプールに格納したりなどするものである。
In steps S5 and S6, other normal random numbers are generated from the normal random numbers extracted from the pool. S9 is
The number of generations of other normal random numbers is a predetermined value (for example, 10
(00 times), a normal random number is generated from a uniform random number and stored in a pool.

【0010】次に、動作を説明する。S2で一様乱数を
生成して生成された一様乱数をもとに正規乱数を生成
し、生成された正規乱数をプール1に格納し、S5でプ
ール1に格納された正規乱数をもとに他の正規乱数を生
成し、生成された他の正規乱数をプール2に格納すると
共に生成された他の正規乱数から一部を取り出し、出力
した正規乱数の数が指定数に到達しないときにプール1
とプール2とを切替えて他の正規乱数を生成・格納およ
びその一部を出力することを繰り返えすようにしてい
る。
Next, the operation will be described. A normal random number is generated based on the uniform random number generated by generating the uniform random number in S2, the generated normal random number is stored in the pool 1, and the normal random number stored in the pool 1 is stored in S5. Generates another normal random number, stores the generated other normal random number in the pool 2 and extracts a part from the generated other normal random number. When the number of output normal random numbers does not reach the specified number, Pool 1
And pool 2 to generate and store another normal random number and output a part of the random number.

【0011】この際、S9で所定回数だけ他の正規乱数
の生成を繰り返したときに一様乱数を生成してこれをも
とに新たな正規乱数を生成してプールに格納し、他の正
規乱数の生成を再開するようにしている。
At this time, when the generation of another normal random number is repeated a predetermined number of times in S9, a uniform random number is generated, a new normal random number is generated based on the uniform random number, and stored in a pool. The random number generation is restarted.

【0012】また、一様乱数を生成するときに必要な情
報、一様乱数をもとに正規乱数を生成するときに必要な
情報、正規乱数から他の正規乱数を生成するときに必要
な情報、他の正規乱数の一部を出力するときに必要な情
報、一様乱数を再生成して新たな正規乱数を生成すると
きに必要な情報のうちの少なくとも1つ以上を設定した
インタフェースを設け、インタフェースに従い正規乱数
を生成して出力するにしている。
Further, information necessary for generating a uniform random number, information necessary for generating a normal random number based on the uniform random number, and information necessary for generating another normal random number from the normal random number. An interface that sets at least one of information necessary for outputting a part of another normal random number and information necessary for generating a new normal random number by regenerating a uniform random number. , A normal random number is generated and output according to the interface.

【0013】従って、インタフェースで指定された情報
をもとに一様乱数を生成してこれをもとに正規乱数を生
成してプールに格納し、プールの正規乱数をもとに新た
な正規乱数を高速生成して他のプールに格納すると共に
その一部を出力し、プールを切替えて所定回数繰り返し
たときに最初に戻り異なる一様乱数の生成などを繰り返
すことにより、インタフェース指定に対応した信頼性の
高い正規乱数を自動的に高速生成することが可能とな
る。
Therefore, a uniform random number is generated based on the information specified by the interface, a normal random number is generated based on the random number, stored in the pool, and a new normal random number is generated based on the pool's normal random number. , Which is generated at high speed and stored in another pool, and a part of it is output. When the pool is switched and repeated a predetermined number of times, it returns to the beginning and repeats generation of different uniform random numbers, etc. It is possible to automatically generate high-speed normal random numbers automatically.

【0014】[0014]

【実施例】次に、図1から図4を用いて本発明の実施の
形態および動作を順次詳細に説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Next, the embodiment and operation of the present invention will be described in detail sequentially with reference to FIGS.

【0015】図1は、本発明の動作説明図を示す。図1
において、S1は、変数seedがゼロか判別する。Y
ESの場合には、変数seedがゼロであって、最初と
判明したので、S2に進む。NOの場合には、S3に進
む。
FIG. 1 is a diagram for explaining the operation of the present invention. FIG.
In S1, it is determined whether the variable seed is zero. Y
In the case of ES, since the variable seed is zero and has been found to be the first, the process proceeds to S2. In the case of NO, the process proceeds to S3.

【0016】S2は、 ・一様乱数を生成して正規乱数を生成する。これは、例
えば既述したPola法により初回のみ正規乱数を生成
する。具体的には、インタフェース情報で指定された初
期値(正の整数)をもとに一様乱数を生成し、次に、こ
の生成した一様乱数をもとに正規乱数を生成する。
In step S2, a uniform random number is generated to generate a normal random number. In this method, for example, a normal random number is generated only for the first time by the Pola method described above. Specifically, a uniform random number is generated based on an initial value (positive integer) specified by the interface information, and then a normal random number is generated based on the generated uniform random number.

【0017】・プール1に入れる。これは、生成した正
規乱数をプール1に格納する(図3の(a)のプール1
に格納する)。 ・変数ip=1とし、正規乱数をプール1に格納したこ
とを記憶しておく。
Put into pool 1. This means that the generated normal random numbers are stored in pool 1 (pool 1 in FIG. 3A).
To be stored). The variable ip = 1 is set, and the fact that the normal random number is stored in the pool 1 is stored.

【0018】・変数seedをゼロに設定する。S3
は、 ・a,b,c,d,θを決める。これは、各変数の値を
下記のようにして決める。
Set the variable seed to zero. S3
Determines a, b, c, d, and θ. This determines the value of each variable as follows.

【0019】・a,bは、a∈{3,5},b∈{7,
11}から一様に選ぶ。 ・c,dは、{0,1、・・・N−1}から一様にラン
ダムに選ぶ。 ・θは、後述する図3の(d)の斜線の範囲内で一様に
ランダムに選ぶ。
A and b are a∈ {3,5}, b∈ {7,
Select uniformly from 11}. C and d are uniformly and randomly selected from {0, 1,... N-1}. .Theta. Is uniformly and randomly selected within the range of the oblique line in FIG.

【0020】S4は、変数ip=1か判別する。YES
の場合には、S5に進む。NOの場合には、S6に進
む。S5は、 ・プール1から2N個の正規乱数で他の正規乱数を生成
し、プール2に入れる。これは、図3の(a)で後述す
るように、プール1から取り出した2N個の正規乱数
に、直交行列を演算して他の一様な新たな正規乱数を生
成し、プール2に入れる。
A step S4 decides whether or not the variable ip = 1. YES
In the case of, the process proceeds to S5. In the case of NO, the process proceeds to S6. S5: Generates another normal random number with 2N normal random numbers from pool 1 and puts it into pool 2. This is, as will be described later with reference to FIG. 3A, an orthogonal matrix is operated on 2N normal random numbers extracted from the pool 1 to generate another uniform new normal random number, which is put into the pool 2. .

【0021】・ip=2とする。 ・そのうち最初の1/f(例えば1/3)を出力バッフ
ァに書き出す。S6は、 ・プール2から2N個の正規乱数で他の正規乱数を生成
し、プール1に入れる。これは、図3の(a)で後述す
るように、プール2から取り出した2N個の正規乱数
に、直交行列を演算して他の一様な新たな正規乱数を生
成し、プール1に入れる。
It is assumed that ip = 2. Write the first 1 / f (for example, 1/3) of them to the output buffer. S6: Generates another normal random number with 2N normal random numbers from the pool 2 and puts it into the pool 1. This is, as will be described later with reference to FIG. 3A, an orthogonal matrix is operated on 2N normal random numbers taken out of the pool 2 to generate another uniform new normal random number and put into the pool 1. .

【0022】・ip=1とする。 ・そのうち最初の1/f(例えば1/3)を出力バッフ
ァに書き出す。S7は、正規乱数の生成回数を+1す
る。
It is assumed that ip = 1. Write the first 1 / f (for example, 1/3) of them to the output buffer. In step S7, the number of times of generation of the normal random number is incremented by one.

【0023】S8は、N個(ユーザ指定)の正規乱数を
出力したかを判別する。YESの場合には、終了する。
NOの場合には、S9に進む。S9は、正規乱数の生成
回数が1000回か判別する。YESの場合には、プー
ル1からプール2、およびプール2からプール1へ正規
乱数を取り出して直交変換して新たな一様な正規乱数を
生成して格納することを1000回行い、規則性が生じ
る危険性が生じたか判別する。YESの場合には、S2
に戻り、新たな初期値をもとに一様乱数を生成し、これ
をもとに新たなパラメタ(a,b,c,d,θ等)を用
いて正規乱数を生成してプール1に格納し、S4以降を
繰り返し、ユーザ指定の正規乱数の数分だけ出力するま
で繰り返す。
In S8, it is determined whether or not N (user-specified) normal random numbers have been output. If YES, the process ends.
In the case of NO, the process proceeds to S9. In step S9, it is determined whether the number of times of generation of the normal random number is 1,000. In the case of YES, normal random numbers are taken out from pool 1 to pool 2 and from pool 2 to pool 1 and orthogonally transformed to generate and store new uniform normal random numbers 1000 times. Determine if any dangers occur. In the case of YES, S2
To generate a uniform random number based on the new initial value, generate a normal random number based on the generated random number using new parameters (a, b, c, d, θ, etc.) and store the random number in the pool 1. The process is repeated, and the steps from S4 are repeated until the number of normal random numbers specified by the user is output.

【0024】以上によって、インタフェース情報で指定
された情報をもとに一様乱数を生成し、この一様乱数を
もとにインタフェース情報で指定されたパラメータ
(a,b,c,d,θなど)をもとに正規乱数を生成し
てプール1に格納し、プール1から取り出した正規乱数
をもとにインタフェース情報で指定されたパラメータ
(a,b,c,d,θなど)をもとに新たな正規乱数を
高速生成してプール2に格納することを繰り返し、イン
タフェース情報で指定された数の正規乱数を出力するこ
とにより、インタフェース情報(後述する図4参照)を
設定して入力するのみで自動的に指定した数の正規乱数
を取得することが可能となる。この際、正規乱数をもと
に新たな正規乱数を生成することで、従来のPola法
による一様乱数から正規乱数を生成するときの多くの時
間の必要となる演算(自然対数、平方根などの近似式を
用いたループ演算で通常の演算に比して約3倍以上の時
間が必要となる演算)がなくなり、極めて高速に多量の
一様な正規乱数を自動生成することが可能となる。
As described above, a uniform random number is generated based on the information specified by the interface information, and the parameters (a, b, c, d, θ, etc.) specified by the interface information are generated based on the uniform random number. ) Is generated and stored in the pool 1, and the parameters (a, b, c, d, θ, etc.) specified in the interface information are determined based on the normal random numbers extracted from the pool 1. The interface information (see FIG. 4 described later) is set and input by outputting the normal random numbers specified by the interface information repeatedly by repeatedly generating a new normal random number at high speed and storing it in the pool 2. It is possible to automatically obtain the specified number of normal random numbers only by using this function. At this time, by generating a new normal random number based on the normal random number, an operation (such as natural logarithm, square root, etc.) that requires much time when generating the normal random number from the uniform random number by the conventional Pola method is performed. This eliminates the need for a loop operation using an approximation formula that requires about three times or more the time required for a normal operation), and makes it possible to automatically generate a large amount of uniform normal random numbers extremely quickly.

【0025】図2は、本発明の説明図を示す。図2の
(a)は、正規乱数から新たな正規乱数を求める行列式
を示す。これは、公知のWallace法を変形したも
のであって、右辺の行列式で表される正規乱数にA(直
交行列)を演算して、左辺の新たな正規乱数を求める式
である。変数a,b,c,d,およびA(直交変数)の
変数θは(b)から(e)に示すように決定する。この
行列式を用いることにより、プール1/プール2から取
り出した正規乱数をもとに、新たな正規乱数を生成して
プール2/プール1に格納することが可能となる。
FIG. 2 shows an explanatory diagram of the present invention. FIG. 2A shows a determinant for obtaining a new normal random number from the normal random numbers. This is a modified version of the well-known Wallace method, and calculates A (orthogonal matrix) on a normal random number represented by the determinant on the right side to obtain a new normal random number on the left side. The variables a, b, c, d, and the variable θ of A (orthogonal variable) are determined as shown in (b) to (e). By using this determinant, new normal random numbers can be generated based on the normal random numbers extracted from pool 1 / pool 2 and stored in pool 2 / pool 1.

【0026】図2の(b)は、図2の(a)の変数a,
b,c,d,Nの大きさなどを示す。ここでは、図示の
下記のようである。 ・a>b>1でa,b,c、dは正の整数であり、この
とき、aとN、bとNは互いに素である。
FIG. 2 (b) shows the variables a,
The size of b, c, d, N, etc. is shown. Here, the following is illustrated. A>b> 1 and a, b, c and d are positive integers, where a and N and b and N are relatively prime.

【0027】図2の(c)は、図2の(a)の直交行列
の例を示す。ここでは、図示のような直交行列であっ
て、図示の下記のようなθの範囲を持つ。 ・π/6≦θ≦π/3 or 2π/3≦θ≦5π/6
であって、min(|sinθ|、|cosθ|)≧1
/2となり、t=tan(θ/2)を適当な区間の一様
乱数から生成して、cosθ、sinθを計算する。
FIG. 2C shows an example of the orthogonal matrix shown in FIG. Here, it is an orthogonal matrix as shown, and has a range of θ as shown below. Π / 6 ≦ θ ≦ π / 3 or 2π / 3 ≦ θ ≦ 5π / 6
Where min (| sin θ |, | cos θ |) ≧ 1
/ 2, t = tan (θ / 2) is generated from uniform random numbers in an appropriate section, and cos θ and sin θ are calculated.

【0028】図2の(d)は、生成された正規乱数のう
ち1/f(f≧3)をユーザに返却して、次のスプール
に使う様子を示す。図2の(e)は、a,b,c,dの
選び方を示す。ここでは、例えば ・a,bは各プールに対してa∈{3,5},b∈
{7,11}から、 ・c,dは{0,1・・・(N−1)}から一様にラン
ダムにそれぞれ選ぶ。
FIG. 2D shows that 1 / f (f ≧ 3) of the generated normal random numbers is returned to the user and used for the next spool. FIG. 2E shows how to select a, b, c, and d. Here, for example: a, b is a {3, 5}, b} for each pool
From {7, 11}, c and d are uniformly and randomly selected from {0, 1... (N-1)}.

【0029】図2の(f)は、長い正規乱数の生成の仕
方を示す。ここでは、1000N個(1000組)の正
規乱数を生成した後、よい一様乱数で新しく正規乱数を
生成することで更に、長い正規乱数の生成を可能にして
いる。
FIG. 2 (f) shows how to generate a long normal random number. Here, after generating 1000N (1000 sets) normal random numbers, new normal random numbers are generated with good uniform random numbers, thereby enabling generation of a longer normal random number.

【0030】図3は、本発明の説明図を示す。図3の
(a)は、プール例を示す。これは、既述した図1のS
2、S5、S6で生成した正規乱数を格納するメモリで
ある。図1のS5、S6では、プール1/プール2から
取り出した正規乱数をもとに、図2の(a)の行列式に
従い新たな正規乱数を生成してプール2/プール1に格
納することを、切替える態様で繰り返すためのものであ
る。
FIG. 3 shows an explanatory diagram of the present invention. FIG. 3A shows an example of a pool. This is equivalent to S
2, a memory for storing the normal random numbers generated in S5 and S6. In S5 and S6 of FIG. 1, new normal random numbers are generated in accordance with the determinant of FIG. 2A based on the normal random numbers extracted from pool 1 / pool 2 and stored in pool 2 / pool 1. Is repeated in a switching manner.

【0031】図3の(b)は、正規乱数をイメージ的に
示す。ここで、横軸は正規乱数の値を表し、縦軸はその
ときの正規乱数の頻度(個数)を表す。正規乱数は、図
示のように、正規分布をしており、全ての正規乱数の平
均値を中心に、所定の分散値を持つものである。
FIG. 3B schematically shows normal random numbers. Here, the horizontal axis represents the value of the normal random number, and the vertical axis represents the frequency (number) of the normal random number at that time. The normal random numbers have a normal distribution as shown in the figure, and have a predetermined variance around the average value of all the normal random numbers.

【0032】図3の(c)は、出力例を示す。生成され
たプール1,2に格納された正規乱数の一部(既述した
1/fで決る一部、例えば先頭から1/3の斜線の部
分)を取り出して出力バッファに順次格納し、出力バッ
ファに指定された数の正規乱数が格納されたときに、ま
とめて要求元に返却する。
FIG. 3C shows an output example. A part of the normal random numbers stored in the generated pools 1 and 2 (a part determined by 1 / f as described above, for example, a 1/3 hatched part from the beginning) is taken out, sequentially stored in an output buffer, and output. When the specified number of normal random numbers are stored in the buffer, they are returned together to the request source.

【0033】図3の(d)は、θの範囲を示す。既述し
た直交行列に使用するθの範囲は、計算誤差を小さくす
るために、図示の斜線の範囲内で、一様な乱数で決定す
る(既述した図2の(c)参照)。
FIG. 3D shows the range of θ. The range of θ used in the above-described orthogonal matrix is determined by a uniform random number within the range of the hatched portion in the drawing in order to reduce the calculation error (see the above-described FIG. 2C).

【0034】図4は、本発明のインタフェース例を示
す。これは、既述した図1のフローチャートに従い正規
乱数を生成するときの各種パラメータ(既述したa,
b,c,d,θ、正規乱数の出力数など)を指定するイ
ンタフェースであって、図示の下記のインタフェースに
必要な情報を設定して図1の処理を実行する関数(ルー
チン)に渡す(呼び出して渡す)のみで自動的に指定し
た条件のもとで生成した正規乱数を受取ることが可能と
なる。
FIG. 4 shows an example of an interface according to the present invention. This is because various parameters (a, a, and b described above) when generating a normal random number in accordance with the flowchart of FIG.
b, c, d, θ, the number of output of normal random numbers, etc.), and sets necessary information in the following interface shown in the figure and passes it to a function (routine) that executes the processing of FIG. 1 ( Call and pass), it is possible to receive a normal random number generated under automatically specified conditions.

【0035】CALL DVRANA(DAM,DS
D,IX,DA,N,DWORK,NWORK,ICO
N) DAM(入力):正規分布の平均m DSD(入力):正規分布の標準偏差 IX(入力):入力出発値(Seed),初回は正の整
数、2回目以降はゼロが返却される。
CALL DVRANA (DAM, DS
D, IX, DA, N, DWORK, NWORK, ICO
N) DAM (input): mean of normal distribution m DSD (input): standard deviation of normal distribution IX (input): input starting value (Seed), a positive integer for the first time, and zero for the second and subsequent times.

【0036】 DA(出力):N個の正規乱数 N(入力):DAに返却される正規乱数の個数 DWORK(作業域):大きさNWORKの1次元配列 NWORK(入力):配列DWORKの大きさ ICON(出力):コンディションコードDA (output): N normal random numbers N (input): number of normal random numbers to be returned to DA DWORK (work area): one-dimensional array of size NWORK NWORK (input): size of array DWORK ICON (output): Condition code

【0037】[0037]

【発明の効果】以上説明したように、本発明によれば、
インタフェースで指定された情報をもとに一様乱数を生
成してこれをもとに正規乱数を生成してプールに格納
し、プールの正規乱数をもとに新たな正規乱数を高速生
成して他のプールに格納すると共にその一部を出力し、
プールを切替えて所定回数繰り返したときに最初に戻り
異なる一様乱数の生成などを繰り返す構成を採用してい
るため、インタフェース指定に対応した信頼性の高い正
規乱数を自動的に高速生成できる。例えば従来技術の欄
で説明したPola法のときに正規乱数を生成する毎に
自然対数や平方根などの非常に時間のかかる場合に比し
て、本願発明では自然対数や平方根などのような近似式
を用いて演算に長時間かかる演算を無くして正規乱数の
生成を高速化できると共に、更に、行列式を用いて正規
乱数から新たな正規乱数を生成することでベクトル計算
機を使用して高速に多量の正規乱数を生成することが可
能となる。これらにより、多量の正規乱数を用いて行う
シュミレーションなどの高速化を図ることが可能とな
る。
As described above, according to the present invention,
Generates a uniform random number based on the information specified by the interface, generates a normal random number based on this, stores it in the pool, and generates a new normal random number at high speed based on the pool's normal random number. Store it in another pool and output part of it,
Since a configuration is adopted in which the pool returns to the beginning and repeats generation of a different uniform random number when repeated a predetermined number of times, a highly reliable normal random number corresponding to the interface designation can be automatically generated at high speed. For example, in the present invention, an approximate expression such as a natural logarithm or a square root is compared with a case where it takes a very long time such as a natural logarithm or a square root every time a normal random number is generated in the Pola method described in the section of the related art. , The generation of normal random numbers can be sped up by eliminating the operation that takes a long time, and the generation of new normal random numbers from the normal random numbers using a determinant allows high-speed generation of large numbers using a vector computer. Can be generated. Thus, it is possible to increase the speed of a simulation or the like performed using a large number of normal random numbers.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の動作説明図である。FIG. 1 is a diagram illustrating the operation of the present invention.

【図2】本発明の説明図(その1)である。FIG. 2 is an explanatory view (No. 1) of the present invention.

【図3】本発明の説明図(その2)である。FIG. 3 is an explanatory view (No. 2) of the present invention.

【図4】本発明のインタフェース例である。FIG. 4 is an example of an interface according to the present invention.

【符号の説明】[Explanation of symbols]

S2:一様乱数生成 S3:パラメータの生成 S5、S6:正規乱数から新たな正規乱数の生成 S9:新たな一様乱数/正規乱数の生成 S2: Generating uniform random numbers S3: Generating parameters S5, S6: Generating new normal random numbers from normal random numbers S9: Generating new uniform random numbers / normal random numbers

フロントページの続き (72)発明者 リチャード ブレント オーストラリア国、エーシーティ、0200、 キャンベラ(番地なし)、ジ オーストラ リアン ナショナル ユニバシティー内 (72)発明者 中西 誠 神奈川県川崎市中原区上小田中4丁目1番 1号 富士通株式会社内Continued on the front page (72) Inventor Richard Brent Australia, ACT, 0200, Canberra (no address), within the Australian National University (72) Inventor Makoto Nakanishi 4-1-1 Kamiodanaka, Nakahara-ku, Kawasaki City, Kanagawa Prefecture No. 1 Inside Fujitsu Limited

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】正規乱数を高速に生成する正規乱数生成装
置において、 一様乱数を生成する手段と、 上記生成された一様乱数をもとに正規乱数を生成する第
1の正規乱数生成手段と、 上記生成された正規乱数を格納する第1のプールと、 上記第1のプールに格納された正規乱数をもとに他の正
規乱数を生成する第2の正規乱数生成手段と、 上記生成された他の正規乱数を格納する第2のプール
と、 上記生成された他の正規乱数から一部を取り出して出力
する手段と、 上記出力した正規乱数の数が指定数に到達しないとき
に、上記第1のプールと上記第2のプールとを切替えて
他の正規乱数を生成およびその一部を出力することを繰
り返えさせる手段とを備えたことを特徴とする正規乱数
生成装置。
An apparatus for generating a normal random number at a high speed, comprising: means for generating a uniform random number; and first normal random number generating means for generating a normal random number based on the generated uniform random number. A first pool for storing the generated normal random numbers; a second normal random number generating means for generating another normal random number based on the normal random numbers stored in the first pool; A second pool for storing the other generated normal random numbers, means for extracting and outputting a part of the generated other normal random numbers, and when the number of the output normal random numbers does not reach the designated number, Means for switching between the first pool and the second pool to repeat generation of another normal random number and output of a part of the normal random number.
【請求項2】所定回数だけ上記他の正規乱数の生成を繰
り返したときに上記一様乱数を生成してこれをもとに新
たな正規乱数を生成して上記第1のプールに格納し、他
の正規乱数の生成を再開することを特徴とする請求項1
記載の正規乱数生成装置。
2. When the generation of the other normal random number is repeated a predetermined number of times, the uniform random number is generated, a new normal random number is generated based on the uniform random number, and stored in the first pool. 2. The method according to claim 1, wherein the generation of another normal random number is restarted.
The described normal random number generator.
【請求項3】上記一様乱数を生成するときに必要な情
報、上記一様乱数をもとに正規乱数を生成するときに必
要な情報、上記正規乱数から他の正規乱数を生成すると
きに必要な情報、上記他の正規乱数の一部を出力すると
きに必要な情報、上記一様乱数を再生成して新たな正規
乱数を生成するときに必要な情報のうちの少なくとも1
つ以上を設定したインタフェースを備え、 当該インタフェースに従い、上記正規乱数を生成して出
力することを特徴とする請求項1あるいは請求項2記載
の正規乱数生成装置。
3. The information required when generating the uniform random number, the information required when generating a normal random number based on the uniform random number, and the information required when generating another normal random number from the normal random number. At least one of necessary information, information necessary for outputting a part of the other normal random number, and information necessary for generating a new normal random number by regenerating the uniform random number.
3. The normal random number generation device according to claim 1, further comprising an interface in which at least one is set, generating and outputting the normal random number according to the interface.
【請求項4】一様乱数を生成する手段と、 上記生成された一様乱数をもとに正規乱数を生成する第
1の正規乱数生成手段と、 上記生成された正規乱数を第1のプールに格納する手段
と、 上記第1のプールに格納された正規乱数をもとに他の正
規乱数を生成する第2の正規乱数生成手段と、 上記生成された他の正規乱数を第2のプールに格納する
手段と、 上記生成された他の正規乱数から一部を取り出して出力
する手段と、 上記出力した正規乱数の数が指定数に到達しないとき
に、上記第1のプールと上記第2のプールとを切替えて
他の正規乱数を生成およびその一部を出力することを繰
り返えさせる手段として機能させるプログラムを記録し
たコンピュータ読取可能な記録媒体。
4. A means for generating a uniform random number, a first normal random number generating means for generating a normal random number based on the generated uniform random number, and a first pool for generating the generated normal random number. Means for generating another normal random number based on the normal random numbers stored in the first pool; and means for generating the other normal random numbers in the second pool. Means for extracting and outputting a part from the other generated normal random numbers; and when the number of the output normal random numbers does not reach a designated number, the first pool and the second pool And a computer-readable storage medium storing a program that functions as a means for repeating generation of another normal random number and output of a part of the random number by switching between the pools.
JP24301199A 1999-08-30 1999-08-30 Normal random number generator and recording medium Expired - Fee Related JP3580737B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP24301199A JP3580737B2 (en) 1999-08-30 1999-08-30 Normal random number generator and recording medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP24301199A JP3580737B2 (en) 1999-08-30 1999-08-30 Normal random number generator and recording medium

Publications (2)

Publication Number Publication Date
JP2001067207A true JP2001067207A (en) 2001-03-16
JP3580737B2 JP3580737B2 (en) 2004-10-27

Family

ID=17097568

Family Applications (1)

Application Number Title Priority Date Filing Date
JP24301199A Expired - Fee Related JP3580737B2 (en) 1999-08-30 1999-08-30 Normal random number generator and recording medium

Country Status (1)

Country Link
JP (1) JP3580737B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009070009A (en) * 2007-09-12 2009-04-02 Sony Corp Random number generation device and random number generation method
JP2010237961A (en) * 2009-03-31 2010-10-21 Institute Of National Colleges Of Technology Japan Apparatus, method and program for generating random number, and simulation apparatus
JP2013171549A (en) * 2012-02-23 2013-09-02 Nec Corp Random number processing device, method for processing random number, and program
JP2021051676A (en) * 2019-09-26 2021-04-01 富士通株式会社 Random number generation device and random number generation method

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009070009A (en) * 2007-09-12 2009-04-02 Sony Corp Random number generation device and random number generation method
JP2010237961A (en) * 2009-03-31 2010-10-21 Institute Of National Colleges Of Technology Japan Apparatus, method and program for generating random number, and simulation apparatus
JP2013171549A (en) * 2012-02-23 2013-09-02 Nec Corp Random number processing device, method for processing random number, and program
JP2021051676A (en) * 2019-09-26 2021-04-01 富士通株式会社 Random number generation device and random number generation method
JP7276047B2 (en) 2019-09-26 2023-05-18 富士通株式会社 Random number generator and random number generation method

Also Published As

Publication number Publication date
JP3580737B2 (en) 2004-10-27

Similar Documents

Publication Publication Date Title
Corsini et al. Efficient and flexible sampling with blue noise properties of triangular meshes
CN110223218B (en) Face image processing method and device, electronic equipment and storage medium
US8952964B2 (en) Generating animated voronoi treemaps to visualize dynamic hierarchical data with node insertion
JP2002501639A (en) Adaptive mesh refinement method and apparatus
CN111629048B (en) spark cluster optimal configuration parameter determination method, device and equipment
Capozzoli et al. A comparison of fast marching, fast sweeping and fast iterative methods for the solution of the eikonal equation
EP3826000B1 (en) Automatic preparation of a new midi file
JP2001067207A (en) Normal random number generating device, and recording medium
CN113313140B (en) Three-dimensional model classification and retrieval method and device based on deep attention
EP2548329B1 (en) Data expansion using an approximate method
CN111640012A (en) Block chain transaction tracing method and device
CN112541195A (en) Method and device for constructing editable block chain
CN112560096A (en) Transaction content editing method and device based on identity block chain
CN115374659B (en) Electric turbulence control method and device and electronic equipment
JP2012043437A (en) Image processing method and image processing device
CN110048844A (en) Realize more times of point calculating methods, devices of SM2 algorithm
Triantafyllidis et al. A finite-element mesh generator based on growing neural networks
JP6889230B2 (en) Information processing equipment, information processing methods and programs
Bosman A solution merging heuristic for the steiner problem in graphs using tree decompositions
Kudoh et al. Thermodynamics of four-dimensional black objects in the warped compactification
KR102649929B1 (en) Digital signature generation and verification method for low-end PLC
TWI699986B (en) Method and system for generating blockchain
CN112866504B (en) Air three encryption method and system
CN113240087B (en) Image generation model construction method, device, medium and equipment
Lahn et al. An $\tilde {O}(n^{5/4}) $ Time $\varepsilon $-Approximation Algorithm for RMS Matching in a Plane

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20040127

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040210

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20040706

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040720

R150 Certificate of patent (=grant) or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080730

Year of fee payment: 4

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090730

Year of fee payment: 5

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100730

Year of fee payment: 6

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100730

Year of fee payment: 6

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110730

Year of fee payment: 7

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110730

Year of fee payment: 7

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120730

Year of fee payment: 8

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120730

Year of fee payment: 8

FPAY Renewal fee payment (prs date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130730

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees