JPH07248902A - Floating-point arithmetic unit and its error correction method, linear programming problem optimizing unit and its optimal solution - Google Patents

Floating-point arithmetic unit and its error correction method, linear programming problem optimizing unit and its optimal solution

Info

Publication number
JPH07248902A
JPH07248902A JP4092694A JP4092694A JPH07248902A JP H07248902 A JPH07248902 A JP H07248902A JP 4092694 A JP4092694 A JP 4092694A JP 4092694 A JP4092694 A JP 4092694A JP H07248902 A JPH07248902 A JP H07248902A
Authority
JP
Japan
Prior art keywords
exponent
unit
result
calculation
floating
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.)
Withdrawn
Application number
JP4092694A
Other languages
Japanese (ja)
Inventor
Naoto Honda
直人 本多
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.)
Fujitsu Ltd
Original Assignee
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP4092694A priority Critical patent/JPH07248902A/en
Publication of JPH07248902A publication Critical patent/JPH07248902A/en
Withdrawn legal-status Critical Current

Links

Abstract

(57)【要約】 【目的】 浮動小数点演算装置とその誤差補正方法およ
びその浮動小数点演算装置を備えた線形計画問題最適化
装置とその最適解の求解方法に関し,演算結果の誤差の
影響が後続の演算に影響しないようにすることを目的と
する。 【構成】 正規化浮動小数点数の指数保持部A(10)と,
演算結果の正規化浮動小数点数の指数保持部B(13)と,
演算結果を補正するかしないかの判定基準の閾値を保持
する閾値保持部(11)と,演算前の該指数と演算後の該指
数の比較結果と該閾値を比較し,演算結果の補正を行う
かあるいは行わないかを判定する指数比較部(12)と,指
数比較部(12)の比較結果に基づいて演算結果を補正する
演算結果変更部(14)とを備え,演算前の該指数と該演算
後の該指数の比較結果が該閾値より大きい場合には,演
算結果を0に補正する構成を持つ。
(57) [Summary] [Objective] Regarding the floating-point arithmetic unit and its error correction method, and the linear programming problem optimizing unit equipped with the floating-point arithmetic unit and its optimum solution finding method, the influence of the error of the arithmetic result follows. The purpose is not to affect the calculation of. [Structure] Exponent holding unit A (10) for normalized floating point numbers,
Exponent holding part B (13) of normalized floating point number of operation result,
The threshold value holding unit (11) that holds the threshold value of the criterion for determining whether or not to correct the calculation result is compared with the comparison result of the exponent before the calculation and the index after the calculation and the threshold value to correct the calculation result. An exponent comparison unit (12) for deciding whether to perform or not and an operation result changing unit (14) for correcting the operation result based on the comparison result of the exponent comparison unit (12) If the comparison result of the exponent after the calculation is larger than the threshold value, the calculation result is corrected to 0.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は,浮動小数点演算装置と
その誤差補正方法およびその浮動小数点演算装置を備え
た線形計画問題最適化装置とその最適解の求解方法に関
する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a floating point arithmetic unit, an error correction method therefor, a linear programming problem optimizing apparatus equipped with the floating point arithmetic unit, and a method for finding an optimum solution thereof.

【0002】コンピュータにより浮動小数点演算を行う
場合には,計算桁が有限であることに起因する誤差を生
じる場合がある。特に線形計画問題最適化装置では,最
適解を得るまでに膨大な量の浮動小数点演算を必要とす
るので,その過程で上記の数値誤差が累積され,そのた
め,掃き出し回数の増加等で計算時間が長くなったり,
無限ループを生じ最適解に収束しないことがしばしば起
こる(掃き出しについては後述する)。
When floating-point arithmetic is performed by a computer, an error may occur due to the finite number of calculation digits. In particular, the linear programming problem optimizer requires a huge amount of floating-point arithmetic to obtain an optimal solution, and therefore the above numerical errors are accumulated in the process, so that the calculation time increases due to an increase in the number of sweeps. Becoming longer,
It often happens that an infinite loop occurs and does not converge to the optimum solution (sweeping will be described later).

【0003】[0003]

【従来の技術】従来はそのような誤差に基づく障害を回
避するため,掃き出し点を選択する場合にできるだけ誤
差を発生させない掃き出し点を選択するようにしてい
た。また,誤差が発生した場合には,ある定められた値
以下の小さな値は0とするように,決められた小さな値
(トレランス値)を境にまるめ処理補正を行う程度であ
った。
2. Description of the Related Art Conventionally, in order to avoid such an error-based obstacle, when a sweep point is selected, a sweep point that does not generate an error is selected as much as possible. Further, when an error occurs, the rounding process correction is performed with a predetermined small value (tolerance value) as a boundary so that a small value equal to or smaller than a predetermined value is set to 0.

【0004】図7,図8により,シンプレックス法によ
る線形計画問題の最適解の求め方について説明する。線
形計画問題は,図7 (a)に示す,制約条件,,,
において,目的関数のzを最大にする解,x1 ,x
2 ,・・・,xk を求める問題である。
A method of obtaining an optimum solution of a linear programming problem by the simplex method will be described with reference to FIGS. 7 and 8. The linear programming problem is shown in Fig. 7 (a).
At x, the solution that maximizes z of the objective function, x 1 , x
This is a problem of finding 2 , ..., X k .

【0005】ここで,図7 (b)に示すように,スラック
変数を導入して標準形の連立方程式とする(スラック変
数については例題を参照)。このとき,d1 ≧0 ,d
2 ≧0,・・・,dm ≧0とする。
Here, as shown in FIG. 7B, a slack variable is introduced to form a standard simultaneous equation (for the slack variable, see the example). At this time, d 1 ≧ 0 , D
2 ≧ 0, ..., D m ≧ 0.

