On Mon, May 9, 2011 at 11:19 PM, Robby Findler
<ro...@eecs.northwestern.edu> wrote:
> Even without typed racket, this:
>
> (define (my-sqrt y)
>  (let loop [(x (/ y 2.0))]

> is much faster than this:
>
> (define (my-sqrt y)
>  (let loop [(x (/ y 2))]

Yes, this is one of the optimizations TR does.  :)

As to why TR is so much faster on this program: this is exactly the
sort of program that TR excels at -- generic arithmetic on floats,
which we can turn into fast machine instructions.  You won't find a
better case for TR than this, except if you add complex numbers.
-- 
sam th
sa...@ccs.neu.edu

_________________________________________________
  For list-related administrative tasks:
  http://lists.racket-lang.org/listinfo/users

Reply via email to