The value of Exponential function can be calculated using Taylor Series.
= 1 + x/1! + /2! + /3! + ......
To find its value using recursion, we will use static variables. For the power of x we will use p and for factorials we will use f as static variables.
The function shown below is used to increase the power of x.
p = p*x
The function below is used to find factorials.
f = f*n
The function below is used to calculate the summation of the series.
where r is the recursive call to the function.
Below is the implementation of the above idea.
- Tail recursion to calculate sum of array elements.
- Program to calculate value of nCr
- C program to calculate the value of nPr
- Write a program to calculate pow(x,n)
- Efficient program to calculate e^x
- Program to calculate the value of nCr Efficiently
- Program to calculate the value of sin(x) and cos(x) using Expansion
- Program for length of a string using recursion
- C++ Program to print an Array using Recursion
- Program to calculate Area Of Octagon
- Program to calculate Profit Or Loss
- Program to calculate Root Mean Square
- Program to calculate distance between two points
- Program to calculate GST from original and net prices
- Program to calculate distance between two points in 3 D
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.