JP2003150565A - Computer - Google Patents

Computer

Info

Publication number
JP2003150565A
JP2003150565A JP2002277151A JP2002277151A JP2003150565A JP 2003150565 A JP2003150565 A JP 2003150565A JP 2002277151 A JP2002277151 A JP 2002277151A JP 2002277151 A JP2002277151 A JP 2002277151A JP 2003150565 A JP2003150565 A JP 2003150565A
Authority
JP
Japan
Prior art keywords
solution
value
calculation
initial value
error
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.)
Pending
Application number
JP2002277151A
Other languages
Japanese (ja)
Inventor
Toshiro Oba
敏朗 大場
Shuji Kaya
周治 加悦
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.)
Sharp Corp
Original Assignee
Sharp Corp
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 Sharp Corp filed Critical Sharp Corp
Priority to JP2002277151A priority Critical patent/JP2003150565A/en
Publication of JP2003150565A publication Critical patent/JP2003150565A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a computer capable of enhancing the possibility of determining the solution at a high speed by a simple control when executing a repetitive solution. SOLUTION: This computer outputs a result by executing arithmetic processing by the repetitive solution in a control part 103 on the basis of an inputted expression, an initial value of a variable in the expression, and a solution existing range, and has a memory 105 for respectively storing the lower limit and the upper limit of the solution existing range. The control part 103 is realized by executing the control for determining the size of Xn+1 and Xn when calculating a halfway result Xn+1 of (n+1) order from a halfway result Xn of n order of the arithmetic processing by the repetitive solution, removing a range smaller than the Xn from the solution existing range by storing the Xn in the lower limit memory when the Xn+1 is larger than the Xn, removing a range larger than the Xn from the solution existing range by storing the Xn in the upper limit memory when the Xn+1 is smaller than the Xn, making a calculation of (n+2) order when the Xn+1 falls within the solution existing range, and finishing the calculation when the Xn+1 falls outside the solution existing range.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、電卓(電子式卓上
計算器)、関数電卓、ポケットコンピュータなどの計算
装置に関するもので、特に操作者が入力した式と初期値
から反復解法によって目的値を得る計算装置に関するも
のである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a calculator (electronic desk calculator), scientific calculator, pocket computer, and other calculators, and more particularly, to a target value by an iterative solution method from an expression input by an operator and initial values. The present invention relates to a computing device to be obtained.

【0002】[0002]

【従来の技術】通常、ニュートン法、最急降下法などの
反復解法では、ある式から、解や極大値、極小値など
(以下、単に「解」という。)を求める場合、初期値X
0から次のX1を求め、次はX1からX2を求め、とい
うように繰り返して計算し、何回か計算を繰り返した後
に最終的に求める値を得る。このとき、初期値によって
解が求められたり求められなかったりする。しかし、ど
の初期値は解が求められるかというのは式によって異な
り、一般的に初期値を設定することはできない。
2. Description of the Related Art Generally, in an iterative solution method such as Newton's method or steepest descent method, when a solution, a maximum value, a minimum value, etc. (hereinafter simply referred to as "solution") is obtained from a certain expression, an initial value X is used.
The next X1 is obtained from 0, the next X1 is obtained from X2, and the like. Iterative calculation is performed, and after finally performing several calculations, the finally obtained value is obtained. At this time, a solution may or may not be obtained depending on the initial value. However, the initial value for which the solution is obtained depends on the formula, and in general, the initial value cannot be set.

【0003】そこで、従来の電卓や関数電卓を含む計算
装置では、この反復解法を実行する場合、図8に示すよ
うに行われる。
Therefore, in a conventional calculator including a calculator and a scientific calculator, the iterative solution method is executed as shown in FIG.

【0004】まず操作者が計算対象となる式を入力する
とともに(S201)、上記式中の変数の初期値と、必
要ならば解が存在すると思われる範囲(以下「解存在範
囲」という。)を入力する(S202)。次に、入力し
た式、初期値の値より実際の演算処理を行い(S20
3)、解を求めたときは計算結果の数値、エラー時はエ
ラーメッセージなどを表示する(S204)。
First, the operator inputs an equation to be calculated (S201), and the initial values of the variables in the above equation and, if necessary, a range in which a solution exists (hereinafter referred to as "solution existence range"). Is input (S202). Next, actual calculation processing is performed from the input expression and the initial value (S20
3) When the solution is obtained, the numerical value of the calculation result is displayed, and when there is an error, an error message is displayed (S204).

【0005】上記演算処理(S203)は、図9に示す
手順で行う。
The above calculation process (S203) is performed in the procedure shown in FIG.

【0006】まず、演算処理に対する各種ワークエリア
の初期設定を行う(S211)。次に、反復解法の処理
を失敗したときに、カウンタKAISUに初期値を与え
直す回数(ループ回数)を設定する(S212)。例え
ば、ループ回数は9とする。次に、反復解法処理を行う
(S213)。具体的には、図10に示すように、ま
ず、反復解法処理内での各種ワークエリアの初期設定を
行い(S221)、反復解法の最大の試行回数(ループ
回数)をカウンタcountに入れる(S222)。次
に、実際に入力Xから次のXを計算する(S223)。
First, various work areas for arithmetic processing are initialized (S211). Next, when the iterative solution process fails, the number of times (loop number) for resetting the initial value to the counter KAISU is set (S212). For example, the number of loops is 9. Next, iterative solution processing is performed (S213). Specifically, as shown in FIG. 10, first, various work areas in the iterative solution processing are initialized (S221), and the maximum number of trials (loop count) of the iterative solution is entered in the counter count (S222). ). Next, the next X is actually calculated from the input X (S223).

【0007】例えばニュートン法では、 X=X−f(X)/f’(X)…(1) (ただし、f(X)は操作者が入力した式、f’(X)
はf(x)を微分した式にXを代入した値である。)の
計算を行う。
For example, in the Newton method, X = X−f (X) / f ′ (X) (1) (where f (X) is an expression input by the operator, f ′ (X)
Is a value obtained by substituting X into an expression obtained by differentiating f (x). ) Is calculated.

【0008】この計算で何かエラーが起きたときは(S
224)、この反復解法処理を終了する。エラーが無
く、式(1)の値(新たなX)が計算されていれば、解
に達しているか否かを判定して(S225)、解に達し
ていれば終了する。一方、解に達していなければ、co
untの値から1を引いて、S223に戻り、解に達す
るか、countの値がゼロ(S222で設定されたル
ープ回数が終了)になるまで、S223〜S226の処
理を繰り返す。
If any error occurs in this calculation (S
224), the iterative solution processing ends. If there is no error and the value of equation (1) (new X) is calculated, it is determined whether or not the solution is reached (S225), and if the solution is reached, the process ends. On the other hand, if the solution is not reached, co
The value of unt is decremented by 1, the process returns to S223, and the processes of S223 to S226 are repeated until the solution is reached or the value of count becomes zero (the loop count set in S222 ends).