【0006】シンプレックス法は,このとき図7 (c)に
示すように,x1 ,x2 ,・・・,xn の係数および定
数項の作る行列に次の操作を行って最適解を求める方法
である。
[0006] simplex method, as shown in FIG. 7 at this time (c), x 1, x 2, ···, finding an optimal solution by performing the following operations in a matrix to make the coefficient of x n and a constant term Is the way.

【0007】ステップ1 c1 , c2 ,・・・,cn
中で負の成分がなければ, それはすでに最適解であり,
処理を終了する。負の成分があれば, その絶対値が最大
なものをとる。それをcs とする。
If there is no negative component in steps 1 c 1 , c 2 , ..., C n , it is already an optimal solution ,
The process ends. If there is a negative component , its absolute value is the maximum. Let it be c s .

【0008】ステップ2 第s列中,ais>0となるa
isをすべて求める。 ステップ3 ステップ2で求めたaisについてdi /a
isを計算し,最小のものをとる。最小のものが2つ以上
あるときはいずれでも良い。それをarsとする。
Step 2 In the s-th column, a is > 0 a
ask for all is . Step 3 For a is obtained in Step 2, d i / a
Calculate is and take the smallest one. When there are two or more minimum ones, any one may be used. Let it be ars .

【0009】ステップ4 arsをピボットとするピボッ
ト変形を行いステップ1に戻る(ピボット変形について
は例題参照)。 図8により,上記の方法について,例題により説明す
る。
Step 4 Perform pivot deformation with a rs as the pivot and return to step 1 (for the pivot deformation, refer to the example). The above method will be described with reference to FIG.

【0010】図8 (a)のの制約条件を元に,目的関数
を最大とするx,yを求める。問題式 (a)に対してス
ラック変数(x3 ,x4 )を導入して,標準形とし,z
も変数にして図8 (b)の連立方程式を得る。
Based on the constraint condition of FIG. 8 (a), x and y that maximize the objective function are obtained. Introduce the slack variables (x 3 , x 4 ) into the problem expression (a) to make it a standard form, and z
Let also be a variable, and obtain the simultaneous equations in Fig. 8 (b).

【0011】そこで,x1 ,x2 ,x3 ,x4 の係数お
よび定数項からなる行列を作る(図8 (c))。図8 (c)
の行列に対してステップ1を実行する。
Therefore, a matrix consisting of coefficients of x 1 , x 2 , x 3 , and x 4 and a constant term is created (FIG. 8 (c)). Figure 8 (c)
Step 1 is performed on the matrix of.

【0012】cs は(3,2)成分の c2 =−4であ
る。ステップ2で求める第2列中正であるものは,a12
=1とa22=3である。ステップ3で,20/1=20
と32/3=10.66・・・を比較する。32/3の
方が小さいのでars=a22をピボットとする。
C s is c 2 = -4 of the (3,2) component. The one in the second column that is positive in step 2 is a 12
= 1 and a 22 = 3. In step 3, 20/1 = 20
And 32/3 = 10.66 ... Since 32/3 is smaller, a rs = a 22 is set as the pivot.

【0013】ステップ4でa22をピボットとしてピボッ
ト変形を行うことにより図8 (d)の行列を得る(ピボッ
ト変形は (d)のようにピボットとした要素a22のある列
において,ピボットとした要素を1とし,他は0とする
変形である。この処理を掃き出しと称する)。
In step 4, a matrix of FIG. 8 (d) is obtained by performing pivot transformation with a 22 as the pivot (pivot transformation is performed by pivoting in the column with the pivoted element a 22 as shown in (d)). This is a transformation in which the elements are 1 and the others are 0. This process is called sweeping).

【0014】ここで,ステップ1に戻る。 c1 =−1/
3が負の項であるので,ステップ2へ進む。a11=4/
3>0,a21=2/3>0である。ステップ3で,(2
8/3)/(4/3)=28/4=7,(32/3)/
(2/3)=32/2=16である。7の方が小さいの
で,ars=a11=4/3をピボットとする。
Now, return to step 1. c 1 = -1 /
Since 3 is a negative term, the process proceeds to step 2. a 11 = 4 /
3> 0 and a 21 = 2/3> 0. In Step 3, (2
8/3) / (4/3) = 28/4 = 7, (32/3) /
(2/3) = 32/2 = 16. Since 7 is smaller, a rs = a 11 = 4/3 is the pivot.

【0015】ステップ4で,a11をピボットとしてピボ
ット変形を行い,図8 (e)の行列を得る(掃き出しをす
る)。ステップ1にもどる。 c1 ≧0,・・・, c4
0,即ち全部非負なので終了する。
In step 4, pivot transformation is performed by using a 11 as the pivot to obtain the matrix of FIG. 8E (sweep out). Return to step 1. c 1 ≧ 0, ..., c 4
0, that is, all are non-negative, so the process ends.

【0016】x3 =0,x4 =0として,図8 (f)を最
適解とする。このとき目的関数zの値はz=45であっ
て,最大である(上記において,シンプレックス方の説
明は,紀伊國屋書店発行,伊藤 昇,岩井 齋良,岩堀
長慶,上林 達治,関野 薫,高橋 秀一著,「経済
系・工学系のための行列とその応用」を参照した)。
With x 3 = 0 and x 4 = 0, the optimum solution is shown in FIG. 8 (f). At this time, the value of the objective function z is z = 45, which is the maximum (in the above, the explanation of the simplex method is published by Kinokuniya Shoten, Noboru Ito, Saira Iwai, Chokei Iwahori, Tatsuharu Uebayashi, Kaoru Sekino, Takahashi. See Shuichi, "Matrix for Economics and Engineering and Its Applications").

