in reply to code optimization
I was actually looking at this paper which describes in the first 3-4 pages how to compare continued fractions and I was wondering if converting your fractions to continued fractions and then carrying out a continued fractions comparison algorithm(which Flajolet describes in the first link in this post) would lead to faster running times.
Except.. it's pretty hard to compete with the cost of a division(which is rather low).
In any case, if Perl doesn't cut it as far as execution time, I would go for XS, or a pure C version.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: code optimization
by BrowserUk (Patriarch) on Nov 04, 2011 at 12:04 UTC | |
by spx2 (Deacon) on Nov 04, 2011 at 12:53 UTC | |
by BrowserUk (Patriarch) on Nov 04, 2011 at 13:15 UTC | |
by spx2 (Deacon) on Nov 04, 2011 at 14:08 UTC | |
by BrowserUk (Patriarch) on Nov 04, 2011 at 14:31 UTC | |
|
In Section
Seekers of Perl Wisdom