Here are another couple of practical speed tests for the 15c
Another couple of practical speed tests for the 15c
|
|
« Next Oldest | Next Newest »
|
▼ ▼
Post: #19
10-13-2011, 08:49 PM
I wrote a program to find 4 digits numbers such that A^B * C^D = ABCD I used the same algorithm on several calculators from a 41 up to a 50G and I even plowed into sysRPL for the first time and wrote a sysRPL version of the program. When I got my 15C LE I ported the 41 version of the program over to it and the result is the program on the 15C LE is almost as fast as the sysRPL program on the 50G. Since this was my first try at sysRPL it may not be the most efficient program possible but still this says a lot for the speed of 15C LE. If anyone is interested I can post all the results. I am currently attempting to port the algorithm over to a TI-59 but it is hard going, it has been many years since I programmed a TI and there are subtle differences in the way they handle thing plus of course its not RPN. ▼
Post: #20
10-14-2011, 05:19 AM
Interested. I'm tinkering with sysRPL at the moment, so I'd like a benchmark timing to have something to aim for. ▼
Post: #21
10-14-2011, 11:09 PM
My program is basically 4 nested loops, one loop for each digit in the number, with the thousands being the outer loop and units the inner loop. It is not completely brute force it eliminates any values wher the x^y would be greater than the value tested, this test is not perfect and does eliminate number that are potential candidates, however it does come up with the right answer, it also eliminate any 0^x values even though some schools of thought say 0^0 =1 but it was easier to ignore this. Even though I know there is only one number that fits the A^B*C^D=ABCD I go through all numbers from 0 to 9999 with the exception noted above.
The results in ascending time order are as follows:
Things I learned from this exercise:
▼
Post: #22
10-15-2011, 04:12 AM
This would be a nice exercise on WP 34S in integer mode. I'd assume this will be the fastest. In real mode, the 34S might be even slower then the 15C LE because logs are slow. ▼
Post: #23
10-15-2011, 04:32 AM
I imagine it would be much faster. Integer mode doesn't use logs for y^x. It does it in a cleverer way :-) Additionally, integer logs are fast.
▼
Post: #24
10-16-2011, 01:26 AM
I've quickly coded this for the 34S. In 2's complement 64 bit integer mode, it takes 8.7 seconds to iterate fully over the range of possibilities. In real mode it takes a lot longer: 451.9 seconds (7 minutes 31.9 seconds). Those logarithms are hurting us lot. The unique result is returned in register 30 and the number of TICKS in X. I've made no real attempt to prune the search space here so I'm confident it can be sped up some more.
001 /* */ LBL A
▼
Post: #25
10-17-2011, 12:52 PM
Taking the filter out of my 15C LE program increases the run by almost one minute to 2' 28". ▼
Post: #26
10-20-2011, 02:49 PM
I must be doing something wrong, since my first brute-force program for the 15C+ found the solution in 1:12. A minor but possibly cheating optimization brought the time down to fifteen seconds. UserRPL on the 50g did it in 23 seconds, down to 13 in SysRPL. The current champion is the 30b at 3 seconds. ▼ ▼
Post: #28
10-20-2011, 03:52 PM
You have mail. It's not ready for public consumption. Give me the weekend to polish it up and I'll post it then.
Post: #29
10-20-2011, 07:25 PM
Now that I re-read your post I see the difference your time is for finding the result. My program tests all reasonable possibilities from 0000 - 9999 except 0^x that is ignored and also when it finds A^B > AB00 it skips to the next value of B and if C^D > AB00 it skips to the next value of D. As I am writing this it occurs to me that in the first case I could skip to the next value of A right away since the value B is incrementing if A^B > AB00 then A^(B+1) will certainly be larger too, and the same thing would apply for C & D. When this problem was originally posted it was not revealed that there was only one 4 digit number that would satisfy A^B*C^D = ABCD so it was necessary to check all 4 digit numbers. ▼
Post: #30
10-21-2011, 01:29 PM
Back to the drawing board... Okay, I'll revise my programs to find all numbers. So far the 15C+ did it in 1:28 and the HP 50g 1:09 in SysRPL. That's brute-force, without any filtering.
Post: #31
10-15-2011, 10:29 AM
If you wish I could provide you with a listing of my program, I don't have a WP34S at this time, but I understand the programming model is similar to 41 and 15C.
Post: #34
10-14-2011, 11:39 PM
I wander how come speed is so important for a pocket calculator used mainly for crunching numbers?
|