【0017】図9は従来の線形計画問題最適化装置で使
用される浮動小数点演算装置の加減算処理のフローチャ
ートを示す。図示の番号に従って説明する。
FIG. 9 shows a flow chart of addition / subtraction processing of a floating point arithmetic unit used in a conventional linear programming problem optimizing apparatus. A description will be given according to the numbers shown.

【0018】S1 正規化された浮動小数点データを入
力する。 S2 加算もしくは減算をする。 S3 小さな値についてまるめ処理をする。
S1 Input the normalized floating point data. S2 Add or subtract. S3 Rounding is performed for small values.

【0019】S4 演算結果を出力する。S4 The calculation result is output.

【0020】[0020]

【発明が解決しようとする課題】上記のように,変数が
多い場合は,線形計画問題の最適解を求めるためには,
膨大な数の演算処理を行わなければならない。そのた
め,コンピュータの桁の精度が有限であることに起因す
る誤差が累積され,掃き出し回数の増加,処理がループ
して最適解に収束しない等を生じる場合があった。
As described above, when there are many variables, in order to obtain the optimum solution of the linear programming problem,
A huge number of arithmetic processes must be performed. As a result, errors due to the finite precision of computer digits may be accumulated, and the number of sweeps may increase, the processing may loop, and the optimum solution may not converge.

【0021】誤差の影響について,図10により説明す
る。図10は浮動小数点演算における誤差の問題点の説
明図である。図10 (a)は浮動小数点演算における正規
化の説明図である。
The influence of the error will be described with reference to FIG. FIG. 10 is an explanatory diagram of a problem of error in floating point arithmetic. FIG. 10A is an explanatory diagram of normalization in floating point arithmetic.

【0022】浮動小数点演算では,数値は全て正規化し
て,有効数字を小数点以下第1位から始まるように仮数
部と指数部に分けて表すようにする。例えば,有効数字
4桁の1234は0.1234×104 とし,符号部を
正負の符号,指数部を104 の指数4,仮数部を仮数1
234として表す。
In floating point arithmetic, all numerical values are normalized so that significant figures are divided into a mantissa part and an exponent part so as to start from the first decimal place. For example, 1234 having 4 significant figures is 0.1234 × 10 4 , the sign part is a positive or negative sign, the exponent part is an exponent of 10 4 , and the mantissa part is the mantissa 1
Represented as 234.

【0023】次に図10により,浮動小数点演算によ
り,A−B=C,C×1000=Dを計算する場合の誤
差について説明する。Bは他の演算処理により求められ
るものとする。
Next, referring to FIG. 10, the error in the case of calculating AB = C and C × 1000 = D by the floating point calculation will be described. It is assumed that B is obtained by another calculation process.

【0024】Bは正規化されて,B=0.4×10が正
しい値であるが,Bの算出処理において誤差を生じ,正
規化して0.39999999×10が求められたもの
とする。
It is assumed that B is normalized and B = 0.4 × 10 is a correct value, but an error occurs in the calculation process of B, and B is normalized to obtain 0.39999999 × 10.

【0025】図10において, Aのデータ入力をする。そして,に正規化された
浮動小数点数Aが入力される。
In FIG. 10, data A is input. Then, the normalized floating point number A is input to.

【0026】 Bの算出処理がなされる。そして,
に正規化された浮動小数点数Bが入力される。Bは0.
4×10が正しい値(望まれる値)であるが,演算誤差
のために,0.39999999×10が算出され,
に入力される。
A calculation process of B is performed. And
The floating-point number B normalized to is input. B is 0.
4 × 10 is the correct value (desired value), but due to the calculation error, 0.39999999 × 10 is calculated,
Entered in.

【0027】において,C=A−Bが算出され,正規
化されて,C=0.1×10-6が求められる。望まれる
正しいCの値は,C=0.4×10−0.4×10=0
であるが,Bの算出処理の誤差のため,C=0.1×
10-6が算出される。
In, C = AB is calculated and normalized to obtain C = 0.1 × 10 -6 . The desired correct C value is C = 0.4 × 10−0.4 × 10 = 0
However, due to an error in the calculation process of B, C = 0.1 ×
10 −6 is calculated.

【0028】でC×1000=Dの処理がなされる。
の演算結果Cにより,D=0.1×10-3が求めら
れ,で出力される。のBの算出処理でBが正しく求
められていれば,D=0であるはずであるが,誤差を生
じているためでBの誤差が拡大されて出力される。
Then, the processing of C × 1000 = D is performed.
D = 0.1 × 10 −3 is obtained from the calculation result C of, and is output. If B is correctly obtained in the calculation process of B, D = 0 should be obtained, but since an error has occurred, the error of B is enlarged and output.

【0029】本発明は,浮動小数点演算において,演算
結果の誤差の影響が後続の演算に影響しないようにし,
特に,線形計画問題に適用して有効な浮動小数点演算装
置と誤差補正方法およびその線形計画問題最適化装置と
その最適解の求解方法を提供することを目的とする。
In the floating point arithmetic, the present invention prevents the influence of the error of the arithmetic result from affecting the succeeding arithmetic.
In particular, it is an object of the present invention to provide a floating-point arithmetic unit and an error correction method that are effective when applied to a linear programming problem, an apparatus for optimizing the linear programming problem, and a method for solving the optimum solution.

【0030】[0030]

