<?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"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Fast exponentiation</title>
	<atom:link href="http://www.johndcook.com/blog/2008/12/10/fast-exponentiation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.johndcook.com/blog/2008/12/10/fast-exponentiation/</link>
	<description>The blog of John D. Cook</description>
	<lastBuildDate>Thu, 18 Mar 2010 18:59:21 -0400</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Nemo</title>
		<link>http://www.johndcook.com/blog/2008/12/10/fast-exponentiation/comment-page-1/#comment-32446</link>
		<dc:creator>Nemo</dc:creator>
		<pubDate>Sat, 06 Feb 2010 17:42:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=1070#comment-32446</guid>
		<description>@Jaime --

If it is an integer matrix, diagonalization might not be the best idea.

For example, the powers of the following matrix generate the Fibonacci numbers:

(1 1)
(1 0)

Using the &quot;repeated squaring&quot; technique, this matrix lets you compute the Nth Fibonacci number in logarithmic time using only integer arithmetic.

If you diagonalize this matrix, you will find the golden ratio and its reciprocal along the diagonal. Since those are irrational, they are not precisely representable on your computer.  (Well, not with the usual floating-point representations, anyway...)  That will lead to rounding errors when you exponentiate.</description>
		<content:encoded><![CDATA[<p>@Jaime &#8211;</p>
<p>If it is an integer matrix, diagonalization might not be the best idea.</p>
<p>For example, the powers of the following matrix generate the Fibonacci numbers:</p>
<p>(1 1)<br />
(1 0)</p>
<p>Using the &#8220;repeated squaring&#8221; technique, this matrix lets you compute the Nth Fibonacci number in logarithmic time using only integer arithmetic.</p>
<p>If you diagonalize this matrix, you will find the golden ratio and its reciprocal along the diagonal. Since those are irrational, they are not precisely representable on your computer.  (Well, not with the usual floating-point representations, anyway&#8230;)  That will lead to rounding errors when you exponentiate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Modular Exponentiation &#171; Numerical Recipes</title>
		<link>http://www.johndcook.com/blog/2008/12/10/fast-exponentiation/comment-page-1/#comment-17710</link>
		<dc:creator>Modular Exponentiation &#171; Numerical Recipes</dc:creator>
		<pubDate>Tue, 19 May 2009 21:45:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=1070#comment-17710</guid>
		<description>[...] introduce the really cool algorithm that this whole post really is about, binary exponentiation. In John D. Cook&#8217;s blog there is a great explanation on how it could be implemented iteratively, based on the binary [...]</description>
		<content:encoded><![CDATA[<p>[...] introduce the really cool algorithm that this whole post really is about, binary exponentiation. In John D. Cook&#8217;s blog there is a great explanation on how it could be implemented iteratively, based on the binary [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jaime</title>
		<link>http://www.johndcook.com/blog/2008/12/10/fast-exponentiation/comment-page-1/#comment-14657</link>
		<dc:creator>Jaime</dc:creator>
		<pubDate>Tue, 17 Mar 2009 23:58:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=1070#comment-14657</guid>
		<description>Hmmmm... I had always thought that the standard procedure to calculate arbitrary power of a matrix was&gt;a href=&quot;http://mathworld.wolfram.com/MatrixDiagonalization.html&quot; title=&quot;diagonalization&quot;&gt;. That is, if you can write [A] as [B^-1][D][B], then [A^n] reduces to [B^-1][D^n][B], since all other [B^-1]s and [B]s cancel out. But of course diagonalizing a large matrix is equivalent to finding all roots of a very large polynomial... For very large exponents diagonalization has to be better, but do you have any hint of at what point both approaches break even?

By the way, you&#039;ve got a great blog, John...</description>
		<content:encoded><![CDATA[<p>Hmmmm&#8230; I had always thought that the standard procedure to calculate arbitrary power of a matrix was&gt;a href=&#8221;http://mathworld.wolfram.com/MatrixDiagonalization.html&#8221; title=&#8221;diagonalization&#8221;&gt;. That is, if you can write [A] as [B^-1][D][B], then [A^n] reduces to [B^-1][D^n][B], since all other [B^-1]s and [B]s cancel out. But of course diagonalizing a large matrix is equivalent to finding all roots of a very large polynomial&#8230; For very large exponents diagonalization has to be better, but do you have any hint of at what point both approaches break even?</p>
<p>By the way, you&#8217;ve got a great blog, John&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gene</title>
		<link>http://www.johndcook.com/blog/2008/12/10/fast-exponentiation/comment-page-1/#comment-10757</link>
		<dc:creator>Gene</dc:creator>
		<pubDate>Thu, 11 Dec 2008 05:21:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.johndcook.com/blog/?p=1070#comment-10757</guid>
		<description>I ran across this package (Pari/GP) which has very large integer capabilities. You&#039;ve probably heard of it or used it, but I found it fascinating. It seems to be well maintained. I used it for testing some encryption algorithms some time ago. I know it&#039;s a little off topic, but some might find it interesting.

http://pari.math.u-bordeaux.fr/

I also want to point out that the newest &quot;math coprocessor&quot; architectures built into dual core Intel CPU&#039;s use some fascinating optimizations for large integer arithmetic, similar to what you describe in your post.</description>
		<content:encoded><![CDATA[<p>I ran across this package (Pari/GP) which has very large integer capabilities. You&#8217;ve probably heard of it or used it, but I found it fascinating. It seems to be well maintained. I used it for testing some encryption algorithms some time ago. I know it&#8217;s a little off topic, but some might find it interesting.</p>
<p><a href="http://pari.math.u-bordeaux.fr/" rel="nofollow">http://pari.math.u-bordeaux.fr/</a></p>
<p>I also want to point out that the newest &#8220;math coprocessor&#8221; architectures built into dual core Intel CPU&#8217;s use some fascinating optimizations for large integer arithmetic, similar to what you describe in your post.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
