In article <87le3os98j.fsf@nightsong.com>,   
   Paul Rubin wrote:   
   >minforth@gmx.net (minforth) writes:   
   >> I probably would have used double numbers to avoid type   
   >> conversions, and because not all Forth systems have floats.   
   >   
   >They also don't all have 32-bit cells :P. Doubles are also a big   
   >nuisance to use.   
   >   
   >I think a proper solution to this problem involves memoization or maybe   
   >some mathematical trick that I haven't figured out. One of the   
   >constraints of the Euler problems was to use less than 1 minute of   
   >computer time, but the project started in 2001, which means computers   
   >100x(?) slower than modern ones. So a good solution on a modern machine   
   >should take less than 1 second, and plain brute force is considerably   
   >slower.   
      
   It is trivial to use memoization (of sorts) and it speeds up   
   a factor 10. I'm not inclined to discuss euler problems further.   
      
   Groetjes Albert   
   --   
   Don't praise the day before the evening. One swallow doesn't make spring.   
   You must not say "hey" before you have crossed the bridge. Don't sell the   
   hide of the bear until you shot it. Better one bird in the hand than ten in   
   the air. First gain is a cat purring. - the Wise from Antrim -   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|