Desk calculator utility (was Re: factorial...)

Hans Boehm boehm at parc.xerox.com
Tue Feb 12 08:25:14 AEST 1991


tif at doorstop.austin.ibm.com (Paul Chamberlain) writes:

>josevela at mtecv2.mty.itesm.mx (Jose Angel Vela Avila) writes:
>> We are having trouble trying to do the factorial of 10000 :-)

>I don't know if the smiley makes this a joke or not but I can't resist
>a challenge.  A RISC System/6000 Model 930 running bc did this in:
>	real	14m25.13s
>	user	14m10.08s
>	sys	0m3.46s

I can't resist using this as an opportunity to announce the availability of
a semi-portable version of Vernon Lee's and my desk calculator utility.  It
uses demand-driven evaluation to guarantee accuracy to whatever number of
digits is required.  (Try ln((PI + exp(-500)) - PI.)  It also uses better
algorithms to compute easy things like integer factorials.  10000! takes 31
cpu seconds on an RS/6000 model 320 (with pieces unoptimized, since the
optimizer ran out of memory.) Most of that is spent converting the
result from binary to decimal.

The calculator is available by anonymous ftp from

arisia.xerox.com:~ftp/pub/C_calc.tar.Z

It runs on Sun 3s, Sun4s, RS/6000s, MIPS machines, and some others.
(DECstations may take some work.  Send mail if you need a DECstation
version.)  A port to other 32 bit byte addressible UNIX boxes shouldn't
be hard.

(The underlying large integer package is the one from INRIA and DEC PRL.
They request that you inform them when you pick up a copy, so they can
keep track of who has copies of their package. Instructions included.)

Hans-J. Boehm (boehm at xerox.com)



More information about the Comp.unix.programmer mailing list