An unexpected result involving sums of random numbers
|
03-04-2023, 04:29 PM
Post: #21
|
|||
|
|||
RE: An unexpected result involving sums of random numbers
(03-04-2023 03:09 PM)Gil Wrote: And Barbosa's program on EMU48, with Samsung A53: Obrigado, Gil! You can save 100000 additions by not incrementing the counter after the first RAND in each iteration. Also, local variables are evaluated faster than global variables. Try to use only the stack for more speed, especially on not emulated calculator (48G/GX and earlier). Additional optimization in the main loop would make it a bit faster. It appears iHP48 emulates the HP-48GX faster than the HP50g: « 0 DUP2 NOT SWAP START RAND DO RAND + SWAP 1 + SWAP DUP UNTIL 1 > END DROP NEXT SWAP / 1 + » 'X' STO « TIME 1 RDZ 100000 X TIME ROT HMS- » EVAL -> 2: 2.71959 1: 0.00153468 |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)