【課題を解決するための手段】浮動小数点(特に,倍精
度の浮動小数点)加減算では,演算結果が演算前の数値
と比較して非常に小さい値(0に近い値)となる場合が
ある。例えば,演算前の指数部の値が10(データ値が
10桁)から0(データ値が1桁)に変化するような場
合である。これは,コンピュータの演算桁が有限である
ことに基づく誤差により生じたものである場合が多く,
本来は等しいはずの2数が,誤差により非常に小さい値
を生じたものであり,正しくは0であるものと考えられ
る。
In floating-point (particularly double-precision floating-point) addition and subtraction, the operation result may be a very small value (value close to 0) compared with the value before the operation. For example, there is a case where the value of the exponent part before calculation changes from 10 (data value has 10 digits) to 0 (data value has 1 digit). This is often caused by an error due to the finite number of digits in the computer,
The two numbers, which should be equal in nature, caused a very small value due to an error, and are considered to be 0 correctly.

【0031】本発明は,このように加減算の前後で,指
数部の値が大きく変化して,小さい値を生じた場合は演
算結果を0とするようにした。この処理を相対誤差補正
と称する。
According to the present invention, the arithmetic result is set to 0 when the value of the exponent part greatly changes before and after the addition and subtraction and a small value is generated. This process is called relative error correction.

【0032】図1は本発明の基本構成を示す。図1にお
いて,1は浮動小数点演算装置である。
FIG. 1 shows the basic configuration of the present invention. In FIG. 1, 1 is a floating point arithmetic unit.

【0033】2は演算データ入力部であって,正規化デ
ータを入力するものである。3は演算データ保持部であ
って,正規化された入力データを符号部,指数部,仮数
部に分けて保持するものである。
Reference numeral 2 denotes an operation data input section for inputting normalized data. Reference numeral 3 denotes an operation data holding unit, which holds the normalized input data by dividing it into a sign part, an exponent part, and a mantissa part.

【0034】4は演算部であって,加減算をするもので
ある。5は正規化処理部である。6は演算結果保持部で
ある。
Reference numeral 4 is an arithmetic unit for adding and subtracting. Reference numeral 5 is a normalization processing unit. 6 is a calculation result holding unit.

【0035】7は相対誤差補正部であって,演算の前後
の指数部の変化を判定し,変化の程度に従って演算結果
を補正するものである。8は演算結果出力部である。
Reference numeral 7 denotes a relative error correction unit, which determines a change in the exponent part before and after the calculation and corrects the calculation result according to the degree of the change. Reference numeral 8 is a calculation result output unit.

【0036】10は指数保持部Aであって,入力された
演算データの指数部の値を保持するものである。11は
閾値保持部であって,演算結果を変更するかしないかを
判定するための閾値を保持するものである。
Reference numeral 10 denotes an exponent holding unit A, which holds the value of the exponent part of the input operation data. A threshold holding unit 11 holds a threshold for determining whether or not to change the calculation result.

【0037】12は指数比較部であって,演算前の入力
データの指数部と演算結果の指数部を比較するものであ
る。13は指数保持部Bであって,演算結果の指数部の
値を保持するものである。
Reference numeral 12 is an exponent comparison unit for comparing the exponent part of the input data before the operation with the exponent part of the operation result. An exponent holding unit B 13 holds the value of the exponent part of the calculation result.

【0038】14は演算結果変更部であって,演算結果
を補正するものである。
Reference numeral 14 denotes a calculation result changing unit, which corrects the calculation result.

【0039】[0039]

【作用】図2を参照し,図1の本発明の基本構成の動作
を説明する。図2は本発明の基本構成の動作例を示す。
The operation of the basic configuration of the present invention shown in FIG. 1 will be described with reference to FIG. FIG. 2 shows an operation example of the basic configuration of the present invention.

【0040】演算データ入力部2は正規化された演算デ
ータを入力する。図2の場合,A=0.4×10であ
り,B=0.39999999×10が入力される。演
算データ保持部3はそれぞれの入力データを符号部,指
数部,仮数部に分けて保持する。演算部4はA,Bを減
算し,正規化処理部5は正規化処理をし,演算結果保持
部6は正規化した演算結果0.1×10-6を符号部,指
数部,仮数部に分けて保持する(指数部の表し方は説明
の都合上便宜的に図示のように表したものである)。
The operation data input unit 2 inputs the normalized operation data. In the case of FIG. 2, A = 0.4 × 10 and B = 0.39999999 × 10 are input. The arithmetic data holding unit 3 holds each input data by dividing it into a sign part, an exponent part, and a mantissa part. The operation unit 4 subtracts A and B, the normalization processing unit 5 performs normalization processing, and the operation result holding unit 6 outputs the normalized operation result 0.1 × 10 −6 to the sign part, exponent part, and mantissa part. And hold them (the exponent is expressed as shown in the figure for convenience of explanation).

【0041】一方,指数保持部A(10)は,演算データ保
持部3に保持されているデータの指数部(値01)を取
り出し保持する。また,指数保持部B(13)は演算結果保
持部6に保持されている指数部の値(−6)を取り出し
て保持する。そして,指数比較部12は例えば,指数保
持部A(10)の取り出した指数と,指数保持部B(13)の取
り出した指数の差をとり,閾値保持部11に保持されて
いる値5と比較する。そして,指数部の差が閾値より大
きい場合には,演算結果変更部14に演算結果の補正を
指示する。図の場合指数の差が7であり,閾値が5であ
るので,演算結果変更部14に演算結果の補正を指示す
る。
On the other hand, the exponent holding unit A (10) takes out and holds the exponent part (value 01) of the data held in the operation data holding unit 3. The exponent holding unit B (13) takes out and holds the value (-6) of the exponent part held in the calculation result holding unit 6. Then, the exponent comparing unit 12 takes the difference between the exponent taken out by the exponent holding unit A (10) and the exponent taken out by the exponent holding unit B (13) to obtain the value 5 held in the threshold holding unit 11, for example. Compare. When the difference between the exponents is larger than the threshold value, the calculation result changing unit 14 is instructed to correct the calculation result. In the case of the figure, since the difference between the indexes is 7 and the threshold value is 5, the calculation result changing unit 14 is instructed to correct the calculation result.

