set(WITH_ASSOCIATIVE_MATH ON CACHE BOOL "Enable associative math")
if(${WITH_ASSOCIATIVE_MATH})

if(CMAKE_C_COMPILER_ID MATCHES "GNU"
   OR CMAKE_C_COMPILER_ID MATCHES "Clang"
   OR CMAKE_C_COMPILER_ID MATCHES "Intel")
    set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fassociative-math")
endif()

endif()
