If it is simple arithmetics then the java code should be almost as fast, if not exactly as fast, as compiled C or C++ code after a little warm-up time. This happens because of the Just-In-Time compiler that will compile the byte code to native code as it is run. At that point it will be as quick as possible.
Of course, by nature, this is not guaranteed. You could also just try it out. Though I would think that you wont gain any advantage from using a native library for that.