【0009】次に、図9に示すように、この一連の反復
解法処理(S213)で、演算エラーが発生したかどう
かを判断する(S214)。演算エラーが発生せず、解
を正しく計算できたとき、式自体に文法的エラー(シン
タックスエラー)が起きたときなどは、そのままこの演
算処理を終了する。そうでなく演算エラーが発生したと
きは、KAISUの値から1を引いて、KAISUの値
がゼロ(S212で設定されたループ回数が終了)にな
れば終了する(S215)。KAISUの値がゼロでな
ければ、上記解存在範囲内で新たな初期値を作成する
(S216)。具体的には、図11に示すように、操作
者が入力した解存在範囲の上限をR.HANI、下限を
L.HANIとし、新たな初期値を入れる場所をXとし
て、まず、XにR.HANIとL.HANIとの間を8
等分した値を入れる(S231)。次に、カウンタAc
cに(9−KAISU)を入れる。つまり、初期値を作
成する度毎に、Accに0,1,2,…,9が順番に入
る。次に、初期値(L.HANI+X*Acc)を計算
してXに入れる(S233)。これにより、図7(a)
に示すように、L.HANIからR.HANIまで、左
側(小さい側)から順番に初期値を得て、KAISUの
値がゼロになるまで、S213〜S216の処理を繰り
返す。そして、上に述べたように、解が途中で求められ
ればその値の表示を、一方どうしても解が求められない
ときはエラーの表示を行う(図8のS204)。
Next, as shown in FIG. 9, in this series of iterative solution processing (S213), it is judged whether or not a calculation error has occurred (S214). When an arithmetic error does not occur and a solution can be calculated correctly, or when a grammatical error (syntax error) occurs in the expression itself, this arithmetic processing is terminated as it is. Otherwise, if a calculation error occurs, 1 is subtracted from the value of KAISU, and if the value of KAISU becomes zero (the loop count set in S212 ends), the process ends (S215). If the value of KAISU is not zero, a new initial value is created within the solution existence range (S216). Specifically, as shown in FIG. 11, the upper limit of the solution existence range input by the operator is set to R. HANI, the lower limit is L. HANI, and X is a place to put a new initial value. HANI and L.A. 8 with HANI
The equally divided value is entered (S231). Next, the counter Ac
Put (9-KAISU) in c. That is, every time an initial value is created, 0, 1, 2, ... Next, the initial value (L.HANI + X * Acc) is calculated and put in X (S233). As a result, FIG.
As shown in FIG. HANI to R.I. Up to HANI, initial values are sequentially obtained from the left side (smaller side), and the processes of S213 to S216 are repeated until the value of KAISU becomes zero. Then, as described above, if the solution is found midway, the value is displayed, and if the solution cannot be found by any means, an error is displayed (S204 in FIG. 8).

【0010】なお、図12は、関数電卓においてニュー
トン法を実行した場合の表示例を示している。
FIG. 12 shows a display example when the Newton's method is executed on the scientific calculator.

【0011】同図(a)に示すように、アプリケーショ
ンをスタートさせると、「EQUATION?」と表示
して、操作者に式の入力を促す。操作者が例えば式X2
−2=0を入力し、式中の変数Xの初期値としてゼロを
入力すると、それぞれ同図(b),(c)に示すように
表示される。必要ならば、同図(d)に示すように、解
存在範囲を入力する画面にして、解存在範囲[a,b]
を入力する。この例では、a=−1×1010,b=1×
1010である。演算処理を実行して、同図(e)に示す
ように、結果X=1.4142135の表示を行う。こ
こでは、式の左辺Lと右辺Rの値を同時に表示すること
により、解に至ったか否かを操作者に示している。
As shown in FIG. 3A, when the application is started, "EQUATION?" Is displayed and the operator is prompted to enter a formula. If the operator uses the formula X2
When -2 = 0 is input and zero is input as the initial value of the variable X in the formula, the values are displayed as shown in FIGS. If necessary, a screen for inputting the solution existence range is displayed as shown in FIG.
Enter. In this example, a = -1 × 10 10, b = 1 ×
It is 10 10. The calculation process is executed to display the result X = 1.4142135 as shown in FIG. Here, the values of the left side L and the right side R of the equation are simultaneously displayed to indicate to the operator whether or not a solution has been reached.

【0012】[0012]

【発明が解決しようとする課題】しかしながら、前記記
載の技術においては、なお以下のような課題を有してい
る。
However, the above-mentioned technique still has the following problems.

【0013】例えばニュートン法で方程式の解を求める
アプリケーションにおいて(X−2)2+10=0とな
るXを求めることを考えた場合、この式には実数解はな
いため、所定の回数ニュートン法を実行しても解が求め
られず、最終的には計算が打ち切られる。しかし、計算
の途中経過を考えると同じ値の辺りを行ったり来たりし
ているだけであり、無用な時間がかかっているという問
題がある。
For example, when considering to find X such that (X-2) 2 + 10 = 0 in an application that finds the solution of an equation by the Newton method, there is no real number solution in this equation, so the Newton method is executed a predetermined number of times. However, no solution is obtained, and the calculation is eventually terminated. However, considering the progress of the calculation, it is only going back and forth around the same value, and there is a problem that it takes unnecessary time.

【0014】例えばニュートン法で方程式の解を求める
アプリケーションにおいてlogX=0となるXを求め
ることを考えた場合、logXはX>0の範囲でしか式
の値が定義されていないため、計算の途中経過が一度で
もX≦0の範囲に入ると演算エラーとなる。ここで、従
来の如く解存在範囲を8等分して左側(小さい側)から
順番に初期値を与えていく場合、解存在範囲を−10〜
10と設定したとすると、1〜5回目の初期値−10,
−7.5,−5,−2.5,0ではエラーとなり、6回
目の初期値2.5でやっと解が求められる。つまり、あ
る初期値を与えてエラーとなったら、その初期値に近い
値は同じようなエラーが起こり易いにもかかわらず、従
来は解存在範囲内で左側(または右側)から順番に初期
値を与えているため、一旦エラーになると演算時間が長
くなるという問題がある。
For example, in the case of considering X for which logX = 0 in an application for solving the equation by Newton's method, the value of the expression is defined only in the range of X> 0 in logX. A calculation error occurs if the elapsed time falls within the range of X ≦ 0 even once. Here, when the solution existing range is divided into eight equal parts and the initial value is sequentially given from the left side (smaller side) as in the conventional case, the solution existing range is -10 to
If it is set to 10, the initial value for the first to fifth times is -10,
An error occurs at -7.5, -5, -2.5, 0, and the solution is finally obtained at the sixth initial value of 2.5. In other words, if an error occurs when a certain initial value is given, values similar to the initial value are likely to cause similar errors, but conventionally, the initial value was sequentially set from the left (or right) within the solution existence range. Since it is given, there is a problem that the calculation time becomes long once an error occurs.

【0015】また、計算途中で一旦エラーとなった場
合、エラー後の処理は、エラー表示を行うか、または、
別の初期値によって反復解法処理を行うかに限られてい
る。このため、その後の初期値設定を補助することがで
きず、結局、解を求めることができない場合ある。
Further, if an error occurs once during the calculation, the error processing is performed by displaying an error, or
It is limited to performing iterative solution processing with another initial value. For this reason, it may not be possible to assist the subsequent setting of the initial value, and eventually the solution may not be obtained.

【0016】本発明は、上記問題点を解決するためにな
されたもので、その目的とするところは、反復解法を実
行する場合に、簡単な制御で高速に解を求めることかで
き、しかも、一旦エラーとなっても演算処理を継続で
き、解を求める可能性を高めることができる計算装置を
提供することにある。
The present invention has been made to solve the above problems, and an object thereof is to obtain a solution at high speed with simple control when executing an iterative solution method. An object of the present invention is to provide a computing device that can continue arithmetic processing even if an error occurs once and increase the possibility of finding a solution.

【0017】[0017]

