Re: TI-M: Re: TI-Math Digest V1 #22


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

Re: TI-M: Re: TI-Math Digest V1 #22




> Well, you wouldn't really need to divide the probable primes by anything,
> just trial-dividing the number by the probable primes.  485
trial-divisions
> takes maybe 2 or 3 seconds on the Z80 with assembly integer functions
(less
> with faster routines); much faster with an m68k, I'm sure.

Well, if you say it's that fast, I suppose that it would be best to wheeler
all the way - use a modified version of the division algorithm to mod 30?

> Well what I'm saying is instead of first taking the modulus 2310 and then
> searching for the value in the congruency list, why not just trial-divide
by
> 2, 3, 5, 7, and 11?  You'd have to do that anyway at some point if you
were
> to use wheeler factorization at all.  If the value of the number modulus
2310
> isn't found in the congruency list, that just tells you that the number is
> divisible by 2, 3, 5, 7, and/or 11...

Bah, I suppose you're right.  See above =)

> I have some speed comparisons on that handy, as a matter of fact ;)
Here's a
> few examples:

Let me try it on my 89 HW2, too - last data I checked said the 89 was faster
for most anything that's just brute force work, like trial division, yet
loses on BCD and some of the complex stuff.

> 38 200 901 201 = 89 * 11 551 * 37 159
>   89 took 4.00 (seconds)
>   49G took 2.07 (seconds)

89 HW2 (AMS 2.03) took 2.72 seconds

> 341 550 071 728 321 = 10 670 053 * 32 010 157
>   89 took 110.00
>   49G took 43.38

80.80

> 2 781 632 830 326 137 = 2 781 637 * 999 998 501
>   89 took 41.00
>   49G took 72.45

29.60 (wow)

> 2^127 - 1 = 2^127 - 1
>   89 took 50.00
>   49G took 54.73

41.06 (it should be noted that the 89 returns the full length here)

> 2^128 - 1 = 3 * 5 * 7 * 257 * 641 * 65537 * 274 177 * 6 700 417 * 67 280
421
> 310 721
>   89 took 220.00
>   49G took 146.66

159.76 (nice improvement)

So what accounts for these non-linear differences?  Another algorithm
involved somewhere?  Different size congruency tables in wheeler?

> I can't exactly cite where I got this information, because the document I
> have here doesn't give any...credits...  However, it is an interesting
> comparison in speeds and capabilities between the TI-89 and the HP-49G in
a
> wide variety of calculations.  If you (or anyone else) is interested, I
can
> attach it to an email, or find where I originally picked up the document
> (it's in pdf format, by the way).

If there's anything else interesting in there - speed differenced for other
operations, maybe? - can you send it to me off the list?

> It does mention in the document that HP may, in a later ROM version,
switch
> from BCD to binary/hex integer representation.  Apparently, the 49G is
> literally based off of CAS software written by a third-party for the HP-48
> series, and that software uses hex integers for stuff like this, so we'll
> see...

Yeah, you don't know the story of why HP is such a cool company???  The main
reason boils down to this one neat little story:

The HP48, as you may know, is, by default, just a simple graphing calculator
like the z80 calcs.  But it has some very, very powerful mid-level scripting
languages that are high level, but extremely fast.  So people were actually
able to write their own symbolic CAS's for the 48, which brings it up to
almost the equivalent level of the 89.  They're actually pretty amazing.
And since HP releases the full specs and documents every single ROM entry
point, people are able to replace all of HP's interface - matrix editors,
text editors, menus, fonts, etc - with their own.

So when the time came for HP to design their next calc, they didn't hire a
bunch of engineers and mathematicians who may or may not be the best at
their jobs - they hired these hoby coders!  Yup, they paid all these guys,
moved them down to Australia, and set them up to write the HP49 ROM.  At
first, I thought it was the most absurd thing I've ever heard, but these
guys wrote a great calculator what with the hardware limitations they face.
I commend them =)

> Hmmm...that's interesting...

TI doesn't give a damn about anything other than money, and we all know that
=)

    -Scott




References: