<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
		<id>https://is.zng.info/wiki/generic/index.php?action=history&amp;feed=atom&amp;title=%E9%80%A3%E7%B6%9A%E7%B3%BB%E3%82%A2%E3%83%AB%E3%82%B4%E3%83%AA%E3%82%BA%E3%83%A0</id>
		<title>連続系アルゴリズム - 変更履歴</title>
		<link rel="self" type="application/atom+xml" href="https://is.zng.info/wiki/generic/index.php?action=history&amp;feed=atom&amp;title=%E9%80%A3%E7%B6%9A%E7%B3%BB%E3%82%A2%E3%83%AB%E3%82%B4%E3%83%AA%E3%82%BA%E3%83%A0"/>
		<link rel="alternate" type="text/html" href="https://is.zng.info/wiki/generic/index.php?title=%E9%80%A3%E7%B6%9A%E7%B3%BB%E3%82%A2%E3%83%AB%E3%82%B4%E3%83%AA%E3%82%BA%E3%83%A0&amp;action=history"/>
		<updated>2026-04-07T17:26:44Z</updated>
		<subtitle>このウィキのこのページに関する変更履歴</subtitle>
		<generator>MediaWiki 1.25.2</generator>

	<entry>
		<id>https://is.zng.info/wiki/generic/index.php?title=%E9%80%A3%E7%B6%9A%E7%B3%BB%E3%82%A2%E3%83%AB%E3%82%B4%E3%83%AA%E3%82%BA%E3%83%A0&amp;diff=127&amp;oldid=prev</id>
		<title>2005年11月29日 (火) 09:51にMaintenance scriptによる</title>
		<link rel="alternate" type="text/html" href="https://is.zng.info/wiki/generic/index.php?title=%E9%80%A3%E7%B6%9A%E7%B3%BB%E3%82%A2%E3%83%AB%E3%82%B4%E3%83%AA%E3%82%BA%E3%83%A0&amp;diff=127&amp;oldid=prev"/>
				<updated>2005-11-29T09:51:58Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&#039;diff diff-contentalign-left&#039;&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;col class=&#039;diff-marker&#039; /&gt;
				&lt;col class=&#039;diff-content&#039; /&gt;
				&lt;tr style=&#039;vertical-align: top;&#039;&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;←前の版&lt;/td&gt;
				&lt;td colspan=&#039;2&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;2005年11月29日 (火) 09:51時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L6&quot; &gt;6行目:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;6行目:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;I.Newton法によるもの&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;I.Newton法によるもの&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;$$ &lt;/del&gt;x^2-a=0&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;x^2-a=0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;x_{n+1} = \frac{1}{2}(x_n+\frac{a}{x_n})&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;x_{n+1} = \frac{1}{2}(x_n+\frac{a}{x_n})&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;x_{n+1} - \root{a} = \frac{1}{2x_n}(x_n-\root{a})^2&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;x_{n+1} - \root{a} = \frac{1}{2x_n}(x_n-\root{a})^2&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Maintenance script</name></author>	</entry>

	<entry>
		<id>https://is.zng.info/wiki/generic/index.php?title=%E9%80%A3%E7%B6%9A%E7%B3%BB%E3%82%A2%E3%83%AB%E3%82%B4%E3%83%AA%E3%82%BA%E3%83%A0&amp;diff=126&amp;oldid=prev</id>
		<title>Maintenance script: ページの作成:「11/28  連続系    普通関数  log, exp, sin, cos, tan, arctan, sqrt    I.Newton法によるもの  $$ x^2-a=0  x_{n+1} = \frac{1}{2}(x_n+\frac{a}{x_n})  x_{n+1} - \ro...」</title>
		<link rel="alternate" type="text/html" href="https://is.zng.info/wiki/generic/index.php?title=%E9%80%A3%E7%B6%9A%E7%B3%BB%E3%82%A2%E3%83%AB%E3%82%B4%E3%83%AA%E3%82%BA%E3%83%A0&amp;diff=126&amp;oldid=prev"/>
				<updated>2005-11-29T09:07:10Z</updated>
		
		<summary type="html">&lt;p&gt;ページの作成:「11/28  連続系    普通関数  log, exp, sin, cos, tan, arctan, sqrt    I.Newton法によるもの  $$ x^2-a=0  x_{n+1} = \frac{1}{2}(x_n+\frac{a}{x_n})  x_{n+1} - \ro...」&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;11/28&lt;br /&gt;
