The exact computation of larger factorials involves arbitrary-precision arithmetic, because of fast growth and integer overflow. Time of computation can be analyzed as a function of the number of digits or bits in the result. By Stirling's formula, has bits. The Schönhage–Strassen algorithm can produce a product in time and faster multiplication algorithms taking time are known. However, computing the factorial involves repeated products, rather than a single multiplication, so these time bounds do not apply directly. In this setting, computing by multiplying the numbers from 1 in sequence is inefficient, because it involves multiplications, a constant fraction of which take time each, giving total time A better approach is to perform the multiplications as a divide-and-conquer algorithm that multiplies a sequence of numbers by splitting it into two subsequences of numbers, multiplies each subsequence, and combines the results with one last multiplication. This approach to the factorial takes total time one logarithm comes from the number of bits in the factorial, a second comes from the multiplication algorithm, and a third comes from the divide and conquer. See also "34.1.5: Performance", pp. 655–656.
The exact computation of larger factorials involves arbitrary-precision arithmetic because of fast growth and integer overflow Time of computation can be analyzed as a function of the number of digits or bits in the result By Stirling's formula has bits The Schönhage–Strassen algorithm can produce a product in time and faster multiplication algorithms taking time are known However computing the factorial involves repeated products rather than a single multiplication so these time bounds do not apply directly In this setting computing by multiplying the numbers from 1 in sequence is inefficient because it involves multiplications a constant fraction of which take time each giving total time A better approach is to perform the multiplications as a divide-and-conquer algorithm that multiplies a sequence of numbers by splitting it into two subsequences of numbers multiplies each subsequence and combines the results with one last multiplication This approach to the factorial takes total time one logarithm comes from the number of bits in the factorial a second comes from the multiplication algorithm and a third comes from the divide and conquer See also "3415 Performance" pp 655–656