(*  beta_inc_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the incomplete Beta function *)
(*    at selected argument values fx(a,b,x), *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  04 January 2006 *)
(*  Author:  John Burkardt *)

(* Set the arguments as lists. *)

avec = {1/2,1/2,1/2,1,1,1,1,1,2,2,2,2,2,2,2,2,2,55/10,10,10,10,10,20,20,20,20,20,30,30,40,  1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 5}

bvec={1/2,1/2,1/2,1/2,1/2,1/2,1/2,1,2,2,2,2,2,2,2,2,2,5,1/2,5,5,10,5,10,10,20,20,10,10,20, 1/2, 1/2, 1/2, 1/2, 2, 3, 4, 5, 2, 2, 2, 2 }
xvec = {
1/100,1/10,1,0,1/100,1/10,1/2,1/2,1/10,2/10,3/10,4/10,5/10,6/10,7/10,8/10,9/10,1/2,9/10,1/2,1,1/2,8/10,6/10,8/10,5/10,6/10,7/10,8/10,7/10, 1/10, 2/10, 3/10, 4/10,2/10, 2/10, 2/10, 2/10,3/10, 3/10, 3/10, 3/10 }
fvec = {};
num = Length [ avec ]

(* Evaluate, print and store the function values. *)

Do [ {a=avec[[i]], b=bvec[[i]],x = xvec[[i]], f = Beta[x,a,b]/Beta[a,b] ,
fvec = Append [ fvec, f ];
      Print["  Beta_Inc[",a,",",b,",",x,"]=",N[f,16]] },{i,1,num,1}]

fileout=OpenWrite["/Users/burkardt/public_html/math_src/test_values/beta_inc_values.txt"];,SetOptions[fileout,FormatType->TextForm];,Write[fileout,"#  beta_inc_values.txt"];,today=DateList[];,Write[fileout,"#  Created on ",today];,Write[fileout,"#"];,Write[fileout,"#  a  b  x  fx"];,Write[fileout,"#"];,Do[{a=avec[[i]];b=bvec[[i]],x=xvec[[i]];f=fvec[[i]];Write[fileout,N[a,12],"  ",N[b,12],"  ",N[x,12],"  ",N[f,16]]},{i,1,num,1}];Close[fileout];