The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (FreeBSD)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
HP Prime vs HP71 benchmark
01-20-2017, 08:35 PM
Post: #1
HP Prime vs HP71 benchmark
I finished my random Pi program and compared the Prime and HP71.

Here is the prime program:
Code:

EXPORT PITWO()
BEGIN
H:=0;
T:=0;
RANDSEED(1);
S:=Ticks;
WHILE 1 DO
T:=T+1;
X:=RANDOM()^2+RANDOM()^2;
IF X<= 1 THEN
H:=H+1;
END;

IF T MOD 10000 = 0 THEN
E:= TICKS-S;
PRINT("T:"+T+" PI:"+4*H/T+" E:"+E);
END;
END;
END;

Basically you generate two random numbers and see if it is within the radius of a circle. The ratio of the number of points inside the circle and all the points is pi/4.

For 50,000 pairs:
HP71: Pi=3.14592; Time: 8370 seconds
Prime: Pi=3.14592; Time 8.732 seconds

The prime was 960 times faster than the HP71, which I guess is not really a surprise, given the clock ratio is about 640. (Unlike the HP71, I cannot get an exact clock speed for my prime - no peek() function). The calculations appear to be identical - even to the random numbers generated.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP Prime vs HP71 benchmark - KeithB - 01-20-2017 08:35 PM
RE: HP Prime vs HP71 benchmark - Erwin - 01-20-2017, 10:35 PM
RE: HP Prime vs HP71 benchmark - KeithB - 01-20-2017, 10:57 PM
RE: HP Prime vs HP71 benchmark - KeithB - 01-23-2017, 05:38 PM
RE: HP Prime vs HP71 benchmark - KeithB - 01-24-2017, 03:45 PM
RE: HP Prime vs HP71 benchmark - KeithB - 01-24-2017, 04:32 PM
RE: HP Prime vs HP71 benchmark - KeithB - 01-24-2017, 06:13 PM
RE: HP Prime vs HP71 benchmark - Paul Dale - 01-25-2017, 06:26 AM
RE: HP Prime vs HP71 benchmark - KeithB - 01-25-2017, 03:38 PM



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