A fast and multi-threaded implementation of the LCM algorithm.