What this calculator does
This tool computes four related quantities for a value x: the factorial x!, the double factorial x!!, and the natural logarithm of each, ln(x!) and ln(x!!). Pick the quantity from the Function dropdown, enter your value of x, and read the result. The math is dimensionless, so no units or conversions are involved.
How to use it
Choose a function (x!, ln(x!), x!!, or ln(x!!)), type a value into Variable x, and submit. For whole numbers x! and x!! follow the classic combinatorial definitions. The engine also accepts real (non-integer) values: it uses the gamma function so that, for example, \(0.5! = \sqrt{\pi}/2\). Negative integers are gamma poles where the factorial is undefined.
The formulas explained
The factorial extends to real numbers through \(x! = \Gamma(x+1)\), the gamma function. The double factorial multiplies every other term: even n gives \(n\cdot(n-2)\cdot\ldots\cdot 2\) and odd n gives \(n\cdot(n-2)\cdot\ldots\cdot 1\), with the base cases \(0!! = 1\) and \((-1)!! = 1\). A single closed form covers all real x:
$$x!! = 2^{\frac{x}{2}+\frac{1-\cos\pi x}{4}}\,\pi^{\frac{\cos\pi x - 1}{4}}\,\Gamma\!\left(\tfrac{x}{2}+1\right)$$For very large arguments the calculator works in log space with log-gamma so it never overflows: \(\ln(x!) = \operatorname{lgamma}(x+1)\).
Worked example
Set Function = x!! and x = 6. The double factorial of 6 is
$$6\cdot 4\cdot 2 = 48$$Switching to ln(x!!) returns \(\ln(48) \approx 3.8712010109\). Likewise x = 5 with x! gives
$$1\cdot 2\cdot 3\cdot 4\cdot 5 = 120$$and ln(x!) of 5 is \(\ln(120) \approx 4.7874917428\).
FAQ
Why offer the logarithm versions? Factorials grow extremely fast and overflow ordinary floating point near \(x \approx 1.7\times 10^{308}\). The log outputs let you handle astronomically large arguments precisely.
Can x be a decimal? Yes. Non-integer x uses the gamma-function generalization, giving smooth interpolation between the integer values.
What about negative x? Negative non-integers are allowed (via gamma), but negative integers are poles where the factorial and double factorial are undefined.