I made a program with two functions to calculate factorial. The first uses loops to made de calculations, and the second uses recursive calls to get the same result.
The same program measures the time that the computer spends to use those functions and came out with those results in milliseconds:
1! 2! 3! 4! 5! 6! 7! 8! 9! 10! 15! 19! 20!
Loop 3 4 7 11 15 19 23 30 32 36 62 78 82
Rec. 3 8 14 21 29 33 40 46 53 59 94 132 145
How can I come out with the two equations that I could put F as the factorial number and then the X came with the milliseconds spent to each method of calculation?
All I know is that the loop equation should be linear and the recursive should be exponential.
There is a question StackOverflow about the creation of that code and time measure.
For the loop series the linear regression gives the following approximation: $$ X = 4.37 \cdot F -5.68 $$
Also the recursive series is best approximated with a linear function: $$ X = 7.32 \cdot F -9.28 $$
Here are the plot of your data (in blue) and regression functions (in red).