コンテンツにスキップ

利用者:Glayhours/sandbox


位取り記数法

特定の底での表示アルゴリズム

[編集]

xN 進表示を得るアルゴリズムを以下に示す。

整数の表示アルゴリズム

[編集]

整数 xN 進表示:

は以下の総和を意味する:

ここで sx の符号を表し、ゼロまたは正の数に対して +、負の数に対して をとる。dkk + 1 桁目の位の値であり、N は位取り記数法の底である。

位の値 dk は、x絶対値 |x|N で次々と割った余りとして得られる:

ここで qkxNk 回割った商であり、qkNqk−1 < (qk + 1)N を満たす。より具体的には例えば、以下のように行う[注 1]

  1. : 一時変数 qx の絶対値を代入する
  2. : ループ回数の初期化
  3. である限り以下を行う:
    1. : N で割った余りより k + 1 桁目を求める
    2. : N で割った商を求め、q の値を更新する
    3. : ループ回数 k を更新する

上記の方法で得られた数列 dk から xN 進表示の値を印字するには、0 から N − 1 までの数に対応した数字 を用い、各位を と置き換えればよい。

桁数 n は絶対値 |x|N を底とする対数に概ね比例する:

床関数であり、ここでは対数の整数部を得るために使う[注 2]

小数の表示アルゴリズム

[編集]

x有理数の場合、N 進表示は小数部を持ち得る。整数部に関しては整数の N 進表示アルゴリズムをそのまま用いることができる。小数部に関しても整数の場合と同様の流れで N 進表示を得られる:

  1. : 一時変数 xx の値の小数部を代入する
  2. x′ = 0 なら処理を終了する
  3. : ループ回数の初期化
  4. かつ である限り以下を行う(λ は適当なしきい値):
    1. : N 倍して桁を1つずらす
    2. : 整数部を取り出し小数第 k + 1 桁目を求める
    3. : 最上位の桁を 0 にする
    4. : ループ回数 k を更新する

x を表す既約分数の分母が底 N の素因数の積で表せるなら x は有限小数として表せるが、そうでない場合は循環小数となる。


2の補数

ブースの乗算アルゴリズム

アルゴリズム

[編集]

以下では被乗数 X と乗数 Y乗算を扱い、その部分積の和を P で表す。乗数 Y二進表示yN−1yN−2y1y0 (yi ∈ {0, 1}) と表す。NYビット数である。

原論文の方法

[編集]

ブースの原論文におけるアルゴリズムは以下の通り[1]

  1. i = 0 から i = N − 1 まで順に以下を行う:
  2. yiyi−1 ∈ {00, 01, 10, 11} の値を判定する:
    • yiyi−1 = 00 の場合:何もしない
    • yiyi−1 = 11 の場合:何もしない
    • yiyi−1 = 01 の場合:PX を加える
    • yiyi−1 = 10 の場合:P から X を引く
  3. iN − 1 なら P を 1 ビット右にシフトする

Euler's continued fraction formula oldid=1165374705

オイラーの連分数公式オイラーのれんぶんすうこうしき: Euler's.continued fraction)は様々な無限級数と無限連分数とを結びつける、複素解析における公式の一つ。オイラーの連分数公式は、レオンハルト・オイラーの1748年の著書『無限解析序説』[2]の中で初めて示された。

オイラーの連分数公式は、無限連分数の収束英語版を調べるための有力な手法として利用される。

有限連分数の公式

[編集]

オイラーは、有限和と有限の連分数を結びつける次の公式を導いた:

あるいはより簡潔な一般化連分数の記法を用いて、

この等式は n に関する数学的帰納法により容易に導ける。もし左辺の和の極限収束級数になるなら、右辺は収束する無限連分数を与える。

無限連分数の公式

[編集]

ri複素数とし、x を以下の無限級数として定義する:

すると、帰納法により以下の連分数表示が得られる:

上記の等式は、無限連分数の n 番目の近似分数が無限級数の n 番目の部分和に等しいこととして理解される。従って、級数が収束ないし一様収束するなら、ri Here equality is to be understood as equivalence, in the sense that the n'th convergent of each continued fraction is equal to the n'th partial sum of the series shown above. So if the series shown is convergent – or uniformly convergent, when the ri's are functions of some complex variable z – then the continued fractions also converge, or converge uniformly.[3]

Proof by induction

[編集]

Theorem: Let be a natural number. For complex values ,

and for complex values ,

Proof: We perform a double induction. For , we have

and

Now suppose both statements are true for some .

We have where

by applying the induction hypothesis to .

But if implies implies , contradiction. Hence

completing that induction.

Note that for ,

if , then both sides are zero.

Using and , and applying the induction hypothesis to the values ,

completing the other induction.

As an example, the expression can be rearranged into a continued fraction.

This can be applied to a sequence of any length, and will therefore also apply in the infinite case.

Examples

[編集]

The exponential function

[編集]

The exponential function ex is an entire function with a power series expansion that converges uniformly on every bounded domain in the complex plane.

The application of Euler's continued fraction formula is straightforward:

Applying an equivalence transformation that consists of clearing the fractions this example is simplified to

and we can be certain that this continued fraction converges uniformly on every bounded domain in the complex plane because it is equivalent to the power series for ex.

The natural logarithm

[編集]

The Taylor series for the principal branch of the natural logarithm in the neighborhood of 1 is well known:

This series converges when |x| < 1 and can also be expressed as a sum of products:[4]

Applying Euler's continued fraction formula to this expression shows that

and using an equivalence transformation to clear all the fractions results in


This continued fraction converges when |x| < 1 because it is equivalent to the series from which it was derived.[4]

The trigonometric functions

[編集]

The Taylor series of the sine function converges over the entire complex plane and can be expressed as the sum of products.

Euler's continued fraction formula can then be applied

An equivalence transformation is used to clear the denominators:

The same argument can be applied to the cosine function:

The inverse trigonometric functions

[編集]

The inverse trigonometric functions can be represented as continued fractions.

An equivalence transformation yields

The continued fraction for the inverse tangent is straightforward:

A continued fraction for π

[編集]

We can use the previous example involving the inverse tangent to construct a continued fraction representation of π. We note that

And setting x = 1 in the previous result, we obtain immediately

The hyperbolic functions

[編集]

Recalling the relationship between the hyperbolic functions and the trigonometric functions,

And that the following continued fractions are easily derived from the ones above:

The inverse hyperbolic functions

[編集]

The inverse hyperbolic functions are related to the inverse trigonometric functions similar to how the hyperbolic functions are related to the trigonometric functions,

And these continued fractions are easily derived:

関連項目

[編集]

脚注

[編集]

注釈

[編集]
  1. ^ 以下の説明において、左矢印(←)は左辺の変数へ右辺の値を割り当てる操作(代入)を意味する。
  2. ^ 対数の性質より、logN Nm = m であるため、Nmy < Nm+1 を満たす正の整数 y について、その対数 logN y の整数部は m となる。従って対数に床関数を適用することで、正整数 yN 進法での桁数 m + 1 が得られる。

出典

[編集]
  1. ^ Booth 1950.
  2. ^ Euler, Leonhard (1748). “ⅩⅧ. De Fractionibus Continuis” (ラテン語). Introductio in analysin infinitorum. I 
  3. ^ H. S. Wall, Analytic Theory of Continued Fractions, D. Van Nostrand Company, Inc., 1948; reprinted (1973) by Chelsea Publishing Company ISBN 0-8284-0207-8, p. 17.
  4. ^ a b This series converges for |x| < 1, by Abel's test (applied to the series for log(1 − x)).

参考文献

[編集]