# TOMS708 Incomplete Beta Function Ratios

TOMS708 is a JAVA library which computes the Incomplete Beta Function ratio

```
Ix(a,b)
```

This Java version was created by James Curran of the University of Auckland, starting from a FORTRAN77 version, applying the Fortran-to-Java (f2j) system, developed at the University of Tennessee, and then applying a considerable amount of hand recoding.

The original, true, correct version of ACM TOMS Algorithm 708 is available through ACM: http://www.acm.org/pubs/calgo or NETLIB: http://www.netlib.org/toms/index.html.

### Languages:

TOMS708 is available in a JAVA version and a FORTRAN77 version and a FORTRAN90 version.

### Related Data and Programs:

ASA063 is a FORTRAN77 library which evaluates the incomplete Beta function.

ASA109 is a FORTRAN77 library which inverts the incomplete Beta function.

ASA226 is a FORTRAN77 library which computes the CDF of the noncentral Beta distribution.

ASA310 is a FORTRAN77 library which computes the CDF of the noncentral Beta distribution.

BETA_NC is a FORTRAN90 library which evaluates the CDF of the noncentral Beta distribution.

TEST_VALUES is a FORTRAN90 library which stores a few values of various mathematical functions.

TOMS179 is an earlier ACM TOMS routine which also approximates the incomplete Beta function.

### Reference:

1. Armido Didonato, Alfred Morris, Jr,
Algorithm 708: Significant Digit Computation of the Incomplete Beta Function Ratios,
ACM Transactions on Mathematical Software,
Volume 18, Number 3, pages 360-373, 1992.

### Examples and Tests:

If you have access to the Java archive file, the test program can be executed by the command

java -jar toms708-src.jar

### List of Routines:

• ALGDIV computes ln(gamma(b)/gamma(a+b)) when 8 <= B.
• ALNREL evaluates the function ln(1 + a).
• APSER yields the incomplete beta ratio i(sub(1-x))(b,a) for
• BASYM uses an asymptotic expansion for Ix(A,B) for large A and B.
• BCORR evaluates del(a0) + del(b0) - del(a0 + b0) where
• BETA_CDF_VALUES returns some values of the incomplete Beta function.
• BETA_LOG_VALUES returns some values of the Beta function for testing.
• BETALN evaluates the logarithm of the Beta function.
• BFRAC uses a continued fraction expansion for ix(a,b) when a,b .gt. 1.
• BGRAT uses an asymptotic expansion for Ix(a,b) when a is larger than b.
• BPSER uses the power series expansion for evaluating ix(a,b) when b <= 1
• BRATIO evaluates the incomplete beta function Ix(A,B).
• BRCMP1 evaluates exp(mu) * (x**a*y**b/beta(a,b)).
• BRCOMP evaluates X**a * y**b / beta(a,b).
• BUP evaluates ix(a,b) - ix(a+n,b) where n is a positive integer.
• ERFC1 evaluates the complementary error function
• ERF evaluates the real error function.
• ERF_VALUES returns some values of the ERF or "error" function for testing.
• ESUM evaluates exp(mu + x).
• EXPARG reports the largest safe arguments for EXP(X).
• FPSER evaluates Ix(A,B) for small B and X <= 0.5.
• GAM1 computes 1/gamma(a+1) - 1 for -0.5 <= a <= 1.5
• GAMLN1 evaluates ln(gamma(1 + a)) for -0.2 <= A <= 1.25
• GAMLN evaluates ln(gamma(a)) for positive A.
• GAMMA_INC_VALUES returns some values of the incomplete Gamma function.
• GAMMA_LOG_VALUES returns some values of the Log Gamma function for testing.
• GRAT1 evaluates the incomplete Gamma ratio functions P(A,X) and Q(A,X).
• GSUMLN evaluates the function Log ( Gamma ( A + B ) ) in a special range.
• IPMPAR provides the integer machine constants for the computer
• PSI evaluates the Psi or Digamma function.
• PSI_VALUES returns some values of the Psi or Digamma function for testing.
• REXP evaluates the function Exp(X) - 1.
• RLOG1 evaluates the function X - Log ( 1 + X ).
• SPMPAR returns single precision real machine constants.

You can go up one level to the JAVA source codes.

Last revised on 08 January 2008.