Re: Which TI should I get?


[Prev][Next][Index][Thread]

Re: Which TI should I get?



<<I tested STL's prime test numbers on three more HP48 number factorers.  The
first, FCTR.LIB, was written in a hybrid of assembly language and System RPL
and takes 3.2k of memory.>>
Um, any assembler is obviously cheating. My PRIME6 is all TI-BASIC.
<< The second, FACTOR, was written in a hybrid of
User RPL and assembly language and takes 2.4k of memory>>
More assembler.
<< The third,
FACTNUMS, was written in User RPL and takes 548 bytes of memory.>>
Ah, good.
<<I included the table from a previous post for comparison and made a second
table showing the results from my tests.  The first two in the first table
are on a TI-85 and the rest are on an HP48.>>
Okey.
<<The FACTOR program uses three steps (which it calls Trial Division,
Primetest, and Pollard) to quickly calculate prime factors, though it's not
as fast as ALG48's FCTR routine (and FCTR can even factor polynomials!).>>
Um, factoring polynomials and factoring integers is a wildly different job. The
Pollard step I should implement in my TI, but ah well.
<<The User RPL program simply uses brute force (though it doesn't check any
factors greater than the square root of the number to test).
That's a common shortcut. PRIME6 of course uses it too. But it uses Wheel
Factorization, not Baby Trial Divide.
<<  The other
assembly language program first tests for primality and then calculates
factors if needed (though I'm unsure of the algorithm).>>
Nasty number theory. AND assembler.
<< [Condensed list:]
PRIME6:        PRIME6B:      FCTR(ASM)  FCTR.LIB(ASM): FACTOR(ASM):
FACTNUMS(URPL)
9876511 (prime)     17 sec         14 sec        0.6 sec   .4  sec  1.4 sec
11.0 sec
369758771 (6661*55511)    36 sec    31 sec   1.1 sec  2.3 sec   2.0 sec
23.6 sec
1000000007 (prime)  2 min 51 sec 2 min 21 sec  0.9 sec  0.6 sec  1.8 sec 1 min
58.0 sec
17439280249 (55511*314159)  5 min 5 sec  4 min 13 sec  1.9 sec    4.7 sec  3.4
sec   3 min 30.6 sec>>
Let me comment on the times found.  You'll notice that of COURSE the ASM
programs are blazingly fast for the factorization. However.... (read on)
<<All HP48 tests were done on an HP48GX with a 3.93 MHz CPU and 57.3k of user
memory free.  Timings were found by Mika Heiskanen's TIM program, which is
the most accurate (to 1/8192 of a second) program timer for the HP48.>>
Wish I had one for my TI. I have my trusty stopwatch.
Anyways, the HP processor runs at 4Mhz. TI processors run at 2, but they're
built for 6. When you divide my PRIME6 times in half (to simulate 4Mhz), you'll
see that they are FASTER than the User RPL program. That's my algorithm and
TI-BASIC swiftness at work. The other programs are ASM.



-*---*-------
S.T.L.  ==> STL137@aol.com <==  My quotes page is at:  http://quote.cjb.net
~~~ My main website is at:  http://137.tsx.org ~~~
If you see a message of mine posted on two newsgroups, then it is because I
have replied to a crossposted message. I *never* crosspost of my own accord!
I block all unapproved E-mail. If you wish to talk to me, post to alt.test.9
with the subject "Moo" and your E-mail address in the body. I will allow you
as soon as I sign on next.
"This universe is not hostile, or yet is it friendly. It is simply
indifferent" - John H. Holmes, The Sensible Man's View of Religion


Follow-Ups: References: