HP Forums
Summation based benchmark for calculators - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: Summation based benchmark for calculators (/thread-9750.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12


RE: Summation based benchmark for calculators - Guenter Schink - 04-22-2021 06:33 PM

I think we have new champion -- by quite a margin

Prime G2 Beta 2.1.14549 using Python
Code:
#PYTHON name
from math import *
import sys
import hpprime
t=hpprime.eval("time")
c=int(sys.argv[0])
print()
print("Exponent = ",c)
print("Iterations = ", 10**c)
a=0
for i in range(1, 10**c+1):
    a=a+pow((e**(sin(atan(i)))),1/3) 
print("Time (sec) = ",round(hpprime.eval("time")-t,4))
print("Sum = ",a)
#end
Export sums(c)
Begin
  PYTHON(name, c);
End;

From the Home screen invoke this Python program with sums(?)

where "?" question mark has to be replaced by the exponent which denotes the magnitude
  • 3 for 1000
  • 4 for 10 000
  • 5 for 100 000
  • 6 for 1 000 000

Output will be the exponent, the resulting number, the time and the sum. E.g.
3
1000
0.036 sec
1395.3462877433426


Code:
Results:
3       1 000  0.036 sec     1395.3462877433426
4      10 000  0.159 sec    13955.857904429155
5     100 000  1.425 sec   139560.9761410521
6   1 000 000 14.046 sec  1395612.158725383

I think that's quite impressive specifically when compared with the values for native PPL.

Günter

Edit: put the timing into the Python code rather than using TEVAL


RE: Summation based benchmark for calculators - OlidaBel - 05-01-2021 09:18 AM

Something new to me, maybe a lack of Prime knowledge.
My Prime is configured in RPN (for stack Home computations).

I tried the sum "benchmark" proposed here, then Pick (copy) the first formula to modify it in the command line, I want to run a bigger one, from a 1000 to 10000 sum.
I only added a zero behind "1000", the Editor refuses to validate the formula. Why ?

[Image: wgZJbrL] https://ibb.co/wgZJbrL
[Image: VD2Wzp6] https://ibb.co/VD2Wzp6
[Image: WfpDSGv] https://ibb.co/WfpDSGv


RE: Summation based benchmark for calculators - pier4r - 08-05-2021 04:06 PM

Finally updated up to post #221 (yay after years! Well priorities...)

It took more than 2 hours, so it wasn't that trivial.

Updated also here: http://www.wiki4hp.com/doku.php?id=benchmarks:sum_trig_exp_root
and here: https://osdn.net/users/pier4r/pf/various_works_only_code/scm/blobs/master/rpl_hp48-50/wiki_notes_backup/summation_based_benchmark.txt

I am not so sure about some results regarding 500k with the prime G2. Now you all need to add more entries so that I have to catch up again Big Grin


RE: Summation based benchmark for calculators - Guenter Schink - 08-08-2021 10:59 AM

(08-05-2021 04:06 PM)pier4r Wrote:  Finally updated up to post #221 (yay after years! Well priorities...)

It took more than 2 hours, so it wasn't that trivial.

Updated also here: http://www.wiki4hp.com/doku.php?id=benchmarks:sum_trig_exp_root
and here: https://osdn.net/users/pier4r/pf/various_works_only_code/scm/blobs/master/rpl_hp48-50/wiki_notes_backup/summation_based_benchmark.txt

I am not so sure about some results regarding 500k with the prime G2. Now you all need to add more entries so that I have to catch up again Big Grin

The HP Expander (not XP Expander) is a calculator from HP, not a mobile device. It never saw the light of the markets. I've got a prototype at one of the HHCCs.

Günter


RE: Summation based benchmark for calculators - Massimo Gnerucci - 08-08-2021 11:03 AM

(08-08-2021 10:59 AM)Guenter Schink Wrote:  The HP Expander (not XP Expander) is a calculator from HP, not a mobile device. But I think it never saw the light of the markets. I've got a prototype at one of the HHCCs.

It actually was "HP Xpander".
Have a couple, from different development stages.


RE: Summation based benchmark for calculators - Guenter Schink - 08-08-2021 11:44 AM

(08-08-2021 11:03 AM)Massimo Gnerucci Wrote:  
(08-08-2021 10:59 AM)Guenter Schink Wrote:  The HP Expander (not XP Expander) is a calculator from HP, not a mobile device. But I think it never saw the light of the markets. I've got a prototype at one of the HHCCs.

It actually was "HP Xpander".
Have a couple, from different development stages.

Thanks for the correction. I could have had a closer look either to the device or the Wiki article Smile

Günter


RE: Summation based benchmark for calculators - Felix Stehli - 08-12-2021 08:00 AM

ThetaCalc, an RPN calculator app running on iOS which can be programmed in JavaScript, produced the following result for n = 1000000 on an iPhone 12:

HP museum benchmark (n = 1000000)
Sum = 1395612.1587253837
Time = 0.189 seconds

I don't know, however, whether the app fits into one of the given categories.

Here is the program:

Code:
function benchmark(n) {
  let s = 0;
  for (let i = 1; i <= n; i++) {
    s += Math.pow(
      Math.exp(
        Math.sin(
          Math.atan(i))), 1/3);
  }
  return s;
}

const n = 1000000;
startTimer();
let s = benchmark(n);
stopTimer();
println(`HP museum benchmark (n = ${n})`);
println(`Sum = ${s}`);
printlnElapsed();



RE: Summation based benchmark for calculators - Marc van Lemmen - 08-17-2021 11:04 PM

I recently received a Sharp PC-1201 and was currious how this nice little machine would perform, here are the results :

N=10 ~25s result 13,318529402
N=100 ~285s result 138,90159786
N=1000 ~2844s result 1394,95067416


RE: Summation based benchmark for calculators - toml_12953 - 08-17-2021 11:23 PM

(04-22-2021 06:33 PM)Guenter Schink Wrote:  I think we have new champion -- by quite a margin

Prime G2 Beta 2.1.14549 using Python

When I copy and paste that code into the emulator, I get

Code:
Traceback (most recent call last):  File "<stdin>", line 5, in <module>
ValueError: invalid syntax for integer with base 10: '10\xef\xb9\x90000'
Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
ValueError: invalid syntax for integer with base 
10: '1\xef\xb9\x90000'
Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
ValueError: invalid syntax for integer with base 
10: '1\xef\xb9\x90000'
Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
ValueError: invalid syntax for integer with base 
10: '1\xef\xb9\x90000'



RE: Summation based benchmark for calculators - Guenter Schink - 08-18-2021 03:09 PM

(08-17-2021 11:23 PM)toml_12953 Wrote:  
(04-22-2021 06:33 PM)Guenter Schink Wrote:  I think we have new champion -- by quite a margin

Prime G2 Beta 2.1.14549 using Python

When I copy and paste that code into the emulator, I get

Code:
Traceback (most recent call last):  File "<stdin>", line 5, in <module>
ValueError: invalid syntax for integer with base 10: '10\xef\xb9\x90000'
Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
ValueError: invalid syntax for integer with base 
10: '1\xef\xb9\x90000'
Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
ValueError: invalid syntax for integer with base 
10: '1\xef\xb9\x90000'
Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
ValueError: invalid syntax for integer with base 
10: '1\xef\xb9\x90000'

I just also copied it to the virtual Prime. works flawlessly. (?)

The error actually points to line 6 "c=int(sys.argv[0])" Can't assume what's going wrong.

Günter


RE: Summation based benchmark for calculators - toml_12953 - 08-18-2021 04:01 PM

(08-18-2021 03:09 PM)Guenter Schink Wrote:  
(08-17-2021 11:23 PM)toml_12953 Wrote:  When I copy and paste that code into the emulator, I get

Code:
Traceback (most recent call last):  File "<stdin>", line 5, in <module>
ValueError: invalid syntax for integer with base 10: '10\xef\xb9\x90000'
Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
ValueError: invalid syntax for integer with base 
10: '1\xef\xb9\x90000'
Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
ValueError: invalid syntax for integer with base 
10: '1\xef\xb9\x90000'
Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
ValueError: invalid syntax for integer with base 
10: '1\xef\xb9\x90000'

I just also copied it to the virtual Prime. works flawlessly. (?)

The error actually points to line 6 "c=int(sys.argv[0])" Can't assume what's going wrong.

Günter

I had digit grouping set to 123,456.789. When I change it to 123456.789, I don't get an error but I get a lot of zeroes on the screen and what may be an infinite loop.


RE: Summation based benchmark for calculators - Guenter Schink - 08-18-2021 06:56 PM

(08-18-2021 04:01 PM)toml_12953 Wrote:  I had digit grouping set to 123,456.789. When I change it to 123456.789, I don't get an error but I get a lot of zeroes on the screen and what may be an infinite loop.

o.K. I think I found the problem. It wasn't clearly explained. You have to enter the exponent rather then the number. E.g. enter 3 to get 1000 iterations. Have a look at the code and now it should become obvious.

I chose this because "sys.argv[0]" doesn't seem to work reliably with numbers greater 999. Consequently if it works somehow, the first output is a digit with as many zeros as requested, and that output takes a while.

Günter

edit: I just realized that I can't run the program from the command line I had to go to the program catalog <SHIFT> <1> and run it fro there


RE: Summation based benchmark for calculators - toml_12953 - 08-18-2021 07:18 PM

(08-18-2021 06:56 PM)Guenter Schink Wrote:  
(08-18-2021 04:01 PM)toml_12953 Wrote:  I had digit grouping set to 123,456.789. When I change it to 123456.789, I don't get an error but I get a lot of zeroes on the screen and what may be an infinite loop.

o.K. I think I found the problem. It wasn't clearly explained. You have to enter the exponent rather then the number. E.g. enter 3 to get 1000 iterations. Have a look at the code and now it should become obvious.

I chose this because "sys.argv[0]" doesn't seem to work reliably with numbers greater 999. Consequently if it works somehow, the first output is a digit with as many zeros as requested, and that output takes a while.

Günter

edit: I just realized that I can't run the program from the command line I had to go to the program catalog <SHIFT> <1> and run it fro there

Oof! Es tuit mir leid! Yes, an exponent of 1000 would take a long time! Thank you for replying.