Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #13482
| From | mhx@iae.nl (Marcel Hendrix) |
|---|---|
| Subject | Re: Reverse factorial |
| Newsgroups | comp.lang.forth |
| Message-ID | <65891400968435@frunobulax.edu> (permalink) |
| Date | 2012-07-03 21:14 +0200 |
| References | <7xhatpig84.fsf@ruckus.brouhaha.com> |
| Organization | Wanadoo |
Paul Rubin <no.email@nospam.invalid> writes Re: Reverse factorial [..] >>> log10(205022!) = 999999.08681421082059069559626773741428638233100481270 >>> log10(205023!) = 1.00000439861679486551512255600216645545545382220e6 >>> Therefore 205023 as the "Smallest number with a factorial of at least 10^6 >>> digits" is correct. > Of course 10**999999.08 has 1e6 digits just like 10^9 has 10 digits. It is beyond my semantic capabability to understand what "Smallest number with a factorial of at least 10^x digits" means exactly. Nail the constraint in terms of log(n!) and the program will probably be correct. [..] > I think for inverse factorial of large numbers, it probably is pretty > accurate to use a numerical rootfinder on the first few terms of the > Stirling series: > http://en.wikipedia.org/wiki/Stirling%27s_approximation#Speed_of_convergence_and_error_estimates > Even just the first (1/12n) correction term makes Stirling's > approximation pretty accurate. Hmm, apparently that algorithm doesn't jump out of the Forth for you :-) The upperbound of log(n!) is not strictly n (for low n where I was not intending to use the words), and so the binary search walked against the bound before finding the root. -marcel
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Reverse factorial "Ed" <invalid@nospam.com> - 2012-06-29 11:51 +1000
Re: Reverse factorial mhx@iae.nl (Marcel Hendrix) - 2012-06-30 02:05 +0200
Re: Reverse factorial "Ed" <invalid@nospam.com> - 2012-06-30 12:26 +1000
Re: Reverse factorial "Ed" <invalid@nospam.com> - 2012-07-01 23:17 +1000
Re: Reverse factorial mhx@iae.nl (Marcel Hendrix) - 2012-07-01 16:51 +0200
Re: Reverse factorial "Ed" <invalid@nospam.com> - 2012-07-02 05:40 +1000
Re: Reverse factorial Paul Rubin <no.email@nospam.invalid> - 2012-07-02 22:08 -0700
Re: Reverse factorial "Ed" <invalid@nospam.com> - 2012-07-03 17:02 +1000
Re: Reverse factorial mhx@iae.nl (Marcel Hendrix) - 2012-07-03 21:14 +0200
Re: Reverse factorial Paul Rubin <no.email@nospam.invalid> - 2012-07-03 12:44 -0700
Re: Reverse factorial mhx@iae.nl (Marcel Hendrix) - 2012-07-03 22:37 +0200
Re: Reverse factorial "Ed" <invalid@nospam.com> - 2012-07-05 23:14 +1000
csiph-web