Post Reply 
Public Beta Availiable - Win/Firmware
04-17-2021, 08:36 PM
Post: #39
RE: Public Beta Availiable - Win/Firmware
A good test for eigenmath isprime would be to look at different prime bitsizes n and see if it behaves in O(n^3) (expected runtime for Miller-Rabin). This can easily be done by generating primes with nextprime in giac. For example in giac
n:=1023; p:=nextprime(2^n):; time(is_pseudoprime(p)); [0.011s]
n:=2047; p:=nextprime(2^n):; time(is_pseudoprime(p)); [0.076s]
Multiplying the bitsize by 2 should require about 8* more time to run the Miller-Rabin test, this is what we observe here with giac.

BTW, if you could run the same tests as above with giac on your computer, this would give us an additional information, the speed ratio betwen your computer and mine. Asssuming you have a more recent computer than mine, I bet that giac native is more than 10* faster than eigenmath native on x64 for your 2 integer benchmarks. This would confirm that a wasm version of giac would be at least 10* slower on big integer problems (and perhaps up to 40* slower) than a native version.

As for exporting a native compiled GMP version, this is certainly technically not easy. Moreover GMP can not be integrated into the HP Prime firmware because it is licensed under the LGPL. Well more precisely it could be, but then HP would have to bring a way to build new firmwares for people who want to modify GMP, and that's much more than supporting native code.

If you can not use the same wasm output for your benchmarks than what I generate with emscripten for the browser, then well it means wasm is not really that universal... Compiling GMP to wasm is not easy, recompiling it with another toolchain would require work, and that work must also be done for MPFR and MPFI (at least). Compiling GMP/MPFR/MPFI to ARM native is much easier and is already done for the Numworks and Nspire.

As you can see, there are many arguments in favor of native code support.

This discussion was interesting, I will probably explore a little more if GMP is the right solution for big integer support for wasm in the browser.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Public Beta Availiable - Win/Firmware - parisse - 04-17-2021 08:36 PM



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