Java program to calculate exponential e^x by using factorial and exp methods