<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>DOSEI</author_name>
  <author_url>https://blog.hatena.ne.jp/DOSEI/</author_url>
  <blog_title>DOSEIの日記</blog_title>
  <blog_url>https://dosei.hatenadiary.jp/</blog_url>
  <categories>
    <anon>メモ</anon>
    <anon>プログラミング</anon>
    <anon>C</anon>
    <anon>C++</anon>
  </categories>
  <description>反復計算などで、前回の値を利用して、新しい値を逐次的に計算するプログラムについて。 例として、平方根の計算を考えると、 を、 x_0=1 の初期値 (なんでもいいけど) から順に計算していけばいい。プログラムでは、途中の値を残す必要はないので、順次上書きしていくことにする。で、若かりしころは以下のように書いていた。 double x = 1; while(1) { double x_new = (x + a/x)/2.0; if(is_converge(x_new, x)) break; // 前回の値と比べて、収束を判定 x = x_new; // 更新 } // output x as r…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fdosei.hatenadiary.jp%2Fentry%2F20120209%2Fp1&quot; title=&quot; 逐次更新ループの書き方 - DOSEIの日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2012-02-09 00:00:00</published>
  <title> 逐次更新ループの書き方</title>
  <type>rich</type>
  <url>https://dosei.hatenadiary.jp/entry/20120209/p1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