【課題を解決するための手段】上記本発明の目的を達成
するため、本発明は、入力された式と、その式中の変数
の初期値と、解存在範囲とに基づいて、制御部によって
反復解法による演算処理を行い、解に達したときは計算
結果の数値、エラー時はエラーメッセージを出力する計
算装置であって、上記制御部が、反復解法による演算処
理の1回目,2回目の初期値として、上記解存在範囲の
下限値と上限値の一方,他方を順に採用し、3回目以降
の初期値として上記解存在範囲内で2m分割(m=1,
2,…)して得た点の値のうち、分割次数mの低い方か
ら順に、かつ、上記次数m内で、直前の初期値から最も
離間した値を採用する制御を行うよう構成したものであ
る。
In order to achieve the above-mentioned object of the present invention, the present invention provides a control unit based on an input expression, an initial value of a variable in the expression, and a solution existence range. A computing device that performs an arithmetic process by the iterative solution method and outputs a numerical value of a calculation result when a solution is reached, and an error message when an error occurs, wherein the control unit controls the first and second arithmetic processes by the iterative solution method. As the initial value, one or the other of the lower limit value and the upper limit value of the solution existence range is sequentially adopted, and 2 m divisions (m = 1, 1) within the solution existence range as the third and subsequent initial values.
2, ...) Among the values of the points obtained by performing the control in such a manner that the division order m is the lowest, and the value that is most distant from the initial value immediately before in the order m is adopted. Is.

【0018】また、本発明は、入力された式と、その式
中の変数の初期値と、解存在範囲とに基づいて、制御部
によって反復解法による演算処理を行い、解に達したと
きは計算結果の数値、エラー時はエラーメッセージを出
力する計算装置であって、反復解法による演算処理の
(n−1)次の途中結果Xn-1とn次の途中結果Xnの値
を保存しておく第2,第1のメモリを備え、上記制御部
が、(n+1)次の途中結果Xn+1の計算途中に演算エ
ラーが起こった場合、上記第2,第1のメモリを参照し
て上記Xn-1とXnとの中点を新たなXnとして求め、こ
のXnの値に基づいて再びXn+1を計算する制御を行うよ
う構成したものである。
Further, according to the present invention, based on the input expression, the initial value of the variable in the expression, and the solution existence range, the control unit performs the arithmetic processing by the iterative solution method, and when the solution is reached, A numerical value of the calculation result, and an error message output device when an error occurs. The calculation device stores the values of the (n-1) th intermediate result Xn-1 and the nth intermediate result Xn of the arithmetic processing by the iterative solution method. If a calculation error occurs in the middle of calculation of the (n + 1) th intermediate result Xn + 1, the control unit is provided with the second and first memories The control is such that the midpoint between Xn-1 and Xn is obtained as a new Xn, and Xn + 1 is calculated again based on the value of this Xn.

【0019】[0019]

【発明の実施の形態】以下に、本発明における計算装置
の実施の形態に関して図面を用いて説明する。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of a computer according to the present invention will be described below with reference to the drawings.

【0020】図1は、本発明における計算装置の外観を
示したものである。
FIG. 1 shows the appearance of a computer according to the present invention.

【0021】この装置は、前面に液晶表示素子(LC
D)からなる表示部101と、入力部としてのキー部1
02を備えている。キー部102は、[0],[1],
[2],[3],[4],[5],[6],[7],
[8],[9][.][(−)]で示す数値入力用キー
と、[×][÷][+][−]で示す四則計算用キー
と、[a]〜[z]で示すアルファベット入力用キー
と、[ENTER]で示す登録および計算実行用キーを
有している。さらに、本発明の特徴を実現するために特
に3つのキーを設けている。それらは、[SOLVE
R]キーは反復解法の実行を開始するためのキー、[S
OLVE]キーは演算を実行するためのキー、[RAN
GE]キーは解存在範囲を入力する画面にするためのキ
ーをそれぞれ示している。
This device has a liquid crystal display element (LC
D) display unit 101 and key unit 1 as an input unit
It is equipped with 02. The key unit 102 includes [0], [1],
[2], [3], [4], [5], [6], [7],
[8], [9] [. ] [(-)] For inputting numerical values, [x] [÷] [+] [-] for calculating four arithmetic keys, [a] to [z] for alphabet input, [ENTR] has a key for registration and calculation execution. In addition, three keys are specifically provided to implement the features of the present invention. They are [SOLVE
The [R] key is a key for starting execution of the iterative solution method, and [S
The [OLVE] key is a key for executing an operation, and [RAN]
The [GE] key represents each key for displaying a screen for entering the solution existence range.

【0022】図2に示すように、装置内部には、表示手
段としての表示部101、および入力手段としてのキー
部102、さらに前記表示部101およびキー部102
につながる制御部(制御手段)としてのCPU(中央演
算処理装置)103と、ROM(リード・オンリ・メモ
リ)104と、RAM(ランダム・アクセス・メモリ)
105を備えている。上記CPU103は、キー部10
2からの入力(キー入力)を受けて、後述する処理を実
行し、表示部101に演算、入力情報および演算結果を
表示する制御を行う。また、ROM104は、キーの入
力、演算、入力情報および演算結果の表示の実行、制御
をするための制御プログラムや、各種定数データ、表示
用のキャラクタジェネレータなどを記憶する。また、R
AM105は、表示用エリア(表示用RAM)と作業用
エリア(ワークエリア)とそれ以外のデータ記憶用エリ
ア等から構成されており、これらのエリアには、キーの
入力、演算、入力情報および演算結果の表示の実行、制
御をするための各種情報や、操作者が入力した数値、数
式などを記憶するとともに、演算の途中経過の値や結果
が記憶されている。
As shown in FIG. 2, a display unit 101 as a display unit, a key unit 102 as an input unit, and the display unit 101 and the key unit 102 are provided inside the apparatus.
CPU (Central Processing Unit) 103 as a control unit (control means) connected to, a ROM (Read Only Memory) 104, and a RAM (Random Access Memory)
105 is provided. The CPU 103 uses the key unit 10
In response to the input from 2 (key input), the process described below is executed, and control is performed to display the calculation, input information, and the calculation result on the display unit 101. Further, the ROM 104 stores a control program for performing key input, calculation, execution of display of input information and calculation result, and control, various constant data, a character generator for display, and the like. Also, R
The AM 105 is composed of a display area (display RAM), a work area (work area), and other data storage areas. In these areas, key input, calculation, input information and calculation are performed. Various kinds of information for executing and controlling the display of results, numerical values and mathematical expressions input by the operator are stored, and values and results in the middle of the calculation are also stored.

【0023】図1に示した本発明の計算装置は、反復解
法を実行する場合、全体としては図8に示したのと同じ
動作を行う。
The computer of the present invention shown in FIG. 1 performs the same operation as shown in FIG. 8 as a whole when executing the iterative solution method.

【0024】すなわち、まず操作者が計算対象となる式
を入力するとともに(S201)、上記式中の変数の初
期値と、必要ならば解存在範囲を入力する(S20
2)。次に、入力した式、初期値の値より実際の演算処
理を行い(S203)、解を求めたときは演算結果の数
値、エラー時はエラーメッセージなどを表示する(S2
04)。
That is, the operator first inputs an equation to be calculated (S201), and also inputs the initial value of the variable in the above equation and, if necessary, the solution existence range (S20).
2). Next, actual calculation processing is performed from the input expression and the initial value (S203), and when the solution is obtained, the numerical value of the calculation result is displayed, and when an error occurs, an error message or the like is displayed (S2).
04).

【0025】この計算装置には、この前提のもとに、従
来の処理に対して、以下に述べる、、の3つの改良が加
えられている。
Based on this premise, this computing apparatus has three improvements, which are described below, in addition to the conventional processing.

