<div dir="ltr"><div><div><div>Hello Matthias,<br><br></div>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.<br><br></div><div>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.<br></div><div><br></div>Best regards,<br></div>Robert Buckley<br></div>