連続系&lt;br /&gt;
&lt;br /&gt;
普通関数&lt;br /&gt;
log, exp, sin, cos, tan, arctan, sqrt&lt;br /&gt;
&lt;br /&gt;
I.Newton法によるもの&lt;br /&gt;
$$ x^2-a=0&lt;br /&gt;
x_{n+1} = \frac{1}{2}(x_n+\frac{a}{x_n})&lt;br /&gt;
x_{n+1} - \root{a} = \frac{1}{2x_n}(x_n-\root{a})^2&lt;br /&gt;
相対誤差：\frac{x_{n+1}-\root{a}}{\root{a}}=\frac{\root{a}}{2x_n}(\frac{x_m-\root{a}}{\root{a}})^2&lt;br /&gt;
&lt;br /&gt;
※x_{n+1} = x_n - \frac{1}{2}(x_n-\frac{a}{x_n})&lt;br /&gt;
　とすると、1bit精度が良くなる&lt;br /&gt;
&lt;br /&gt;
32bit IEEE: \epsilon_m = 2^{-24}&lt;br /&gt;
N回Newton法を適用することを考える。&lt;br /&gt;
|\frac{x_N-\root{a}}{\root{a}}| ~~ 2^{-2x}&lt;br /&gt;
N-1 ~~ 2^{-12}&lt;br /&gt;
N-2 ~~ 2^{-6}&lt;br /&gt;
&lt;br /&gt;
2^{-6}の初期値が用意できれば、”３回”でよい。&lt;br /&gt;
正規化：&lt;br /&gt;
a = 1.f * 2^{e-127}&lt;br /&gt;
eが奇数(1-253)&lt;br /&gt;
\root{a} = \root{1.f}2^\frac{e-127}{2}&lt;br /&gt;
eが偶数&lt;br /&gt;
\root{a} = \root{2*1.f}2^\frac{e-127}{2}&lt;br /&gt;
&lt;br /&gt;
64bit IEEE&lt;br /&gt;
\epsilon_M = 2^{-53}&lt;br /&gt;
１回：2^{-26}&lt;br /&gt;
２回：2^{-13]&lt;br /&gt;
３回：2^{-6}&lt;br /&gt;
&lt;br /&gt;
初期値の別の求め方&lt;br /&gt;
多項式を使う（単精度では多項式、倍精度では一回Newton法を用いる）&lt;br /&gt;
&lt;br /&gt;
II.多項式近似&lt;br /&gt;
log,exp,sin,cos,tan,tan^{-1}&lt;br /&gt;
！全区間を多項式で表現することはできない&lt;br /&gt;
（sin,cosはどの区間でも値域は-1から1の間だが、どんな多項式も発散するから）&lt;br /&gt;
→基本区間への変換（が必要）&lt;br /&gt;
sin関数&lt;br /&gt;
基本区間を-\frac{\pi}{2}〜\frac{\pi}{2}とする。&lt;br /&gt;
（公式）&lt;br /&gt;
n:整数&lt;br /&gt;
	\sin(2\pin+x) = \sin(x)&lt;br /&gt;
	\sin(\frac{\pi}{2}-x) = \sin(\frac{\pi}{2}+x)&lt;br /&gt;