【0026】第1の改良は、図9に示した演算処理のう
ち反復解法の実行処理(S213。詳しくは図10に示
す。)を変更したものである。第2の改良は、図9に示
した演算処理のうち初期値作成処理(S216。詳しく
は図11に示す。)を変更したものである。第3の改良
は、図9の演算処理の流れ自体を変更するとともに反復
解法の実行処理を変更したものである。
The first improvement is a modification of the iterative solution execution process (S213; details are shown in FIG. 10) of the arithmetic processes shown in FIG. The second improvement is a modification of the initial value creation processing (S216, which is shown in detail in FIG. 11) of the arithmetic processing shown in FIG. The third improvement is that the flow itself of the arithmetic processing of FIG. 9 is changed and the execution processing of the iterative solution method is changed.

【0027】まず、第1の改良について説明する。ここ
では、従来の反復解法処理(図10)に代えて、次のよ
うな反復解法処理を行う。
First, the first improvement will be described. Here, instead of the conventional iterative solution processing (FIG. 10), the following iterative solution processing is performed.

【0028】なお、図2に示したRAM105内のワー
クエリアに、新たに上限メモリとしてR.KEIKA、
下限メモリとしてL.KEIKAが設定されている。ま
た、第1のメモリとしてoldX(1つ前のX)が設け
られている。
It should be noted that the work area in the RAM 105 shown in FIG. KEIKA,
As a lower limit memory, L. KEIKA is set. Also, oldX (the previous X) is provided as the first memory.

【0029】図3に示すように、まず、反復解法処理内
での各種ワークエリアの初期設定を行う(S101)。
ループに入る前に、解存在範囲の上限,下限を表すR.
KEIKA,L.KEIKAを初期設定する。最初は何
も計算されていないので、求めるべき変数の正の限界お
よび負の限界を入力しておく(S102)。また、反復
解法の最大の試行回数(ループ回数)をカウンタcou
ntに入れる(S103)。次に、oldXに現在のX
を保存する(S104)。これは、後のステップS10
8で、新たな途中結果Xと1つ前の途中結果Xとの大小
を比較するためである。次に、実際に入力Xから次のX
を計算する(S105)。
As shown in FIG. 3, first, various work areas are initialized in the iterative solution processing (S101).
Before entering the loop, R.I.
KEIKA, L .; Initialize KEIKA. Since no calculation has been made at first, the positive and negative limits of the variable to be obtained are input (S102). In addition, the maximum number of trials (loop count) of the iterative solution method is counted by the counter cou.
nt (S103). Then the current X in oldX
Is stored (S104). This is the step S10 described later.
This is for comparing the magnitude of the new intermediate result X and the immediately preceding intermediate result X at 8. Next, from the actual input X to the next X
Is calculated (S105).

【0030】例えばニュートン法では、 X=X−f(X)/f’(X)…(2) (ただし、f(X)は操作者が入力した式、f’(X)
はf(X)を微分した式にXを代入した値である。)の
計算を行う。
For example, in the Newton method, X = X−f (X) / f ′ (X) ... (2) (where f (X) is an expression input by the operator, f ′ (X)
Is a value obtained by substituting X into an expression obtained by differentiating f (X). ) Is calculated.

【0031】この計算で何かエラーが起きたときは(S
106)、この反復解法処理を終了する。エラーが無
く、上記式(2)の値(新たなX)が計算されていれ
ば、解に達しているか否かを判定して(S107)、解
に達していれば終了する。
If any error occurs in this calculation (S
106), and this iterative solution processing ends. If there is no error and the value of equation (2) (new X) is calculated, it is determined whether or not the solution is reached (S107), and if the solution is reached, the process ends.

【0032】一方、解に達していなければ、新たなXが
oldX(1つ前のX)に対して右へ進んでいるか、左
へ進んでいるかを調べる(S108)。XがoldXに
対して左へ進んでいる場合(X<oldX)、R.KE
IKAをoldXとする(S109)。続いて、Xが
R.KEIKAの値とL.KEIKAの値とで定まる解
存在範囲を飛び出しているかどうかをチェックする。X
が左へ進んでいる場合であるから、XをL.KEIKA
と比較する(S110)。逆に、XがoldXに対して
右へ進んでいる場合(X>oldX)、L.KEIKA
をoldXとする(S111)。続いて、XがR.KE
IKAの値とL.KEIKAの値とで定まる解存在範囲
を飛び出しているかどうかをチェックする。Xが右に進
んでいる場合であるから、XをR.KEIKAと比較す
る(S112)。上記S110,S112において、X
がR.KEIKAの値とL.KEIKAの値とで定まる
解存在範囲の外に飛び出しているならば、この反復解法
処理を終了する。
On the other hand, if the solution has not been reached, it is checked whether the new X has proceeded to the right or left with respect to oldX (the previous X) (S108). If X is moving to the left with respect to oldX (X <oldX), R.X. KE
IKA is set to oldX (S109). Subsequently, X is R. KEIKA value and L.K. It is checked whether or not the solution existing range determined by the value of KEIKA is popped out. X
Is proceeding to the left, X is L. KEIKA
(S110). On the contrary, when X is proceeding to the right with respect to oldX (X> oldX), L.L. KEIKA
To oldX (S111). Subsequently, X is R. KE
IKA value and L.I. It is checked whether or not the solution existing range determined by the value of KEIKA is popped out. Since X is moving to the right, X is set to R.R. It is compared with KEIKA (S112). In S110 and S112 above, X
R. KEIKA value and L.K. If it is outside the solution existence range defined by the value of KEIKA, this iterative solution processing ends.

【0033】これに対して、XがR.KEIKAの値と
L.KEIKAの値とで定まる解存在範囲内にあるなら
ば、countの値から1を引いて、countの値が
ゼロ(S222で設定されたループ回数が終了)になっ
たかどうかを判断する(S113)。countの値が
ゼロになっていればこの反復解法処理を終了する一方、
countの値がゼロになっていなければ、解が求まる
か、途中結果が解存在範囲を飛び出すまでS104〜S
113の処理を繰り返す。
On the other hand, when X is R. KEIKA value and L.K. If it is within the solution existence range determined by the value of KEIKA, it is determined whether the value of count has become zero (the number of loops set in S222 ends) by subtracting 1 from the value of count (S113). . If the value of count is zero, this iterative solution processing is terminated, while
If the value of count is not zero, the solution is obtained or the intermediate results jump out of the solution existence range S104 to S104.
The processing of 113 is repeated.

【0034】このように、計算の途中結果Xnが移動し
た範囲に基づいて解存在範囲を規定し、途中結果Xnが
解存在範囲外に出たらその段階で解の探索を打ち切るこ
とによって、無駄な時間を費やすのを避けることがで
き、高速に演算処理を実行することができる。
As described above, the solution existence range is defined based on the range in which the intermediate result Xn moves, and when the intermediate result Xn goes out of the solution existing range, the search for the solution is terminated at that stage, which is wasteful. It is possible to avoid spending time and perform arithmetic processing at high speed.

【0035】次に、第2の改良について説明する。ここ
では、従来の初期値作成処理(図11)に代えて、次の
ような初期値作成処理を行う。なお、図9で示したよう
に、この初期値作成処理が呼び出される毎に、カウンタ
KAISUの値は順番に9,8,7,…2,1に減少し
ている。
Next, the second improvement will be described. Here, instead of the conventional initial value creation processing (FIG. 11), the following initial value creation processing is performed. As shown in FIG. 9, the value of the counter KAISU is sequentially decreased to 9, 8, 7, ... 2, 1 every time this initial value creation process is called.

【0036】操作者が入力した解存在範囲の下限(左
端)をL.HANI、上限(右端)をR.HANIと
し、新たな初期値を入れる場所をXとする。
The lower limit (left end) of the solution existence range input by the operator is L. HANI, the upper limit (far right) to R.I. HANI, and X is a place to put a new initial value.

