Binary Splitting Method: Practical examples

In Mathematical constants and computation, Xavier Gourdon and Pascal Sebah noted the Binary splitting method as a technique for fast-parallel computation. The Binary splitting method uses a divide-and-conquer approach by recursively organizing the factorial into the smaller factorials which can be computed in parallel then multiplied together to compute the result.

n! = p(0, n) = p(0,n/2) * p(n/2,n)
As a base-case (where a and b are close together), use p(a,b) = b!/a!

Note: only sub-divide p(0,n) if n is divisible by 2 with no remainder. That should be your base case in which you then compute b!/a! I'd also look for shortcut ways to cancel common factors in numerator and denominator for b!/a!

Computing ten-factorial: traditional approach

10! = 10 * 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1

Computing ten-factorial: binary splitting method

p(0,10) = p(0,(0+10)/2) * p((0+10)/2,10) = p(0,5) * p(5,10) = 120 * 30240 = 3628800

p(0,5) = 5!/0! = (5*4*3*2*1)/1 = 120

p(5,10) = 10!/5! = 10*9*8*7*6*5!/5! = 10*9*8*7*6 = 30240

Note: numerator and denominator have 5! Cancel it out to save the computation time.