<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: SICP section 1.3.1</title>
	<atom:link href="http://eli.thegreenplace.net/2007/07/11/sicp-section-131/feed/" rel="self" type="application/rss+xml" />
	<link>http://eli.thegreenplace.net/2007/07/11/sicp-section-131/</link>
	<description>Eli Bendersky's personal website</description>
	<pubDate>Thu, 04 Dec 2008 02:51:04 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.2</generator>
		<item>
		<title>By: gorilych</title>
		<link>http://eli.thegreenplace.net/2007/07/11/sicp-section-131/#comment-132647</link>
		<dc:creator>gorilych</dc:creator>
		<pubDate>Sat, 27 Sep 2008 12:14:27 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2007/07/11/sicp-section-131/#comment-132647</guid>
		<description>On your comments to Simpson method: "the approximation provided by Simpson’s Rule is better – the results converges better with the same amount of iterations."

Well. Simpson method gives exact result while integrating cubic polynomials which of course does not depends on n. Try, for example:

(simpson-integral #'cube 0 1 2))

It will give you 0.25 - exact answer.

(simpson-integral #'cube 0 1 100) returns inexact answer because of inexactness of 'float' computations - cube function is calculated with limited precision.</description>
		<content:encoded><![CDATA[<p>On your comments to Simpson method: &#8220;the approximation provided by Simpson’s Rule is better – the results converges better with the same amount of iterations.&#8221;</p>
<p>Well. Simpson method gives exact result while integrating cubic polynomials which of course does not depends on n. Try, for example:</p>
<p>(simpson-integral #&#8217;cube 0 1 2))</p>
<p>It will give you 0.25 - exact answer.</p>
<p>(simpson-integral #&#8217;cube 0 1 100) returns inexact answer because of inexactness of &#8216;float&#8217; computations - cube function is calculated with limited precision.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rinat</title>
		<link>http://eli.thegreenplace.net/2007/07/11/sicp-section-131/#comment-72771</link>
		<dc:creator>rinat</dc:creator>
		<pubDate>Thu, 20 Sep 2007 09:13:03 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2007/07/11/sicp-section-131/#comment-72771</guid>
		<description>Implementation 1.31 in Scheme
(define (product f a next b)
  (cond ((&#62; a b) 1)
        (else (* (f a)
                 (product f (next a) next b)))))

(define (wallis-f n)
  (/ (* (* n 2) 
        (* (+ n 1) 2))
     (square (+ 1 (* 2 n)))))

(define (square x)
  (* x x))

(define (next x)
  (+ x 1))

(define (w-pi n)
  (product wallis-f 1.0 next n))</description>
		<content:encoded><![CDATA[<p>Implementation 1.31 in Scheme<br />
(define (product f a next b)<br />
  (cond ((&gt; a b) 1)<br />
        (else (* (f a)<br />
                 (product f (next a) next b)))))</p>
<p>(define (wallis-f n)<br />
  (/ (* (* n 2)<br />
        (* (+ n 1) 2))<br />
     (square (+ 1 (* 2 n)))))</p>
<p>(define (square x)<br />
  (* x x))</p>
<p>(define (next x)<br />
  (+ x 1))</p>
<p>(define (w-pi n)<br />
  (product wallis-f 1.0 next n))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lieven</title>
		<link>http://eli.thegreenplace.net/2007/07/11/sicp-section-131/#comment-59825</link>
		<dc:creator>Lieven</dc:creator>
		<pubDate>Thu, 12 Jul 2007 17:34:45 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2007/07/11/sicp-section-131/#comment-59825</guid>
		<description>DEFUN isn't lexically scoped. Regardless of the position it is in, it defines the function in the global environment.</description>
		<content:encoded><![CDATA[<p>DEFUN isn&#8217;t lexically scoped. Regardless of the position it is in, it defines the function in the global environment.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gargoyle</title>
		<link>http://eli.thegreenplace.net/2007/07/11/sicp-section-131/#comment-59776</link>
		<dc:creator>Gargoyle</dc:creator>
		<pubDate>Thu, 12 Jul 2007 06:29:42 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2007/07/11/sicp-section-131/#comment-59776</guid>
		<description>What *do* these defuns do in CL ?</description>
		<content:encoded><![CDATA[<p>What *do* these defuns do in CL ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lieven</title>
		<link>http://eli.thegreenplace.net/2007/07/11/sicp-section-131/#comment-59775</link>
		<dc:creator>Lieven</dc:creator>
		<pubDate>Thu, 12 Jul 2007 06:22:07 +0000</pubDate>
		<guid isPermaLink="false">http://eli.thegreenplace.net/2007/07/11/sicp-section-131/#comment-59775</guid>
		<description>Your nested defuns are a scheme-ism that doesn't do what you think in CL. Use FLET or LABELS.</description>
		<content:encoded><![CDATA[<p>Your nested defuns are a scheme-ism that doesn&#8217;t do what you think in CL. Use FLET or LABELS.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