【0037】図4に示すように、まず、カウンタKAI
SUの値をチェックして(S121)、KAISU=9
(1回目の呼出し)のときは、L.HANI(左端)の
値を初期値Xとする(S122)。また、KAISU=
8(2回目の呼出し)のときは、R.HANI(右端)
の値を初期値Xとする(S123,S124)。KAI
SUの値が9でも8でもないときは、R.HANIの値
とL.HANIの値との差を8等分した値をXに入れる
(S125)。次に、KAISUの値によって分岐をす
る(S126)。すなわち、KAISU=7のときは、
カウンタAccに4をセットして(S129)、(L.
HANI+X*Acc)の値を初期値Xとする(S13
0)。このとき、Acc=4であることから初期値Xは
L.HANI(左端)とR.HANI(右端)との間の
2等分点となる。また、S126でKAISUの値が5
または6のときは、Accに(26−KAISU*4)
をセットして(S128)、同様に(L.HANI+X
*Acc)の値を初期値Xとする(S130)。このと
き、上記L.HANI,R.HANIと上記2等分点と
の間の4等分点が初期値Xとなる。また、S126でK
AISUの値が1,…,4のいずれかであるときは、A
ccに(9−KAISU*2)をセットして、同様に
(L.HANI+X*Acc)の値を初期値Xとする
(S130)。このとき、R.HANIとL.HANI
との間の8等分点が初期値Xとなる。
As shown in FIG. 4, first, the counter KAI
Check the value of SU (S121), KAISU = 9
In the case of (first call), the L. The value of HANI (far left) is set as the initial value X (S122). In addition, KAISU =
8 (second call), R. HANI (far right)
Is set as the initial value X (S123, S124). KAI
When the value of SU is neither 9 nor 8, R.I. HANI value and L.H. A value obtained by dividing the difference from the value of HANI into eight equal parts is put into X (S125). Next, a branch is made according to the value of KAISU (S126). That is, when KAISU = 7,
The counter Acc is set to 4 (S129), and (L.
The value of HANI + X * Acc) is set as the initial value X (S13).
0). At this time, since Acc = 4, the initial value X is L.L. HANI (far left) and R.I. It becomes a bisector between HANI (far right). Also, the value of KAISU is 5 in S126.
Or, in case of 6, Acc (26-KAISU * 4)
Is set (S128), and similarly (L.HANI + X
The value of * Acc) is set as the initial value X (S130). At this time, the above L. HANI, R .; The quadrant between the HANI and the bisector becomes the initial value X. Also, K in S126
When the value of AISU is 1, ..., 4, A
cc is set to (9-KAISU * 2), and the value of (L.HANI + X * Acc) is similarly set as the initial value X (S130). At this time, R. HANI and L.A. HANI
The eight equal points between and are the initial value X.

【0038】このようにした場合、図7(b)に示した
ように、解存在範囲内で過去に採用した初期値と最も遠
い位置に存在する初期値を採用することができる。した
がって、従来に比べて、短い施行回数で解を求めること
が期待できる。
In this case, as shown in FIG. 7B, it is possible to adopt the initial value that is the farthest from the initial value that has been adopted in the past within the solution existence range. Therefore, it can be expected that the solution can be obtained with a shorter number of times of execution than the conventional method.

【0039】例えば、ニュートン法で方程式の解を求め
るアプリケーションにおいてlogX=0となるXを求
めることを考えた場合、初期値の−10でエラーとなっ
た後、次の初期値として10が採用される。この結果、
2回目の初期値で解が求められる。したがって、先に述
べた従来例(6回)に比べて、短い施行回数で解を求め
ることができる。
For example, in an application for obtaining the solution of an equation by the Newton method, when it is considered to obtain X such that logX = 0, after an error occurs at an initial value of -10, 10 is adopted as the next initial value. It As a result,
The solution is obtained with the second initial value. Therefore, the solution can be obtained with a shorter number of times of execution than the conventional example (6 times) described above.

【0040】次に、第3の改良について説明する。ここ
では、従来の演算処理(図9)とそれに含まれる反復解
法処理(図10)に代えて、次のような演算処理とそれ
に含まれる反復解法処理を行う。
Next, the third improvement will be described. Here, instead of the conventional arithmetic processing (FIG. 9) and the iterative solution processing included therein (FIG. 10), the following arithmetic processing and iterative solution processing included therein are performed.

【0041】なお、図2に示したRAM105内のワー
クエリアに、制御用フラグとしてFIRST.flag
が新たに設けられる。また、新たに、計算の途中結果を
保存するための第2のメモリoldX2が設けられる。
In the work area in the RAM 105 shown in FIG. 2, FIRST. flag
Is newly established. In addition, a second memory oldX2 is newly provided to store the intermediate result of the calculation.

【0042】この演算処理は図5に示すような手順で行
う。
This arithmetic processing is performed in the procedure as shown in FIG.

【0043】図5に示すように、まず、演算処理に対す
る各種ワークエリアの初期設定を行う(S131)。次
に、反復解法の処理を失敗したときに、カウンタKAI
SUに初期値を与え直す回数(ループ回数)9を設定す
る(S132)。次に、FIRST.flagの初期設
定として1を設定する。次に、反復解法処理を行う(S
134)。具体的には、図6に示すように、まず、反復
解法処理内での各種ワークエリアの初期設定を行い(S
141)、反復解法の最大の試行回数(ループ回数)を
カウンタcountに入れる(S142)。次に、ol
dXに現在のXの値を入れて保存した後(S143)、
実際に現在のXから次のXを計算する(S144)。
As shown in FIG. 5, first, various work areas for arithmetic processing are initialized (S131). Next, when the iterative solution processing fails, the counter KAI
The number of times (loop number) 9 for resetting the initial value to SU is set (S132). Next, FIRST. 1 is set as the initial setting of the flag. Next, iterative solution processing is performed (S
134). Specifically, as shown in FIG. 6, first, various work areas are initialized in the iterative solution processing (S
141), the maximum number of trials (loop count) of the iterative solution method is put into the counter count (S142). Then ol
After storing the current value of X in dX (S143),
The next X is actually calculated from the current X (S144).

【0044】例えば上記でのニュートン法と同じ式であ
る X=X−f(X)/f’(X)…(2) (ただし、f(X)は操作者が入力した式、f’(X)
はf(X)を微分した式にXを代入した値である。)の
計算を行う。
For example, X = X−f (X) / f ′ (X) (2), which is the same equation as the above Newton's method (where f (X) is an equation input by the operator, f ′ ( X)
Is a value obtained by substituting X into an expression obtained by differentiating f (X). ) Is calculated.

【0045】この計算で何かエラーが起きたときは(S
145)、この反復解法処理を終了する。エラーが無
く、上記式(2)の値(新たなX)が計算されていれ
ば、解に達しているか否かを判定して(S146)、解
に達していれば終了する。
If any error occurs in this calculation (S
145), the iterative solution processing ends. If there is no error and the value of equation (2) (new X) is calculated, it is determined whether or not the solution is reached (S146), and if the solution is reached, the process ends.

【0046】一方、解に達していなければ、新たなXが
正しく計算されたことを表すために、FIRST.fl
agに0を入れる(S147)。また、oldX2に、
上記oldXの値(この時点では1つ前のXの値)を入
れて保存する(S148)。countの値から1を引
いて、S143に戻り、解に達するか、countの値
がゼロ(S142で設定されたループ回数が終了)にな
るまで、S143〜S149の処理を繰り返す。
On the other hand, if the solution has not been reached, FIRST. fl
0 is put in ag (S147). Also, for oldX2,
The value of oldX (the value of X immediately before at this point) is entered and saved (S148). Subtract 1 from the value of count, return to S143, and repeat the processing of S143 to S149 until a solution is reached or the value of count becomes zero (the loop count set in S142 ends).

