multithreading for calling beagle library
workaround floating point issues