&lt;br /&gt;
x:radian&lt;br /&gt;
	\sin(x) : x は任意の実数&lt;br /&gt;
	x_1 = \frac{2}{\pi}x&lt;br /&gt;
	x_2 = x + 2\pi└\frac{x_1+1}{4}┘（切捨て）(-\frac{\pi}{2}&amp;lt;=x2&amp;lt;\frac{3\pi}{2}）&lt;br /&gt;
	x_3 = \frac{2}{\pi}x_2 (-1&amp;lt;= x3 &amp;lt; 3)&lt;br /&gt;
if x_3 &amp;gt; 2 then x_3 = 1 - x_3(-1&amp;lt;=x3&amp;lt;1)&lt;br /&gt;
&lt;br /&gt;
丸め誤差の減少（倍精度を基本とする）&lt;br /&gt;
|x|が大きいと、x_2に桁落ちがおこりやすい。&lt;br /&gt;
そこで、通称三倍精度を用いる。&lt;br /&gt;
	x_2 = x - 2\pi \times n&lt;br /&gt;
特徴：&lt;br /&gt;
	2\pi : 定数&lt;br /&gt;
	n : 整数&lt;br /&gt;
2\pi = p_1 + p_2&lt;br /&gt;
	p_1 = 6.28....|000000（合計52bit）&lt;br /&gt;
	p_2 = 0.000000|......（後ろの...が52bit）&lt;br /&gt;
	x_2 = (x - p_1 \times n) - p_2 \times n&lt;br /&gt;
&lt;br /&gt;
	sin(\frac{\pi}{2}x_3) = x_3P(x_3^2)　P:（近似）多項式&lt;br /&gt;
Pの次数が&lt;br /&gt;
	3: 近似誤差は7*10^{-7}&lt;br /&gt;
	4: 4*10^{-9}&lt;br /&gt;
	5: 1.7*10^{-11}&lt;br /&gt;
&lt;br /&gt;
基本区間の幅 vs 多項式の次数&lt;br /&gt;
　　大　　　　　　　　大&lt;br /&gt;
　　小　　　　　　　　小&lt;br /&gt;
そこで、sin,cosの基本区間を-\frac{\pi}{4}から-\frac{\pi}{4}とすると、&lt;br /&gt;
sin,cosのどちらかを使えば値が計算でき、幅が小さくなったので次数が小さくなる。&lt;br /&gt;
&lt;br /&gt;
exp:&lt;br /&gt;
	e^x = 2^y&lt;br /&gt;
	y = xlog_2e&lt;br /&gt;
	y = y_1 + y_2 (y_1:整数、0&amp;lt;=y_2&amp;lt;1)&lt;br /&gt;
&lt;br /&gt;
y_1 = └y┘&lt;br /&gt;
y_2 = y - y_1（このとき、三倍精度の技が使える）&lt;br /&gt;
&lt;br /&gt;
2^{y_1+y_2} = 2^{y_1}2^{y_2}&lt;br /&gt;
2^{y_2} = P(y_2-\frac{1}{2})&lt;br /&gt;
Pへの引数は[-1/2,1,2) = 1.f&lt;br /&gt;
Pの次数が&lt;br /&gt;
	3: 最大誤差1.1*10^{-4}&lt;br /&gt;
	4: 3.7*10^{-6}&lt;br /&gt;
	5: 1.1*10^{-7}&lt;br /&gt;
	6: 2.6*10^{-7}&lt;br /&gt;
&lt;br /&gt;
2^{y_1}を指数部、fを仮数部とすればよい。&lt;br /&gt;
&lt;br /&gt;
log x&lt;br /&gt;
	x = 1.f * 2^{e-hoge}&lt;br /&gt;
	x_1 = e - hoge&lt;br /&gt;
	x_2 = 1.f (1 &amp;lt;= x_2 &amp;lt; 2)&lt;br /&gt;
log x = log 2 * x_1 + log x_2&lt;br /&gt;
log x_2 = P(x_2)&lt;br /&gt;
Pの次数が&lt;br /&gt;
	6: 10^{-6}&lt;br /&gt;
	9: 10^{-9}&lt;/div&gt;</summary>
		<author><name>Maintenance script</name></author>	</entry>

	</feed>