(* arctan_values.nb *)
(* *)
(*  Purpose: *)
(*    Evaluate the arc tan *)
(*    function at selected argument values, *)
(*    and write the data to a file. *)
(* *)
(*  Modified:  12 June 2007 *)
(*  Author:  John Burkardt *)

xvec = { 0, 1/4, 1/3, 1/2, 1, 2, 3, 4, 5, 10, 20 };
fvec = {};
num = Length [ xvec ];

Do [ { x = xvec[[i]], f = ArcTan[x] ,
fvec = Append [ fvec, f ],
      Print["  ArcTan[",x,"]=",N[f,20]] },{i,1,num,1}]

fileout=OpenWrite["/Users/burkardt/public_html/math_src/test_values/arctan_values.txt"];
SetOptions[fileout,FormatType->TextForm];
Write[fileout,"#  arctan_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,20],"  ",N[f,20]]},{i,1,num,1}];Close[fileout];