<?xml version="1.0" encoding="utf-8"?>
<feed version="0.3" xmlns="http://purl.org/atom/ns#">
<link rel="alternate" type="text/html" href="https://emergent.unpythonic.net/"/>

<title>Jeff Epler's blog</title>
<modified>2012-03-07T15:42:39Z</modified>
<tagline>Photos, electronics, cnc, and more</tagline>
<author><name>Jeff Epler</name><email>jepler@unpythonic.net</email></author>
<entry>
<title>Cancellation error</title>
<issued>2012-03-07T15:42:39Z</issued>
<modified>2012-03-07T15:42:39Z</modified>
<id>https://emergent.unpythonic.net/01331134959</id>
<link rel="alternate" type="text/html" href="https://emergent.unpythonic.net/01331134959"/>
<content type="text/html" mode="escaped">
I was recently reminded of the importance of choosing numeric algorithms that
don't behave catastrophically for certain inputs.  One example is the
calculation of 1-cos(θ) for small θ.  In this case, cos(θ) is very close to 1,
leading to a &lt;a href=&quot;http://en.wikipedia.org/wiki/Loss_of_significance&quot;&gt;large
cancellation error&lt;/a&gt; in the subtraction step.

&lt;p&gt;&lt;img src=&quot;https://media.unpythonic.net/emergent-files/01331134959/cancelerr.png&quot;&gt;</content>
</entry>
</feed>
