Jeff Epler's blog2012-03-07T15:42:39ZPhotos, electronics, cnc, and moreJeff Eplerjepler@unpythonic.netCancellation error2012-03-07T15:42:39Z2012-03-07T15:42:39Zhttps://emergent.unpythonic.net/01331134959
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 <a href="http://en.wikipedia.org/wiki/Loss_of_significance">large
cancellation error</a> in the subtraction step.
<p><img src="https://media.unpythonic.net/emergent-files/01331134959/cancelerr.png">