Why do you need to add "#include <device.h>" in "arm_math.h"?
The method didn't work for me when it ran into a compiler error as it couldn't find the "device.h" file (on PSoC Creator 3.0)
I had to remove that line to make it work
I found that you should add "#include <project.h>" in stead of device.h (in Creator 3 and for PSoC5).
After that, no errors