MATLAB: Taylor’s Approximation playing up

for looptaylor series

I'm trying to approximate a function (e^x) to a 10th order approximate about x = 0. I have made my code compatible with anonymous functions and it works for the most part. When I approximate e^x to a 8th order, it gives the correct answer, however when I go higher than the 8th order, the answer gets weird.
Here's the code:
Func = @(x) exp(x);
a = 0;
N = 10;
FuncApprox = 0;
for i = 0:N
syms x
f_derrived = matlabFunction( diff(Func(x),i) );
FuncApprox = FuncApprox + ( f_derrived(a)/factorial(i) )*( x-a )^i;
end
disp(FuncApprox)
When I run the code, this is what I get:
(1301357606610903*x^10)/4722366482869645213696 + (1626697008263629*x^9)/590295810358705651712 + x^8/40320 + x^7/5040 + x^6/720 + x^5/120 + x^4/24 + x^3/6 + x^2/2 + x + 1
When I should get:
x^10/3628800 + x^9/362880 + x^8/40320 + x^7/5040 + x^6/720 + x^5/120 + x^4/24 + x^3/6 + x^2/2 + x + 1

Best Answer

The result is mathematically correct, but the display could be simplified. 1301357606610903 / 4722366482869645213696 equals 1 / 3628800. Now it matters, what exactly your question is. Do you want to know how to simplify the output or why the values are displayed in this way?
Maybe simplifyFraction helps. ([EDITED] Nope, it does not.)
Move the factorial out of the symbolic part to the numerical part:
FuncApprox = FuncApprox + f_derrived(a) * (x - a)^i / factorial(i)
This works also, when i! exceeds flintmax.
[EDITED] Another solution:
FuncApprox = FuncApprox + (f_derrived(a) / factorial(sym(i))) * (x - a)^i;