(*  gamma_log_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the logarithm of the Gamma *)
(*    function at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  19 January 2006 *)
(*  Author:  John Burkardt *)

xvec={ 2/10, 4/10, 6/10, 8/10, 1,
11/10, 12/10,13/10,14/10,15/10,
16/10, 17/10, 18/10, 19/10, 2,
3, 4, 10, 20, 30 };
fvec = {};
num = Length [ xvec ];

Do [ {  
x = xvec[[i]], 
f = Log [ Gamma [x]] ,
fvec = Append[fvec,f],
 Print[ "Log[Gamma[[", x,"]]] = ",N[f,16]] 
}, {i,1, num,1} ]

fileout=OpenWrite["C:\\Documents and Settings\\burkardt\\Desktop\\Misc\\mathematica\\gamma_log_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  gamma_log_values.txt"];today=DateList[];Write[fileout,"#  Created on ",today];Write[fileout,"#"];
Write[fileout,"#  x  f"];
Write[fileout,"#"];
Do[{x=xvec[[i]];f=fvec[[i]];Write[fileout,N[x,16],"  ",N[f,16]]},{i,1,num,1}];Close[fileout];