[m-users.] Possible Speedup for Arbitrary Precision Integers

Delmas Buckley rbuckley at ieee.org
Fri Apr 17 10:28:28 AEST 2015


Hello Matthias,

I haven't forgotten my promise to deliver source listings for Miller-Rabin
primality testing that improve performance using arbitrary precision
integers. None of the simple fixes I've tried so far have improved
performance. On RosettaCode.org I once posted an Erlang version of
Miller-Rabin that is fairly decent and vastly outperforms Mercury (to date,
at least). It occurs to me that there is an Erlang interface for Mercury.
Why not use Erlang for the big integer stuff, and Mercury for the things
it's best at? Don't know if this is practical, but it may be a solution for
the present.

To give credit where due, I believe someone else had posted a version of
Miller-Rabin in Erlang but it worked only for small integers. I revised it
to use arbitrary precision integers. It's not as fast as the
RosettaCode.org Miller-Rabin written in SWI Prolog, but it is fast.

Best regards,
Robert Buckley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/20150416/c8051ff2/attachment.html>


More information about the users mailing list