Author Topic: [TI-Planet Contest] Heat up your calc with arithmetic !  (Read 21076 times)

0 Members and 1 Guest are viewing this topic.

Offline compu

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 275
  • Rating: +63/-3
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #30 on: April 07, 2013, 04:44:12 pm »
The last row is the latest version of the program. The columns show the time in seconds to calculate the n-th (22, 150, 50, 250) palindromic prime on a classic CAS OS or the student software.

Offline sammyMaX

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 204
  • Rating: +9/-0
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #31 on: April 07, 2013, 06:53:17 pm »
Ah, I see. The computer software is not an exact emulator then, and it runs faster?

I made my program in the Nspire emulator. Is there any way to extract the TNS file from the emulator? Right now, there is only a saved flash image.

Are you wondering who Sammy is? My avatar is Sammy.
   

Offline Dapianokid

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 539
  • Rating: +46/-27
  • That one dude
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #32 on: April 07, 2013, 08:39:03 pm »
Dapianokid said his took 11 seconds to compute the 42nd prime palindrome, but from the conversation, he may have a much more efficient algorithm for larger values. I think his was also running at 150MHz, so I am not sure.

Has anybody set any benchmarks for other languages?

I was running at 264MHz. Also, mine exponentially gets slower with bigger numbers,
so I'm rewriting it to be roughly the same for all possible Nspire values.
Keep trying.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #33 on: April 09, 2013, 02:07:47 pm »
I refined my algorithm for prime testing. Now my current speeds are:
42nd palprime : 22 seconds, 18181
100th palprime : 84 seconds, 94049
290th palprime : 552 seconds, 1958591

Yesterday, my record for the 290th was something like 682 seconds, so it improved by 130 seconds o_o My new algorithm will prove exponentially faster (I believe) for larger values.
EDIT: Again, TI-BASIC, z80 on a TI-84+

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #34 on: April 09, 2013, 04:01:34 pm »
Are we allowed to use 15mhz in axe/asm ? :devil:
Also 32 bit math in ASM isn't very hard so we can get pretty large values (the biggest 32 bit palindrome is 4 294 994 924). Means that BASIC will be slower but in ASM we get numbers a bit smaller.
I'm trying my hand at axe right now to see how feasible it is. Then I'll introduce some ASM for 32 bit stuff. ;D I'm not Runer though. :P

And since ASM will be so fast that we can't stopwatch it, I believe that cycles will be counted ?
« Last Edit: April 09, 2013, 04:13:56 pm by Streetwalker »

Offline Dapianokid

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 539
  • Rating: +46/-27
  • That one dude
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #35 on: April 09, 2013, 06:07:21 pm »
Streetwalker, I do'nt believe it will be that fast when you test out much larger numbers like 1777771.
I refined mine and the size does not matter, and I invented a new algorithm for primality!
Average time: .028 seconds per digit.
Keep trying.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #36 on: April 09, 2013, 06:10:18 pm »
I did a rough estimate and I think that z80 assembly with 32-bit stuff ought to go through 300 palindromes per second at 6MHz.

Also, I wonder what your method is? >:D

Offline DrDnar

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 546
  • Rating: +97/-1
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #37 on: April 09, 2013, 09:23:40 pm »
I prefer to heat up my calculator with overclocking.
"No tools will make a man a skilled workman, or master of defense, nor be of any use to him who has not learned how to handle them, and has never bestowed any attention upon them. . . . Yes, [] the tools which would teach men their own use would be beyond price."—Plato's The Republic, circa 380 BC

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #38 on: April 10, 2013, 02:16:21 am »
Lol I'm currently using the exact same algorithm as in BASIC and now it takes 4.5 secs to find the 1000th prime (15mhz Axe). :P

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #39 on: April 10, 2013, 03:21:05 am »
Dammit, I hate it to hear you guys just throwing those tiny numbers at my face, while I'm just sitting here, wondering how to even start :)
Good luck, seems like there'll be a lot of competition around here...

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #40 on: April 10, 2013, 03:41:22 am »
Lol I'm currently using the exact same algorithm as in BASIC and now it takes 4.5 secs to find the 1000th prime (15mhz Axe). :P
But palindromic too ? :P
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #41 on: April 10, 2013, 04:28:00 am »
Nope just regular old boring primes. Result is 7919. I'm thinking of a good way to make palindromes. Are binary ones allowed ? :P

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #42 on: April 10, 2013, 05:14:22 am »
Although I don't see mention of it, the first post list all its examples in decimal. Judging by that, I'd say that they want the output in decimal format.

Offline Xeda112358

  • they/them
  • Moderator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #43 on: April 10, 2013, 06:16:57 am »
So, my calculation of "300 per second" was off by quite a bit. I forgot to calculate in non-primes and the wasted cycles there :P I only get about 30 primes per second, but my algorithm could be better refined XD

(And this is at 6MHz)

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [TI-Planet Contest] Heat up your calc with arithmetic !
« Reply #44 on: April 10, 2013, 06:58:24 am »
Although I don't see mention of it, the first post list all its examples in decimal. Judging by that, I'd say that they want the output in decimal format.
I understand this, what I was asking was if we were allowed to use numbers that are palindromes in binary but that was just a joke. :P