function x = beta_inv( F, a, b, q, p )
% x = beta_inv( F, a, b, q, p )
% compute the inverse CDF of the beta probability distribution function
% in terms of it's min and max values (a,b)) and exponents (p,q) 

 if (b < a)
   printf('error: beta_inv: a = %f, b = %f, a must be less than b \n', a, b );
 end

 z = betaincinv( F, q, p ); 
 x = a + z*(b-a);

% beta_inv ---------------------------------------------------- 13 Feb 2024

