<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-11295132.post5475755539849835914..comments</id><updated>2011-12-12T21:49:58.656-08:00</updated><category term='category theory'/><category term='lawvere theories'/><category term='astronomy'/><category term='optimisation'/><category term='self-reference'/><category term='comonads'/><category term='haskell'/><category term='programming'/><category term='monad'/><category term='mathematics'/><category term='physics'/><category term='probability'/><category term='types'/><category term='quantum'/><title type='text'>Comments on A Neighborhood of Infinity: Fast forwarding lrand48()</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.sigfpe.com/feeds/5475755539849835914/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/5475755539849835914/comments/default'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2011/05/fast-forwarding-lrand48.html'/><author><name>sigfpe</name><uri>http://www.blogger.com/profile/08096190433222340957</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://homepage.mac.com/sigfpe/.Pictures/Photo%20Album%20Pictures/2002-12-07%2014.53.40%20-0800/ImageDSC01397_1.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-11295132.post-5413886931832472764</id><published>2011-12-12T21:44:37.300-08:00</published><updated>2011-12-12T21:44:37.300-08:00</updated><title type='text'>good</title><content type='html'>good</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/5475755539849835914/comments/default/5413886931832472764'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/5475755539849835914/comments/default/5413886931832472764'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2011/05/fast-forwarding-lrand48.html?showComment=1323755077300#c5413886931832472764' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2011/05/fast-forwarding-lrand48.html' ref='tag:blogger.com,1999:blog-11295132.post-5475755539849835914' source='http://www.blogger.com/feeds/11295132/posts/default/5475755539849835914' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-923135257'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-7862786852768244458</id><published>2011-06-03T07:30:27.720-07:00</published><updated>2011-06-03T07:30:27.720-07:00</updated><title type='text'>Alexey, I assume you are my Alexey :-)

I can&amp;#39;...</title><content type='html'>Alexey, I assume you are my Alexey :-)&lt;br /&gt;&lt;br /&gt;I can&amp;#39;t believe I re-implemented binary exponentiation for my Collatz monoid when I could have just used this trick! &lt;br /&gt;&lt;br /&gt;Of course if the preludes class hierarchy made more sense it&amp;#39;d probably have been more obvious....</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/5475755539849835914/comments/default/7862786852768244458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/5475755539849835914/comments/default/7862786852768244458'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2011/05/fast-forwarding-lrand48.html?showComment=1307111427720#c7862786852768244458' title=''/><author><name>Jordan</name><uri>http://withrespect2x.posterous.com</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2011/05/fast-forwarding-lrand48.html' ref='tag:blogger.com,1999:blog-11295132.post-5475755539849835914' source='http://www.blogger.com/feeds/11295132/posts/default/5475755539849835914' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1159374027'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-3938075956422605276</id><published>2011-05-30T09:44:33.700-07:00</published><updated>2011-05-30T09:44:33.700-07:00</updated><title type='text'>@Alexey,

At the very least you can generalise you...</title><content type='html'>@Alexey,&lt;br /&gt;&lt;br /&gt;At the very least you can generalise your type signature. If you do that then you can reuse the code to do other stuff fast. For example, you can use the ideas here http://goo.gl/AjHPM to perform very fast regexp matches against strings that are very long repeating patterns.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/5475755539849835914/comments/default/3938075956422605276'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/5475755539849835914/comments/default/3938075956422605276'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2011/05/fast-forwarding-lrand48.html?showComment=1306773873700#c3938075956422605276' title=''/><author><name>sigfpe</name><uri>http://www.blogger.com/profile/08096190433222340957</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://homepage.mac.com/sigfpe/.Pictures/Photo%20Album%20Pictures/2002-12-07%2014.53.40%20-0800/ImageDSC01397_1.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2011/05/fast-forwarding-lrand48.html' ref='tag:blogger.com,1999:blog-11295132.post-5475755539849835914' source='http://www.blogger.com/feeds/11295132/posts/default/5475755539849835914' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-961546855'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-2870973103898887716</id><published>2011-05-30T08:04:56.543-07:00</published><updated>2011-05-30T08:04:56.543-07:00</updated><title type='text'>Fun fun!

