<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>inamori</author_name>
  <author_url>https://blog.hatena.ne.jp/inamori/</author_url>
  <blog_title>inamori’s diary</blog_title>
  <blog_url>https://inamori.hateblo.jp/</blog_url>
  <categories>
    <anon>プログラミング</anon>
    <anon>Python</anon>
  </categories>
  <description>前回までは、数学的な補足をして、それをPythonで実装したが、従来の書き方、Cとなんら変わらない書き方になっている。なぜ関数プログラミングは重要かは、関数型なら徹底的に部品化ができて、数値微分をその例に出している。これをPythonで書けるかどうか試してみたい。 まず、 [ h, h/2, h/4, ... ]という無限列を作る。無限列を作るにはジェネレータを使う。 def gen_half(x): yield x while True: x /= 2 yield xさらに、1/2にする演算を関数にすると、次のようになる。 def Repeat(f, a): yield a while Tr…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Finamori.hateblo.jp%2Fentry%2F20090328%2Fp1&quot; title=&quot;数値微分（3） - inamori’s diary&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>2009-03-28 00:00:00</published>
  <title>数値微分（3）</title>
  <type>rich</type>
  <url>https://inamori.hateblo.jp/entry/20090328/p1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
