Post Reply 
HP Prime: a student's view
08-31-2021, 11:20 PM
Post: #22
RE: HP Prime: a student's view
Well this certainly exploded.

Tom L: I changed my code to what's below, per your suggestion, and I actually got a higher performance index, 528,000. (give or take a few hundred)
Code:
from math import *
def p_ind():
    n = 100000
    while n != 0:
        l = 10
        while l != 0:
            x = l
            x += 1
            x -= 4.567e-4
            x += 70
            x -= 69
            x *= 7
            x /= 11
            l -= 1

        x = log(x)
        x = sin(x)
        x = sqrt(x)
        x = sqrt(x)
        n -= 1

Even if I take Tom L's original code and remove the if r0 <= 0: branch, replacing the while True with while r0 != 0, I still get about the same performance as before (~170,000). I even get that same index if I replace the outer for loop with a while i != 0 loop (where i starts out as 10000 and is decremented each loop).

Thomas_Sch Wrote:imho there are few differences in the implementation.
Clearly, but where are they? I can't find anything at all, beyond differences in loops.
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 - 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)