Post Reply 
HP Prime: a student's view
08-31-2021, 07:12 PM (This post was last modified: 08-31-2021 07:24 PM by Thomas_Sch.)
Post: #20
RE: HP Prime: a student's view
(08-31-2021 05:22 PM)toml_12953 Wrote:  
(08-31-2021 04:27 PM)Thomas_Sch Wrote:  Done with your code. Result on Prime G2: 170426
I have no explanation for the difference.

And your code on my machine gives the same results as you got. As was pointed out the main difference between our programs is between for loops and manually decrementing and testing a counter.

It seems like for loops are highly optimized in the Prime's Python interpreter.

Since the benchmark manually decrements and tests r0, the conversion should, too. The first for loop is valid, however, since the original C program uses a for loop in that part of the program.

Thank you for Support and testing, very interesting findings.
From the C/C++ program at thimet.de/CalcCollection/CalcPerformance.html related to the while loop
Code:
  do {
      x=r0;
      x+=1;
      x-=4.567E-4;
      x+=70;
      x-=69;
      x*=7;
      x/=11;
      r0-=1;
    } while (r0>0);
imho there are few differences in the implementation.

@Liam Hays: Many thanks for the challenge ;-)
and your detailed review.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP Prime: a student's view - Liam Hays - 08-30-2021, 01:11 AM
RE: HP Prime: a student's view - Liam Hays - 08-31-2021, 01:30 AM
RE: HP Prime: a student's view - Thomas_Sch - 08-31-2021 07:12 PM
RE: HP Prime: a student's view - parisse - 08-31-2021, 07:30 PM
RE: HP Prime: a student's view - Liam Hays - 08-31-2021, 11:20 PM
RE: HP Prime: a student's view - jte - 09-01-2021, 10:43 PM
RE: HP Prime: a student's view - Liam Hays - 09-03-2021, 01:31 AM
RE: HP Prime: a student's view - jte - 09-05-2021, 03:44 PM
RE: HP Prime: a student's view - jte - 09-05-2021, 06:16 AM
RE: HP Prime: a student's view - pinkman - 09-03-2021, 09:30 PM
RE: HP Prime: a student's view - Liam Hays - 09-04-2021, 01:30 AM
RE: HP Prime: a student's view - Liam Hays - 09-04-2021, 04:49 PM
RE: HP Prime: a student's view - ijabbott - 09-04-2021, 08:44 AM



User(s) browsing this thread: 1 Guest(s)