【0042】演算結果変更部14は,指数比較部12の
指示に従い,補正指示があれば演算結果保持部6に保持
されている演算結果を0に変更し,0を出力する。変更
指示がなければ,演算結果保持部6に保持している値を
出力する。
According to the instruction from the exponent comparison unit 12, the operation result changing unit 14 changes the operation result held in the operation result holding unit 6 to 0 and outputs 0 if there is a correction instruction. If there is no change instruction, the value held in the calculation result holding unit 6 is output.

【0043】本発明は,演算結果の値が大きい値でも,
指数部の値が大きく変化して得られたものであって本来
0であるべきものである場合には,そのことを判定し,
0に正しく補正する。
According to the present invention, even if the value of the operation result is large,
If the value of the exponent part is obtained by a large change and should be 0 originally, judge that fact,
Correct it to 0 correctly.

【0044】従って,本発明によれば,線形計画問題最
適化装置のような多次元の連立方程式の解をもとめるよ
うな演算処理に対して正確な演算処理を行うことができ
るようになる。
Therefore, according to the present invention, it is possible to perform an accurate arithmetic process for the arithmetic process for finding the solution of the multidimensional simultaneous equations such as the linear programming problem optimizing device.

【0045】[0045]

【実施例】図3は本発明の浮動小数点演算装置を備えた
線形計画問題最適化装置の構成実施例を示す。
FIG. 3 shows a structural embodiment of a linear programming problem optimizing apparatus equipped with a floating point arithmetic unit according to the present invention.

【0046】図3において,20は線形計画問題最適化
装置であって,シンプレックス法により線形計画問題の
最適解を求める線形計画問題最適解求解手段と,本発明
の相対誤差補正部をもつ浮動小数点演算装置を備えたも
のである。
In FIG. 3, reference numeral 20 denotes a linear programming problem optimizing device, which is a floating point having a linear programming problem optimal solution solving means for finding an optimal solution of the linear programming problem by a simplex method, and a relative error correction part of the present invention. It is equipped with an arithmetic unit.

【0047】21はCPUである。22は主記憶であ
る。23は入力手段であって,演算データ,制約条件,
目的関数等を入力するものである。
Reference numeral 21 is a CPU. 22 is a main memory. Reference numeral 23 is an input means for calculating data, constraint conditions,
The objective function etc. are input.

【0048】24は出力手段であって,演算結果を出力
するディスプレイ,印刷装置等である。25は浮動小数
点演算装置である。
An output means 24 is a display, a printing device or the like for outputting the calculation result. 25 is a floating point arithmetic unit.

【0049】26は乗除算部であって,乗算もしくは除
算を行うものである。27は加減算部であって,加算も
しくは減算をするものである。28は相対誤差補正部で
あって,前述のものである。
Reference numeral 26 denotes a multiplication / division unit, which performs multiplication or division. An adder / subtractor 27 adds or subtracts. Reference numeral 28 is a relative error correction unit, which has been described above.

【0050】30は線形計画問題最適解求解手段であっ
て,シンプレックス法により線形計画問題の最適解を求
めるものである。31はステップ1である(前記参
照)。
Reference numeral 30 denotes an optimal solution for a linear programming problem, which seeks an optimal solution for the linear programming problem by the simplex method. 31 is step 1 (see above).

【0051】32はステップ2である(前記参照)。3
3はステップ3である(前記参照)。34はステップ4
であって,掃き出し処理を行うものである(前記参
照)。
Step 32 is step 2 (see above). Three
Step 3 is step 3 (see above). 34 is step 4
That is, the sweeping process is performed (see above).

【0052】35は制約条件である。36は目的関数で
ある。37は演算データである。
Reference numeral 35 is a constraint condition. 36 is an objective function. 37 is calculation data.

【0053】図3の構成において,線形計画問題最適解
求解手段30は,浮動小数点演算装置25を使用して,
制約条件35と演算データ37に基づいてステップ1(3
1),ステップ2(32)ステップ3(32),ステップ4(34)に
従って目的関数36の最適解を求める。浮動小数点演算
装置25においては,相対誤差補正部28は,加減算処
理の演算結果について,前述の相対誤差を判定し,補正
が必要であれば,演算結果を0に補正し,浮動小数点演
算を行う。
In the configuration of FIG. 3, the optimum solution for linear programming problem solving means 30 uses the floating point arithmetic unit 25,
Based on the constraint condition 35 and the calculation data 37, step 1 (3
The optimum solution of the objective function 36 is obtained according to 1), step 2 (32), step 3 (32), and step 4 (34). In the floating-point arithmetic unit 25, the relative error correction unit 28 determines the above-mentioned relative error in the calculation result of the addition / subtraction processing, and if correction is necessary, corrects the calculation result to 0 and performs floating-point calculation. .

【0054】図4は本発明の浮動小数点演算装置の実施
例のフローチャートである。図4は倍精度の浮動小数点
演算装置の場合の動作である。 S1 倍精度浮動小数点数の加減算処理を開始する。
FIG. 4 is a flow chart of an embodiment of the floating point arithmetic unit of the present invention. FIG. 4 shows the operation in the case of a double precision floating point arithmetic unit. S1 Double-precision floating-point number addition / subtraction processing is started.