【0047】次に、図5に示すように、この一連の反復
解法処理(S134)で、演算エラーが発生したかどう
かを判断する(S135)。演算エラーが発生せず、解
を正しく計算できたとき、式自体に文法的エラー(シン
タックスエラー)が起きたときなどは、そのままこの演
算処理を終了する。そうでなく演算エラーが発生したと
きは、KAISUの値から1を引いて、KAISUの値
がゼロ(S132で設定されたループ回数が終了)にな
れば終了する(S136)。
Next, as shown in FIG. 5, in this series of iterative solution processing (S134), it is judged whether or not a calculation error has occurred (S135). When an arithmetic error does not occur and a solution can be calculated correctly, or when a grammatical error (syntax error) occurs in the expression itself, this arithmetic processing is terminated as it is. Otherwise, if a calculation error occurs, 1 is subtracted from the value of KAISU, and if the value of KAISU becomes zero (the number of loops set in S132 ends), the process ends (S136).

【0048】S136でKAISUの値がゼロでなけれ
ば、FIRST.flag=0であるか否か、すなわ
ち、過去に一度でもXを求める計算(図6のS144)
が正しく実行されたか否かを判断する。同時に、エラー
の起きたのがf(X)の計算時であるかどうかを判断す
る(S137)。これは、少なくとも1回はf(X)を
計算できる位置にあったXが、計算できない領域に入っ
たことを知るためである。S137でFIRST.fl
ag≠0であるか、または、エラーの起きたのがf
(X)の計算時でないときは、操作者が設定した解存在
範囲内で新たな初期値を作成する(S138)。なお、
上記の第2の改良に係る初期値作成処理を採用しても良
い。
If the value of KAISU is not zero in S136, FIRST. Whether or not flag = 0, that is, calculation for obtaining X even once in the past (S144 in FIG. 6)
Is executed correctly. At the same time, it is determined whether or not the error occurred when f (X) was calculated (S137). This is to know that X, which was at a position where f (X) can be calculated at least once, has entered a region where it cannot be calculated. FIRST. fl
ag ≠ 0, or an error occurred in f
If it is not time to calculate (X), a new initial value is created within the solution existence range set by the operator (S138). In addition,
The initial value creation processing according to the second improvement described above may be adopted.

【0049】一方、S137でFIRST.flag=
0であり、かつ、エラーの起きたのがf(X)の計算時
であるときは、Xに(oldX+oldX2)/2を入
れる(S139)。このとき、oldXにはエラーを起
こした時の値Xn、oldX2にはoldXの1つ前の
値Xn-1がそれぞれ入っている。そこで、これらold
X,oldX2の中点の値を求めて、新たなXの値とす
るのである。そして、S134に戻って再度同じ反復解
法の計算を行う。Xn-1とXnの中点の値でも同じエラー
となるとき、oldX2はエラーが起こっている間ずっ
とXn-1を保持する。oldXのみ中点の値を入れ直し
ていく。したがって、何かエラーが出なくなるまで、o
ldXの値はoldX2へ近づいてゆき、演算エラーが
発生せず、解を正しく計算できたときは演算処理を終了
する(S135)。
On the other hand, in S137, FIRST. flag =
If it is 0 and an error has occurred during the calculation of f (X), (oldX + oldX2) / 2 is put into X (S139). At this time, oldX contains the value Xn when the error occurred, and oldX2 contains the value Xn-1 immediately before the oldX. So these old
The value of the midpoint of X, oldX2 is obtained and set as the new value of X. Then, returning to S134, the same iterative solution method is calculated again. When the value of the midpoint between Xn-1 and Xn results in the same error, oldX2 holds Xn-1 throughout the error. The value of the middle point is reset only for oldX. Therefore, until there is no error, o
The value of ldX approaches the value of oldX2. When no calculation error occurs and the solution can be calculated correctly, the calculation process ends (S135).

【0050】このように、一旦未定義の領域に入り込み
エラーとなっても、反復解法を継続することができ、し
たがって、従来に比べて、解が求められる可能性を高め
ることができる。また、より広い範囲の初期値から解を
求めることができる。
In this way, even if an error occurs once in an undefined area, the iterative solution method can be continued, and therefore the possibility of finding a solution can be increased as compared with the conventional method. Also, a solution can be obtained from a wider range of initial values.

【0051】なお、初回の計算(S134)でエラーと
なったときは、Xn-1が存在せずoldX2は不定とな
っている。このため、上記Xn-1とXnとの中点を求める
計算(S139)はできない。このときは、S138に
進んで、初期値を作成し直すようにする。
When an error occurs in the first calculation (S134), Xn-1 does not exist and oldX2 is indefinite. Therefore, the calculation (S139) for obtaining the midpoint between Xn-1 and Xn cannot be performed. At this time, the process proceeds to S138 to recreate the initial value.

【0052】以上、本発明における計算装置の改良点の
特徴は、下記の(1),(2),(3)の3通りとな
る。
As described above, the features of the improvement of the computer according to the present invention are the following three (1), (2) and (3).

【0053】(1)反復解法においてX0,X1,X2
と計算していくとき、式のグラフが滑らかであるなら
ば、X0よりX1が、X1よりX2が、より真の解に近
づいていることが期待される。
(1) X0, X1, X2 in the iterative solution method
If the graph of the equation is smooth, it is expected that X1 is closer to X1 than X0 and X2 is closer to X1 than X1.

【0054】例えば、X0から次のX1を計算してX0
より右側(大きい側)にきた場合、現在求めている解の
位置はX0よりも右側にあるであろうことが期待され
る。逆に言えば、計算の途中結果XnがX0よりも左側
(小さい側)に来て次のXn+1が右側に来た場合、以後
同じ辺りを行ったり来たりすることが多く、その後計算
を続けても真の解に到達しない公算が大きいと考えられ
る。
For example, the next X1 is calculated from X0 and X0 is obtained.
When it comes to the right side (larger side), it is expected that the position of the solution currently sought will be on the right side of X0. Conversely, when the intermediate result Xn of the calculation comes to the left (smaller side) of X0 and the next Xn + 1 comes to the right, it often goes back and forth around the same point. It is likely that the true solution will not be reached even if continued.

【0055】そこで、第1の改良を取り入れた計算装置
では、計算の途中結果Xnに基づいて解存在範囲を限定
し、次の途中結果Xn+1が上記限定した解存在範囲外に
出たら、その時点で解の探索を打ち切ることにする。具
体的には、解存在範囲を記憶しておく下限メモリL.K
EIKA,上限メモリR.KEIKAを設け、初期設定
として数値の定義されている範囲を与えておく。解を求
める過程で、XnからXn+1を計算したとき、Xn+1がXn
より右側ならXnより左側を、Xn+1がXnより左側なら
Xnより右側を、解存在範囲から除外する。そして、Xn
+1がこの範囲外に出れば計算を打ち切る。これにより、
無駄な時間を費やすのが避けられ、動作が高速になる。
Therefore, in the computer incorporating the first improvement, the solution existence range is limited based on the intermediate result Xn of the calculation, and when the next intermediate result Xn + 1 is out of the limited solution existence range, At that point, the search for the solution is terminated. Specifically, the lower limit memory L. K
EIKA, upper memory R. KEIKA is provided, and a defined range of numerical values is given as an initial setting. When Xn + 1 is calculated from Xn in the process of finding a solution, Xn + 1 is Xn
If it is on the right side, the left side of Xn is excluded from the solution existence range, and if Xn + 1 is the left side of Xn, the right side of Xn is excluded from the solution existence range. And Xn
If +1 goes out of this range, the calculation is aborted. This allows
It avoids wasting time and operates faster.

