Joe Riel

9630 Reputation

23 Badges

19 years, 244 days

MaplePrimes Activity


These are replies submitted by Joe Riel

Note that there is a Maple Enigma worksheet in the Maple Application Center.
Try running f2 again; you'll find it is slower the second time. The difference is presumably attributable to memory usage. Calling gc between runs didn't appear to eliminate this discrepancy. You might be able to slightly increase the speed of f5 by eliminating its unused argument (n).
A quibble with this implementation is that floor is relatively slow; it is not a builtin function. This would only be an issue in a tight loop, but it is something to think about. You can use frem (a builtin) to accelerate this (I'd post the code, but can't figure out how to post indented code, particularly with a less-than sign). A very similar problem was discussed extensively on the usenet group comp.soft-sys.math.maple in february 2005 (I was a participant). The name of thread is "mod for floats".
First 193 194 195 Page 195 of 195