【0055】S2 倍精度浮動小数点数の指数部を取り
出す(指数部の値をmとする。演算データが2数以上あ
る場合には,そのいずれでも良い)。 S3 倍精度浮動小数点数の加算または減算を行う。
S2 The exponent part of the double precision floating point number is taken out (the value of the exponent part is m. If there are two or more operation data, any of them may be used). S3 Addition or subtraction of double precision floating point numbers.

【0056】S4 倍精度浮動小数点数の指数部を取り
出す(取り出した値をnとする)。 S5 m−nを求め,m−nとある値(閾値)と比較す
る。m−n≧ある値であればS6に進み,m−n<ある
値であれば,処理を終了する。
S4 The exponent part of the double precision floating point number is extracted (the extracted value is n). S5 m-n is calculated, and mn is compared with a certain value (threshold value). If m−n ≧ a certain value, the process proceeds to S6, and if m−n <a certain value, the process ends.

【0057】S6 演算前の指数と演算後の指数の差m
−nがある値より大きいので,演算結果CをC=0.0
とする。 図5により,本発明の浮動小数点演算装置の実施例を説
明する。
S6 Difference m between exponent before operation and after operation
-N is larger than a certain value, so the calculation result C is C = 0.0
And An embodiment of the floating point arithmetic unit of the present invention will be described with reference to FIG.

【0058】図5は本発明の浮動小数点演算装置により
連立方程式を解く場合の例である。図5において,各浮
動小数はC言語の関数printf(“%e”,浮動小
数変数名)で出力させた値である。浮動小数点数は32
ビットで宣言してあるものとする。相対誤差補正で用い
る判定値(閾値)は5とする。
FIG. 5 shows an example in which simultaneous equations are solved by the floating point arithmetic unit of the present invention. In FIG. 5, each floating point is a value output by the C language function printf (“% e”, floating point variable name). Floating point number is 32
It shall be declared in bits. The determination value (threshold value) used in the relative error correction is 5.

【0059】(a)の連立方程式を解くものとする。(a)の
(2) 式の右辺の値は0.1を100回加算処理して得ら
れたものである。計算方法は次のとおりである。
The simultaneous equations in (a) are to be solved. (a)
The value on the right side of the equation (2) is obtained by adding 0.1 for 100 times. The calculation method is as follows.

【0060】int i; float rhs2=0.0; for(i=1;i<=100;i++) rhs2+=0.01; 正しい演算結果は1であるが,演算誤差のため図示のよ
うに,9.999993e−01となったものである
(e−01は10-1を表す)。
Int i; float rhs2 = 0.0; for (i = 1; i <= 100; i ++) rhs2 + = 0.01; the correct calculation result is 1, but as shown in the figure due to a calculation error. It is 9.999993e-01 (e-01 represents 10 -1 ).

【0061】(a)式について掃き出し計算を行い,解く
と (b)式が得られる。そこで, (a)式を解くのに本発明
の相対誤差補正を行いながら解くと次のようになる。
By sweeping out the equation (a) and solving it, the equation (b) is obtained. Therefore, when solving the equation (a) while performing the relative error correction of the present invention, the result is as follows.

【0062】(c)式において( (c)式は (a)式に同じで
ある),下線の部分について掃き出しをする。そこで,
(2) −(1) を計算すると右辺の計算は (d)になる。ここ
で, (d)の演算結果に対して相対誤差補正を行う。
In the equation (c) (the equation (c) is the same as the equation (a)), the underlined portion is swept out. Therefore,
When (2) − (1) is calculated, the calculation on the right side is (d). Here, relative error correction is performed on the calculation result in (d).

【0063】(2) 式の右辺9.999993e−01の
指数部を取り出すとm=−1である。(あるいは(1) 式
の右辺1.000000e+00の指数部を取り出して
m=0でも良い)。計算後の値の−6.556511e
−07の指数部を取り出すとn=−7である。次にそれ
ぞれの指数部の差を求めると,m−n=−1−(−7)
=6である(あるいはm−n=0−(−7)=7)。
When the exponent part of the right side of 9.9999993e-01 in the equation (2) is taken out, m = -1. (Alternatively, the exponent part of 1.00000e + 00 on the right side of the equation (1) may be taken out and m = 0 may be used). The calculated value of −6.556511e
Taking out the exponent part of −07, n = −7. Next, when the difference between the respective exponents is obtained, m−n = −1 − (− 7)
= 6 (or m-n = 0-(-7) = 7).

【0064】この値を判定値(閾値)と比較すると5よ
りも大きい。そのため, (d)式の右辺の値を誤差補正し
て0とし, (f)式を得る。その結果,正しい (g)式が得
られる。
When this value is compared with the judgment value (threshold value), it is greater than 5. Therefore, the value on the right side of equation (d) is error-corrected to 0, and equation (f) is obtained. As a result, the correct equation (g) is obtained.

【0065】次に, (g)式のyについて掃き出しを行
う。即ち, (g)式の(1) −(2) ’/2.00000e+
00を計算すると,(h) 式が得られる。
Next, sweeping is performed for y in the equation (g). That is, (1)-(2) '/ 2.0000e + of equation (g)
When 00 is calculated, formula (h) is obtained.