【0056】なお、一度同じ辺りを行ったり来たりする
と、その後計算を続けても真の解に到達しないという考
え方は、数学的には正しいものではない。計算を打ち切
らずに継続すれば解ける式が幾つでも存在する。ただ経
験的には、ほとんどの一般的な式は、一度行ったり来た
りするとそれ以後解に至らずに同じ辺りを行き来すると
いうことが言える。この改良は、そのような経験則を実
際の処理に取り入れたものである。
It should be noted that the idea that once the user goes back and forth around the same area, the true solution will not be reached even if the calculation is continued, is not mathematically correct. There are any number of expressions that can be solved if the calculation is continued without stopping. However, empirically, it can be said that most general expressions move back and forth once and then back and forth without reaching a solution. This refinement incorporates such heuristics into the actual processing.

【0057】(2)第2の改良を取り入れた計算装置で
は、操作者が入力した解存在範囲から初期値を作成する
場合、上記解存在範囲内で過去に採用した初期値と最も
遠い位置に存在する初期値を採用する。すなわち、上記
解存在範囲内で2m分割(m=1,2,…)して得た点
の値のうち、分割次数mの低い方から順に、かつ、上記
次数m内で、直前の初期値から最も離間した値を採用す
る。これにより、従来に比べて、短い施行回数で解が求
められる可能性が高まる。
(2) In the computer incorporating the second improvement, when the initial value is created from the solution existence range input by the operator, it is located at the farthest position from the previously adopted initial value within the solution existence range. Use the existing initial value. That is, of the values of the points obtained by dividing 2m (m = 1, 2, ...) Within the solution existence range, the division order m is in descending order, and the previous initial value is within the order m. The value farthest from is used. As a result, it is more likely that a solution will be obtained with a shorter number of executions than in the past.

【0058】例えば、図7(b)に例示するように、操
作者が入力した解存在範囲が、L.HANI,R.HA
NIに下限,上限として設定されているものとする。
For example, as illustrated in FIG. 7B, the solution existence range input by the operator is L. HANI, R .; HA
It is assumed that NI is set as a lower limit and an upper limit.

【0059】まず、L.HANIとR.HANIを順に
初期値として与える(なお、図中の数字は初期値として
採用される順番を示している。)。次に、L.HANI
(左端)とR.HANI(右端)との間の2等分点の値
を初期値として与える。次にL.HANIとR.HAN
Iとの間の4等分点であって2等分点ではない点(L.
HANI,R.HANIと上記2等分点との間の点)の
値を順に初期値として与える。次に、L.HANIと
R.HANIとの間の8等分点であって2等分点,4等
分点ではない点の値を同様にして与える。なお、初期値
計算に際して、何等分点であるかは、カウンタ内に入っ
ている初期値作成の回数に基づいて定めるものとする。
First, L. HANI and R.A. HANI is sequentially given as an initial value (note that the numbers in the figure indicate the order of being adopted as an initial value). Next, L. HANI
(Far left) and R. The value of the bisector between HANI (right end) is given as an initial value. Next, L. HANI and R.A. HAN
A point that is a quadrant between I and I and is not a bisector (L.
HANI, R .; The values of points between HANI and the above-mentioned bisecting points) are sequentially given as initial values. Next, L. HANI and R.A. The values of points that are equal to 8 and that are not equal to or equal to 4 points of HANI are similarly given. When calculating the initial value, the number of division points is determined based on the number of times the initial value is stored in the counter.

【0060】(3)反復解法の計算途中でエラーが起こ
って計算継続が不可能になった場合であっても、そのエ
ラーの種類と起こった位置によっては、エラーが起こる
以前の途中結果の値を参照することにより解へ到達でき
ることがある。
(3) Even if an error occurs during the calculation of the iterative solution method and it becomes impossible to continue the calculation, the value of the intermediate result before the error occurs depending on the type of the error and the position where the error occurs. The solution may be reached by referring to.

【0061】具体的には、反復解法による演算処理の
(n−1)次の途中結果Xn-1とn次の途中結果Xnの値
を保存しておく第2,第1のメモリを備える。
Specifically, the second and first memories are provided for storing the values of the (n-1) th intermediate result Xn-1 and the nth intermediate result Xn of the arithmetic processing by the iterative solution method.

【0062】例えば、式f(X)の解を求めている場合
について考える。数回計算を繰り返した後、途中結果X
nに対して次のXn+1の計算している最中、つまりf(X
n)の計算中にエラーが起こったとする。f(Xn-1)の
値が計算できて、解へと近づいてきたのにf(Xn)で
エラーとなったということは、解の位置を飛び越してエ
ラーとなる領域に入った可能性が高く、したがって、X
n-1とXnとの間を調べれば解が存在する可能性が高いと
考えられる。しかし、Xn-1とXnとの間を調べるには、
そこに至った反復解法とは別の方法が必要となる。
Consider, for example, the case where the solution of the expression f (X) is obtained. After repeating the calculation several times, the intermediate result X
While calculating the next Xn + 1 for n, that is, f (X
Suppose an error occurred during the calculation of n). The value of f (Xn-1) could be calculated, and an error occurred at f (Xn) even though the solution was approaching, so it is possible that the position of the solution was skipped and the error occurred. High, therefore X
It is considered that there is a high possibility that a solution exists by examining between n-1 and Xn. But to find out between Xn-1 and Xn,
A method different from the iterative solution method that led to it is needed.

【0063】そこで、第3の改良を取り入れた計算装置
では、Xn-1とXnの値を保存しておくメモリエリアを設
けて、エラーが起こった場合Xn-1とXnとの間を調べれ
ば解が存在する可能性が高いとき、上記第2,第1のメ
モリを参照して計算をやり直し、Xn-1とXnとの中点を
Xnとする。そして、次のXn+1が計算できるまで計算を
繰り返す。これにより、一旦未定義の領域に入り込みエ
ラーとなっても、反復解法が継続される。したがって、
従来に比べて、解が求められる可能性が高まる。また、
より広い範囲の初期値から解が求められるようになる。
Therefore, in the computer incorporating the third improvement, a memory area for storing the values of Xn-1 and Xn is provided, and when an error occurs, the area between Xn-1 and Xn is checked. When there is a high possibility that a solution exists, the second and first memories are referred to and the calculation is performed again, and the midpoint between Xn-1 and Xn is set to Xn. Then, the calculation is repeated until the next Xn + 1 can be calculated. As a result, the iterative solution method is continued even if an error is entered once in an undefined area. Therefore,
There is a higher possibility that a solution will be required than in the past. Also,
The solution can be obtained from a wider range of initial values.

【0064】以上、ここまで挙げた実施形態における内
容は、本発明の主旨を変えない限り、上記記載内容に限
定されるものではない。
The contents of the above-described embodiments are not limited to the above contents unless the gist of the present invention is changed.

【0065】[0065]

【発明の効果】以上のように、本発明によれば、従来の
計算装置に比べて、短い施行回数で解を求めることがで
きる。
As described above, according to the present invention, it is possible to obtain a solution with a shorter number of times of execution as compared with the conventional computer.

【0066】又、本発明によれば、従来の計算装置に比
べて、解が求められる可能性を高めることができ、ま
た、より広い範囲の初期値から解を求めることができ
る。
Further, according to the present invention, it is possible to increase the possibility of obtaining a solution and to obtain a solution from a wider range of initial values, as compared with the conventional computing device.

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

