I have the below function that I call in a parallel loop. I have declared the union inside the below function for thread safety. The issue is that doing so slow
union