(*  gamma_inc_q_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the incomplete Gamma Ratio Q *)
(*    at selected argument values fx(a,x), *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  08 April 2010 *)
(*  Author:  John Burkardt *)

(* Set the arguments as lists. *)
avec = {1/10,1/10,1/10,1/2,1/2,1/2,
1,1,1,11/10,11/10,11/10,
2,2,2,6,6,11,26,41}

xvec = {
3/100,3/10,15/10,3/40,
3/4,35/10,1/10,1,
5,1/10,1,5,
15/100,15/10,7,25/10,
12,16,25,45}

num = Length[ xvec]

(* Evaluate, print and store the function values. *)
fvec = {};
Do [ {a=avec[[i]], x = xvec[[i]], f = GammaRegularized[a,x] ,
fvec = Append [ fvec, f ];
      Print["  Gamma_Inc_Q[",a,",",N[x],"]=",N[f,16]] },{i,1,num,1}]

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