Algorithm 309: Gamma function with arbitrary precision

A contribution to the Algorithms Department should be in the form of an algorithm, a certific ation, or a remark. Contributionsshould be sent in duplicate to the editor, typewritten double spaced. Authors should carJfully follow the style of this department with especial attention to indentation and coinpleteness of references. will be given to algorithms written in other languages provided ihe language has been fully documonted in the open literature and provided the author presents convincing arguments that his algorithm is best described in the chosen language and cannot be adequately described in either A L G O L 60 or F O R T R A N. An algorithm written in A L G O L 60 normally consists of a commented procedure declaration. It should be typewritten double spaced in capital and lowercase letters. Material to appear in boldface type should be underlined in black. Blue underlining may be used to indicate italic type, but this is usually best left to the Editor. An algorithm written in F O R T R A N nor-really consists of a commented subprogram. I t should be typewritten double spaced in the form normally used for F O R T R A N or it shouht be in the form of a listing of a F O R T R A N card deck together with a copy of the card deck. Eacil algorithm m u s t be accompanied by a complete driver program in its language whicll generates test data, calls the procedure, and produces test answers. Moreover, selected previously obtained test answers should be given in comments in either the driver program or the algorithm. The driver program may be publishedwith the algorithm if it would be of major assistance to a user. For A L G O L 60 programs, input and output should be achieved by procedure statements, using any of the following eleven procedures (whose body is not specified in A L G O L) [See "Report on I n p u t Output Procedures for A L G O L 60," Comm. ACM 7 (Oct. 1964), 628-629]: insymbol inreal outarray ininleger outsymbol outreal outboolean outinteger length inarray outstring if only one channel is used by the program for output, it should be designated by 1 and similarly a single input channel should be designated by 2. Examples: outstring (1, ' x = ') ; outreal …