(*  trigamma_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the trigamma *)
(*    function at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  14 February 2006 *)
(*  Author:  John Burkardt *)

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

n = 1
Do [ { x = xvec[[i]], f = PolyGamma[n,x] ,
fvec = Append [ fvec, f ],
      Print["Trigamma[",x,"]=",N[f,16]] },{i,1,num,1}]

fileout=OpenWrite["/Users/burkardt/public_html/math_src/test_values/trigamma_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  trigamma_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];