【0066】従って,相対誤差補正を行うことにより正
しい式が得られる( (b)式の(2) ”の右辺の値が正しい
値に補正されている)。図6は本発明の効果の測定結果
を示す。
Therefore, a correct expression can be obtained by performing the relative error correction (the value on the right side of (2) "in the expression (b) is corrected to a correct value.) FIG. The results are shown.

【0067】図6は,シンプレックス法により,マトリ
ックスの大きさが数十×数十〜数千×数千の81個の線
形計画問題最適化のための例題に対して,本発明の方法
と従来の方法とで掃き出し回数と掃き出し時間を求めた
ものである。改善率は改善量を相対誤差補正なしの量
(従来の方法による量)で本発明の方法による場合を割
ったものである。
FIG. 6 shows a method according to the present invention and a conventional method for optimization of 81 linear programming problems in which the size of a matrix is several tens × several tens to several thousands × thousands by the simplex method. And the sweep time and the sweep time. The improvement rate is the amount of improvement divided by the amount without relative error correction (the amount by the conventional method) divided by the method of the present invention.

【0068】掃き出し回数および掃き出し時間が,本発
明の方法により改善されることが示されている。
It has been shown that the number of sweeps and the sweep time are improved by the method of the present invention.

【0069】[0069]

【発明の効果】本発明は,演算結果の値が大きい値で
も,指数部の値が大きく変化して得られたものであって
本来0であるべきものである場合には,そのことを判定
し,0に正しく補正するので,従来,行われていたよう
な,演算結果が,あらかじめ定められた小さな値を基準
に補正するのでなく,演算の前後の値の大きさの変化に
より誤差の補正をするので,確実な誤差の補正を行うこ
とができるようになる。そのため,本発明によれば,線
形計画問題最適化装置のような多次元の連立方程式の解
をもとめるような演算処理に対して正確な演算処理を行
うことができるようになるとともに,演算速度も高速化
される。
According to the present invention, even if the value of the operation result is a large value, the value of the exponent part is obtained by a great change, and if it should originally be 0, it is determined. However, since it is corrected to 0 correctly, the calculation result is not corrected based on a small value determined in advance as in the past, but the error is corrected by the change in the value before and after the calculation. As a result, it becomes possible to perform reliable error correction. Therefore, according to the present invention, it becomes possible to perform an accurate arithmetic process with respect to an arithmetic process for finding a solution of a multidimensional simultaneous equation, such as a linear programming problem optimizing device, and also at an arithmetic speed. It will be faster.

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

【図1】本発明の基本構成を示す図である。FIG. 1 is a diagram showing a basic configuration of the present invention.

【図2】本発明の基本構成の動作例を示す図である。FIG. 2 is a diagram showing an operation example of the basic configuration of the present invention.

【図3】本発明の浮動小数点演算装置を備えた線形計画
問題最適化装置の構成実施例を示す。
FIG. 3 shows a structural embodiment of a linear programming problem optimizing apparatus having a floating point arithmetic unit according to the present invention.

【図4】本発明の浮動小数点演算装置の実施例のフロー
チャートを示す図である。
FIG. 4 is a diagram showing a flowchart of an embodiment of a floating point arithmetic unit of the present invention.

【図5】本発明の実施例を示す図である。FIG. 5 is a diagram showing an example of the present invention.

【図6】本発明の効果の測定結果を示す図である。FIG. 6 is a diagram showing measurement results of effects of the present invention.

【図7】線形計画問題の最適解の求め方を示す図であ
る。
FIG. 7 is a diagram showing how to obtain an optimum solution of a linear programming problem.

【図8】例題(シンプレックス法)を示す図である。FIG. 8 is a diagram showing an example (simplex method).

【図9】従来の線形計画問題最適化装置で使用される浮
動小数点演算装置の加減算処理のフローチャートを示す
図である。
FIG. 9 is a diagram showing a flowchart of addition / subtraction processing of a floating-point arithmetic unit used in a conventional linear programming problem optimizing apparatus.

【図10】浮動少数点演算における誤差の問題点につい
ての説明図である。
FIG. 10 is an explanatory diagram of an error problem in floating-point calculation.

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

1 :浮動小数点演算装置 2 :演算データ入力部 3 :演算データ保持部 4 :演算部(加減算) 5 :正規化処理部 6 :演算結果保持部 7 :相対誤差補正部 8 :演算結果出力部 10:指数保持部A 11:閾値保持部 12:指数比較部 13:指数保持部B 14:演算結果変更部 1: Floating-point arithmetic unit 2: Arithmetic data input unit 3: Arithmetic data holding unit 4: Arithmetic unit (addition / subtraction) 5: Normalization processing unit 6: Arithmetic result holding unit 7: Relative error correction unit 8: Arithmetic result output unit 10 : Index holding unit A 11: Threshold holding unit 12: Index comparing unit 13: Index holding unit B 14: Calculation result changing unit

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 正規化浮動小数点数の加減算を行う浮動
小数点演算装置において,入力された正規化浮動小数点
数の指数保持部A(10)と,演算結果の正規化浮動小数点
数の指数保持部B(13)と,演算結果を補正するかしない
かの判定基準の閾値を保持する閾値保持部(11)と,演算
前の該指数と演算後の該指数の比較結果と該閾値を比較
し,演算結果の補正を行うかあるいは行わないかを判定
する指数比較部(12)と,指数比較部(12)の比較結果に基
づいて演算結果を補正する演算結果変更部(14)とを備え
た,ことを特徴とする浮動小数点演算装置。
1. A floating point arithmetic unit for adding / subtracting a normalized floating point number, wherein an exponent holding unit A (10) for the input normalized floating point number and an exponent holding unit for the normalized floating point number of the operation result. B (13), a threshold value holding unit (11) that holds a threshold value of a criterion for determining whether or not to correct the calculation result, and a comparison result of the index value before the calculation and the index value after the calculation with the threshold value. An exponent comparison unit (12) that determines whether or not the calculation result is corrected, and a calculation result change unit (14) that corrects the calculation result based on the comparison result of the exponent comparison unit (12) Floating point arithmetic unit characterized by the following.
【請求項2】 正規化浮動小数点数の加減算を行う浮動
小数点演算装置における誤差補正方法において,入力さ
れた正規化浮動小数点数の指数と演算結果の正規化浮動
小数点数の指数との比較結果と,あらかじめ定めた閾値
との比較結果に基づいて,演算結果を補正することを特
徴とする浮動小数点演算装置の誤差補正方法。
2. An error correction method in a floating-point arithmetic unit for adding / subtracting normalized floating-point numbers, wherein a comparison result between the exponent of the input normalized floating-point number and the exponent of the normalized floating-point number of the operation result An error correction method for a floating-point arithmetic unit, which corrects an arithmetic result based on a comparison result with a predetermined threshold.
【請求項3】 請求項1に記載の浮動小数点演算装置を
備えた線形計画問題最適化装置において,制約条件と目
的関数を保持し制約条件のもとに最適解を求める線形計
画問題求解手段を備え,該線形計画問題求解手段により
該浮動小数点演算装置(1) において浮動小数点演算をす
ることにより最適解を求めることを特徴とする線形計画
問題最適化装置。
3. A linear programming problem optimizing apparatus comprising the floating point arithmetic unit according to claim 1, further comprising a linear programming problem solving means for holding a constraint condition and an objective function and obtaining an optimum solution under the constraint condition. An apparatus for optimizing a linear programming problem, characterized in that an optimum solution is obtained by performing a floating point operation in the floating point operation device (1) by the linear programming problem solving means.
【請求項4】 請求項1に記載の浮動小数点演算装置
(1) を備えた線形計画問題最適化装置における最適解の
求解方法において,入力された浮動小数点数の指数部
と,演算結果の正規化浮動小数点数の指数部とを比較
し,該比較結果をあらかじめ定めた閾値と比較し,その
結果に基づいて演算結果を補正しながら該最適解を求め
ることを特徴とする線形計画問題最適化装置における最
適解の求解方法。
4. The floating point arithmetic unit according to claim 1.
In the method for finding an optimal solution in the linear programming problem optimizing device having (1), the exponent part of the input floating point number is compared with the exponent part of the normalized floating point number of the operation result, and the comparison result Is compared with a predetermined threshold value, and the optimum solution is calculated while correcting the calculation result based on the result, and a method for finding an optimum solution in a linear programming problem optimizing apparatus is characterized.
JP4092694A 1994-03-11 1994-03-11 Floating-point arithmetic unit and its error correction method, linear programming problem optimizing unit and its optimal solution Withdrawn JPH07248902A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4092694A JPH07248902A (en) 1994-03-11 1994-03-11 Floating-point arithmetic unit and its error correction method, linear programming problem optimizing unit and its optimal solution

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4092694A JPH07248902A (en) 1994-03-11 1994-03-11 Floating-point arithmetic unit and its error correction method, linear programming problem optimizing unit and its optimal solution

Publications (1)

Publication Number Publication Date
JPH07248902A true JPH07248902A (en) 1995-09-26

Family

ID=12594115

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4092694A Withdrawn JPH07248902A (en) 1994-03-11 1994-03-11 Floating-point arithmetic unit and its error correction method, linear programming problem optimizing unit and its optimal solution

Country Status (1)

Country Link
JP (1) JPH07248902A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011248890A (en) * 2010-05-28 2011-12-08 International Business Maschines Corporation Detection of decimal floating point quantum exception

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011248890A (en) * 2010-05-28 2011-12-08 International Business Maschines Corporation Detection of decimal floating point quantum exception
US8219605B2 (en) 2010-05-28 2012-07-10 International Business Machines Corporation Decimal floating-pointing quantum exception detection
KR101464810B1 (en) * 2010-05-28 2014-11-24 인터내셔널 비지네스 머신즈 코포레이션 Decimal floating point quantum exception detection

Similar Documents

Publication Publication Date Title
TWI526928B (en) Vector floating point argument reduction
CN120780271A (en) Data output method, device and storage medium based on fixed point evolution
EP1207460A2 (en) Method and apparatus for solving simultaneous linear equations
EP3716043A1 (en) Information processor, information processing method, and program
CN112860218A (en) Mixed precision arithmetic unit for FP16 floating point data and INT8 integer data operation
JPH07248902A (en) Floating-point arithmetic unit and its error correction method, linear programming problem optimizing unit and its optimal solution
JP5949002B2 (en) Image matching method, and image matching apparatus and program using the method
CN119378274A (en) Intersection curve intersection method and device, electronic equipment and storage medium
Sarra et al. On the numerical solution of chaotic dynamical systems using extend precision floating point arithmetic and very high order numerical methods
Melquiond Plotting in a formally verified way
US7941473B2 (en) Calculation apparatus and storage medium in which calculation program is stored
JP2004005395A (en) Arithmetic processing unit and semiconductor device
JPS63186329A (en) Pre-processor for trigonometric function
Geyer et al. Efficient and mathematically robust operations for certified neural networks inference
CN113157538B (en) Spark operation parameter determination method, device, equipment and storage medium
JP2752948B2 (en) Floating point arithmetic unit
EP1324233A2 (en) Grid convergence solution computation system
CN114817839B (en) Graphic algorithm for determining rotation factor constant value of radix-2-kFFT
JPH10133856A (en) Multiplying method and multiplier with rounding function
TW201643813A (en) System and method of splicing point cloud
CN120215875A (en) CORDIC algorithm optimization method and related device based on zero-jumping idea
JP2002215384A (en) Multi-input addition / subtraction circuit
US6035314A (en) Information processing method
JP2003067178A (en) Data operation processing device and data operation processing program
JP2024174571A (en) Index calculation device, method and program

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20010605