Function bratio

Source
pub fn bratio(
    a: f64,
    b: f64,
    x: f64,
    y: f64,
    w: &mut f64,
    w1: &mut f64,
    ierr: &mut i32,
    log_p: bool,
)
Expand description

Evaluation of the Incomplete Beta function I_x(a,b)

It is assumed that a and b are nonnegative, and that x <= 1 and y = 1 - x. Bratio assigns w and w1 the values

w = I_x(a,b) w1 = 1 - I_x(a,b)

ierr is a variable that reports the status of the results. If no input errors are detected then ierr is set to 0 and w and w1 are computed. otherwise, if an error is detected, then w and w1 are assigned the value 0 and ierr is set to one of the following values …

ierr = 1 if a or b is negative ierr = 2 if a = b = 0 ierr = 3 if x < 0 or x > 1 ierr = 4 if y < 0 or y > 1 ierr = 5 if x + y != 1 ierr = 6 if x = a = 0 ierr = 7 if y = b = 0 ierr = 8 (not used currently) ierr = 9 NaN in a, b, x, or y ierr = 10 (not used currently) ierr = 11 bgrat() error code 1 [+ warning in bgrat()] ierr = 12 bgrat() error code 2 (no warning here) ierr = 13 bgrat() error code 3 (no warning here) ierr = 14 bgrat() error code 4 [+ WARNING in bgrat()]


Written by Alfred H. Morris, Jr. Naval Surface Warfare Center Dahlgren, Virginia Revised … Nov 1991