pow :: Integral a =&amp;gt; Affine -&amp;gt; a -...</title><content type='html'>Fun fun!&lt;br /&gt;&lt;br /&gt;pow :: Integral a =&amp;gt; Affine -&amp;gt; a -&amp;gt; Affine&lt;br /&gt;x0 `pow` y0&lt;br /&gt;    | y0 &amp;lt; 0    = error &amp;quot;Negative exponent&amp;quot;&lt;br /&gt;    | y0 == 0   = 1&lt;br /&gt;    | otherwise = f x0 y0&lt;br /&gt;    where&lt;br /&gt;        -- f : x0 ^ y0 = x ^ y&lt;br /&gt;        f x y&lt;br /&gt;            | even y    = f (x `mappend` x) (y `quot` 2)&lt;br /&gt;            | y == 1    = x&lt;br /&gt;            | otherwise = g (x `mappend` x) ((y - 1) `quot` 2) x&lt;br /&gt;        -- g : x0 ^ y0   = (x ^ y) `mappend` z&lt;br /&gt;        g x y z&lt;br /&gt;            | even y    = g (x `mappend` x) (y `quot` 2) z&lt;br /&gt;            | y == 1    = x `mappend` z&lt;br /&gt;            | otherwise = g (x `mappend` x) ((y - 1) `quot` 2) (x `mappend` z)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(Haven&amp;#39;t compiled it.)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/5475755539849835914/comments/default/2870973103898887716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/5475755539849835914/comments/default/2870973103898887716'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2011/05/fast-forwarding-lrand48.html?showComment=1306767896543#c2870973103898887716' title=''/><author><name>Alexey</name><uri>http://www.blogger.com/profile/10232609099336072702</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2011/05/fast-forwarding-lrand48.html' ref='tag:blogger.com,1999:blog-11295132.post-5475755539849835914' source='http://www.blogger.com/feeds/11295132/posts/default/5475755539849835914' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-896435846'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-559492911862268304</id><published>2011-05-30T07:07:26.156-07:00</published><updated>2011-05-30T07:07:26.156-07:00</updated><title type='text'>@Alexey,

Yes. The correct way to implement this w...</title><content type='html'>@Alexey,&lt;br /&gt;&lt;br /&gt;Yes. The correct way to implement this would be through Monoid but I think Data.Monoid lacks the binary power algorithm. Maybe it appears in another library.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/5475755539849835914/comments/default/559492911862268304'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/5475755539849835914/comments/default/559492911862268304'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2011/05/fast-forwarding-lrand48.html?showComment=1306764446156#c559492911862268304' title=''/><author><name>sigfpe</name><uri>http://www.blogger.com/profile/08096190433222340957</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://homepage.mac.com/sigfpe/.Pictures/Photo%20Album%20Pictures/2002-12-07%2014.53.40%20-0800/ImageDSC01397_1.jpg'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2011/05/fast-forwarding-lrand48.html' ref='tag:blogger.com,1999:blog-11295132.post-5475755539849835914' source='http://www.blogger.com/feeds/11295132/posts/default/5475755539849835914' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-961546855'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-9009671047814084743</id><published>2011-05-30T03:21:24.364-07:00</published><updated>2011-05-30T03:21:24.364-07:00</updated><title type='text'>For number 3:

When Affine is an instance of Num w...</title><content type='html'>For number 3:&lt;br /&gt;&lt;br /&gt;When Affine is an instance of Num we are able to use the efficient implementation of (^), which does better than repeatedly multiplying through.&lt;br /&gt;&lt;br /&gt;http://hackage.haskell.org/packages/archive/base/latest/doc/html/src/GHC-Real.html#%5E&lt;br /&gt;&lt;br /&gt;It take advantage of the fact that x^2y = (x*x)^y and x^(2y+1) = x(x*x)^y.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/5475755539849835914/comments/default/9009671047814084743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/5475755539849835914/comments/default/9009671047814084743'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2011/05/fast-forwarding-lrand48.html?showComment=1306750884364#c9009671047814084743' title=''/><author><name>Alexey</name><uri>http://www.blogger.com/profile/10232609099336072702</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2011/05/fast-forwarding-lrand48.html' ref='tag:blogger.com,1999:blog-11295132.post-5475755539849835914' source='http://www.blogger.com/feeds/11295132/posts/default/5475755539849835914' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-896435846'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-3627289155953780289</id><published>2011-05-30T03:17:31.560-07:00</published><updated>2011-05-30T03:17:31.560-07:00</updated><title type='text'>For number 3:

By having Affine be an instance of ...</title><content type='html'>For number 3:&lt;br /&gt;&lt;br /&gt;By having Affine be an instance of Num, we can use the efficient implementation of (^), which does better than repeated multiplication.&lt;br /&gt;&lt;br /&gt;http://hackage.haskell.org/packages/archive/base/latest/doc/html/src/GHC-Real.html#%5E&lt;br /&gt;&lt;br /&gt;It takes advantage of the fact that x^2y = (x*x)^y and x^(2y+1) = x(x*x)^y.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/5475755539849835914/comments/default/3627289155953780289'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/5475755539849835914/comments/default/3627289155953780289'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2011/05/fast-forwarding-lrand48.html?showComment=1306750651560#c3627289155953780289' title=''/><author><name>Alexey</name><uri>http://www.blogger.com/profile/10232609099336072702</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2011/05/fast-forwarding-lrand48.html' ref='tag:blogger.com,1999:blog-11295132.post-5475755539849835914' source='http://www.blogger.com/feeds/11295132/posts/default/5475755539849835914' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-896435846'/></entry><entry><id>tag:blogger.com,1999:blog-11295132.post-3987499969839018755</id><published>2011-05-29T07:51:52.517-07:00</published><updated>2011-05-29T07:51:52.517-07:00</updated><title type='text'>I&amp;#39;ve used this trick, in speeding up  lossy au...</title><content type='html'>I&amp;#39;ve used this trick, in speeding up  lossy audio codec. It&amp;#39;s a little strange to find a random number generator in an audio codec, but they&amp;#39;re there for a perfectly good reason - one piece of white noise sounds much like another, so the codec will simply transmit noise-like pieces of the audio as &amp;#39;there is some noise here&amp;#39;. In order to pass the conformance tests, however, you need to generate the same sequence of random numbers.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/5475755539849835914/comments/default/3987499969839018755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/11295132/5475755539849835914/comments/default/3987499969839018755'/><link rel='alternate' type='text/html' href='http://blog.sigfpe.com/2011/05/fast-forwarding-lrand48.html?showComment=1306680712517#c3987499969839018755' title=''/><author><name>ingulf</name><uri>http://ingulf.livejournal.com/</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/openid16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.sigfpe.com/2011/05/fast-forwarding-lrand48.html' ref='tag:blogger.com,1999:blog-11295132.post-5475755539849835914' source='http://www.blogger.com/feeds/11295132/posts/default/5475755539849835914' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1831287644'/></entry></feed>