【図1】本発明における計算装置の外観を示す図であ
る。
FIG. 1 is a diagram showing an external appearance of a computer according to the present invention.

【図2】上記本発明の計算装置のハードウエアの構成を
示す図である。
FIG. 2 is a diagram showing a hardware configuration of the computer according to the present invention.

【図3】上記本発明の計算装置の動作フローを示す図で
ある。
FIG. 3 is a diagram showing an operation flow of the computer of the present invention.

【図4】上記本発明の計算装置の動作フローを示す図で
ある。
FIG. 4 is a diagram showing an operation flow of the computer of the present invention.

【図5】上記本発明の計算装置の動作フローを示す図で
ある。
FIG. 5 is a diagram showing an operation flow of the computer of the present invention.

【図6】上記本発明の計算装置の動作フローを示す図で
ある。
FIG. 6 is a diagram showing an operation flow of the computer of the present invention.

【図7】上記本発明の計算装置と従来の計算装置の初期
値の設定順を説明する図である。
FIG. 7 is a diagram for explaining the order of setting the initial values of the computer of the present invention and the conventional computer.

【図8】従来および上記本発明の計算装置の動作フロー
を示す図である。
FIG. 8 is a diagram showing an operation flow of a conventional computing device and the computing device of the present invention.

【図9】従来の計算装置の動作フローを示す図である。FIG. 9 is a diagram showing an operation flow of a conventional computing device.

【図10】従来の計算装置の動作フローを示す図であ
る。
FIG. 10 is a diagram showing an operation flow of a conventional computing device.

【図11】従来の計算装置の動作フローを示す図であ
る。
FIG. 11 is a diagram showing an operation flow of a conventional computing device.

【図12】従来および上記本発明の計算装置の表示例を
示す図である。
FIG. 12 is a diagram showing a display example of a conventional and the above-described computer of the present invention.

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

101 表示部 102 入力部 103 CPU 104 ROM 105 RAM 101 display 102 Input section 103 CPU 104 ROM 105 RAM

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 入力された式と、その式中の変数の初期
値と、解存在範囲とに基づいて、制御部によって反復解
法による演算処理を行い、解に達したときは計算結果の
数値、エラー時はエラーメッセージを出力する計算装置
であって、 上記制御部は、反復解法による演算処理の1回目,2回
目の初期値として、上記解存在範囲の下限値と上限値の
一方,他方を順に採用し、3回目以降の初期値として上
記解存在範囲内で2m分割(m=1,2,…)して得た
点の値のうち、分割次数mの低い方から順に、かつ、上
記次数m内で、直前の初期値から最も離間した値を採用
する制御を行うことを特徴とする計算装置。
1. A control unit performs arithmetic processing by an iterative solution method based on an input expression, initial values of variables in the expression, and a solution existence range, and when a solution is reached, a numerical value of a calculation result is obtained. In the calculation device that outputs an error message when an error occurs, the control unit sets one or the other of the lower limit value and the upper limit value of the solution existence range as the first and second initial values of the calculation process by the iterative solution method. Among the values of the points obtained by dividing 2m (m = 1, 2, ...) In the solution existence range as an initial value for the third and subsequent times, in order from the lowest division order m, and A computing device, which performs control to adopt a value that is most distant from an initial value immediately before within the order m.
【請求項2】 入力された式と、その式中の変数の初期
値と、解存在範囲とに基づいて、制御部によって反復解
法による演算処理を行い、解に達したときは計算結果の
数値、エラー時はエラーメッセージを出力する計算装置
であって、 反復解法による演算処理の(n−1)次の途中結果Xn-
1とn次の途中結果Xnの値を保存しておく第2,第1の
メモリを備え、 上記制御部は、(n+1)次の途中結果Xn+1の計算途
中に演算エラーが起こった場合、上記第2,第1のメモ
リを参照して上記Xn-1とXnとの中点を新たなXnとし
て求め、このXnの値に基づいて再びXn+1を計算する
制御を行うことを特徴とする計算装置。
2. The numerical value of the calculation result when a solution is reached by a control unit performing arithmetic processing by an iterative solution method based on an input expression, initial values of variables in the expression, and a solution existence range. , A calculation device which outputs an error message at the time of error, and (n-1) next intermediate result Xn- of the arithmetic processing by the iterative solution method.
The second and the first memories for storing the values of the intermediate results Xn of the 1st and nth order are provided, and the control unit is configured to calculate the intermediate result Xn + 1 of the (n + 1) th order when an operation error occurs. , The second and first memories are referred to, the midpoint between Xn-1 and Xn is obtained as a new Xn, and control is performed to calculate Xn + 1 again based on the value of Xn. And computing device.
JP2002277151A 2002-09-24 2002-09-24 Computer Pending JP2003150565A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002277151A JP2003150565A (en) 2002-09-24 2002-09-24 Computer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002277151A JP2003150565A (en) 2002-09-24 2002-09-24 Computer

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP33036198A Division JP3372492B2 (en) 1993-06-15 1998-11-20 Computing device

Publications (1)

Publication Number Publication Date
JP2003150565A true JP2003150565A (en) 2003-05-23

Family

ID=19197001

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002277151A Pending JP2003150565A (en) 2002-09-24 2002-09-24 Computer

Country Status (1)

Country Link
JP (1) JP2003150565A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102063403A (en) * 2009-11-12 2011-05-18 卡西欧计算机株式会社 Electronic calculator

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102063403A (en) * 2009-11-12 2011-05-18 卡西欧计算机株式会社 Electronic calculator
JP2011107772A (en) * 2009-11-12 2011-06-02 Casio Computer Co Ltd Electronic computer and program therefor
US8671125B2 (en) 2009-11-12 2014-03-11 Casio Computer Co., Ltd Electronic calculator and computer-readable medium

Similar Documents

Publication Publication Date Title
EP1046123B1 (en) Modeling system having constraint solvers
Sutton et al. Temporal-difference networks
Geib et al. A probabilistic plan recognition algorithm based on plan tree grammars
Jovanovic et al. Integer Parameter Synthesis for Timed Automata.
KR20080101870A (en) Learner for resource constrained devices
Aguirregabiria et al. Dynamic games in empirical industrial organization
Costa et al. Relaxations of multilinear convex envelopes: dual is better than primal
Chatterjee et al. POMDPs under probabilistic semantics
Jovanović et al. Integer parameter synthesis for timed automata
JPH0721131A (en) Calculating device
Wang et al. Executable code actions elicit better llm agents
JP2003150565A (en) Computer
WO2015177855A1 (en) Assembly sequence generating device, assembly sequence generating method and assembly sequence generating program
JP3372492B2 (en) Computing device
Ponce A novel artificial hydrocarbon networks based value function approximation in hierarchical reinforcement learning
US20050091347A1 (en) Reducing recompilation frequency
Shah et al. An ellipsoid algorithm for equality-constrained nonlinear programs
Traonouez A parametric counterexample refinement approach for robust timed specifications
Rugenstein et al. Active set strategies in an ellipsoid algorithm for nonlinear programming
Fischer An object-oriented construction and tool kit for human-computer communication
Eibelshäuser et al. sgamesolver: A Python package to solve stochastic games
Suzuki Measurement-theoretic foundations of dynamic epistemic preference logic
CN109032772A (en) A kind of embedded software method for managing timer and system
Yulianto et al. Computation Reduction for IRIS Process using DT-MSOF Method.
Jadhav Algorithms: Recursion and Iteration

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20040330