Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

Prev Next


Reciprocal gamma function.

double x, y, rgamma();
y = rgamma(x);

Returns one divided by the gamma function of the argument.
The function is approximated by a Chebyshev expansion in the interval [0,1].  Range reduction is by recurrence for arguments between -34.034 and +34.84425627277176174. 1/MAXNUM is returned for positive arguments outside this range. For arguments less than -34.034 the cosecant reflection formula is applied; logarithms are employed to avoid unnecessary overflow.
The reciprocal gamma function has no singularities, but overflow and underflow could occur for large arguments. These conditions return either MAXNUM or 1/MAXNUM with the appropriate sign.

                      Relative error:
arithmetic   domain     # trials      peak         rms
    DEC      -30,+30       4000       1.2e-16     1.8e-17
    IEEE     -30,+30      30000       1.1e-15     2.0e-16

For arguments less than -34.034 the peak error is in the order of 5e-15 (DEC), excepting overflow or underflow.